annotate runtime/syntax/cupl.vim @ 4686:8db697ae406a v7.3.1090

updated for version 7.3.1090 Problem: New regexp engine does not support \z1 .. \z9 and \z(. Solution: Implement the syntax submatches.
author Bram Moolenaar <bram@vim.org>
date Sat, 01 Jun 2013 23:02:54 +0200
parents 91e53bcb7946
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: CUPL
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
3 " Maintainer: John Cook <johncook3@gmail.com>
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
4 " Last Change: 2011 Dec 27
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
14 let s:cpo_save = &cpo
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
15 set cpo&vim
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
16
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " this language is oblivious to case.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " A bunch of keywords
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn keyword cuplHeader name partno date revision rev designer company nextgroup=cuplHeaderContents
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn keyword cuplHeader assembly assy location device nextgroup=cuplHeaderContents
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn keyword cuplTodo contained TODO XXX FIXME
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 " cuplHeaderContents uses default highlighting except for numbers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn match cuplHeaderContents ".\+;"me=e-1 contains=cuplNumber contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " String contstants
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn region cuplString start=+'+ end=+'+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn region cuplString start=+"+ end=+"+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn keyword cuplStatement append condition
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword cuplStatement default else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn keyword cuplStatement field fld format function fuse
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn keyword cuplStatement group if jump loc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn keyword cuplStatement macro min node out
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn keyword cuplStatement pin pinnode present table
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn keyword cuplStatement sequence sequenced sequencejk sequencers sequencet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn keyword cuplFunction log2 log8 log16 log
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 " Valid integer number formats (decimal, binary, octal, hex)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match cuplNumber "\<[-+]\=[0-9]\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn match cuplNumber "'d'[0-9]\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match cuplNumber "'b'[01x]\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match cuplNumber "'o'[0-7x]\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match cuplNumber "'h'[0-9a-fx]\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 " operators
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match cuplLogicalOperator "[!#&$]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match cuplArithmeticOperator "[-+*/%]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn match cuplArithmeticOperator "\*\*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn match cuplAssignmentOperator ":\=="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn match cuplEqualityOperator ":"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn match cuplTruthTableOperator "=>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 " Signal extensions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn match cuplExtension "\.[as][pr]\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn match cuplExtension "\.oe\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn match cuplExtension "\.oemux\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn match cuplExtension "\.[dlsrjk]\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn match cuplExtension "\.ck\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn match cuplExtension "\.dq\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn match cuplExtension "\.ckmux\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn match cuplExtension "\.tec\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn match cuplExtension "\.cnt\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 syn match cuplRangeOperator "\.\." contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 " match ranges like memadr:[0000..1FFF]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 " and highlight both the numbers and the .. operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn match cuplNumberRange "\<\x\+\.\.\x\+\>" contains=cuplRangeOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 " match vectors of type [name3..0] (decimal numbers only)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 " but assign them no special highlighting except for the .. operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 syn match cuplBitVector "\<\a\+\d\+\.\.\d\+\>" contains=cuplRangeOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 " other special characters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 syn match cuplSpecialChar "[\[\](){},;]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 " directives
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 " (define these after cuplOperator so $xxx overrides $)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 syn match cuplDirective "\$msg"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 syn match cuplDirective "\$macro"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 syn match cuplDirective "\$mend"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 syn match cuplDirective "\$repeat"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn match cuplDirective "\$repend"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 syn match cuplDirective "\$define"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 syn match cuplDirective "\$include"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 " multi-line comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 syn region cuplComment start=+/\*+ end=+\*/+ contains=cuplNumber,cuplTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 syn sync minlines=1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 if version >= 508 || !exists("did_cupl_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 let did_cupl_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 " The default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 HiLink cuplHeader cuplStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 HiLink cuplLogicalOperator cuplOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 HiLink cuplRangeOperator cuplOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 HiLink cuplArithmeticOperator cuplOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 HiLink cuplAssignmentOperator cuplOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 HiLink cuplEqualityOperator cuplOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 HiLink cuplTruthTableOperator cuplOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 HiLink cuplOperator cuplStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 HiLink cuplFunction cuplStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 HiLink cuplStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 HiLink cuplNumberRange cuplNumber
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 HiLink cuplNumber cuplString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 HiLink cuplString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 HiLink cuplComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 HiLink cuplExtension cuplSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 HiLink cuplSpecialChar cuplSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 HiLink cuplSpecial Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 HiLink cuplDirective PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 HiLink cuplTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 let b:current_syntax = "cupl"
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
133
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
134 let &cpo = s:cpo_save
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
135 unlet s:cpo_save
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
136
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 " vim:ts=8