Mercurial > hg > RemoteEditor > vim7
comparison runtime/syntax/natural.vim @ 34:e170173ecb68 current-release
before ack base protocol.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 26 Nov 2008 15:02:10 +0900 |
parents | 76efa0be13f1 |
children | 67300faee616 |
comparison
equal
deleted
inserted
replaced
33:7d0d8b831f5a | 34:e170173ecb68 |
---|---|
1 " Vim syntax file | 1 " Vim syntax file |
2 " | 2 " |
3 " Language: NATURAL | 3 " Language: NATURAL |
4 " Version: 2.0.26.17 | 4 " Version: 2.1.0.3 |
5 " Maintainer: Marko Leipert <vim@mleipert.de> | 5 " Maintainer: Marko von Oppen <marko@von-oppen.com> |
6 " Last Changed: 2002-02-28 09:50:36 | 6 " Last Changed: 2008-07-29 01:40:52 |
7 " Support: http://www.winconsole.de/vim/syntax.html | 7 " Support: http://www.von-oppen.com/ |
8 | 8 |
9 " For version 5.x: Clear all syntax items | 9 " For version 5.x: Clear all syntax items |
10 " For version 6.x: Quit when this syntax file was already loaded | 10 " For version 6.x: Quit when this syntax file was already loaded |
11 if v:version < 600 | 11 if v:version < 600 |
12 syntax clear | 12 syntax clear |
13 set iskeyword+=-,*,#,+,_,/ | 13 set iskeyword+=-,*,#,+,_,/ |
14 elseif exists("b:current_syntax") | 14 elseif exists("b:current_syntax") |
15 finish | 15 finish |
16 else | 16 else |
17 setlocal iskeyword+=-,*,#,+,_,/ | 17 setlocal iskeyword+=-,*,#,+,_,/ |
18 endif | 18 endif |
19 | 19 |
20 " NATURAL is case insensitive | 20 " NATURAL is case insensitive |
21 syntax case ignore | 21 syntax case ignore |
22 | 22 |
23 " preprocessor | 23 " preprocessor |
24 syn keyword naturalInclude include nextgroup=naturalObjName skipwhite | 24 syn keyword naturalInclude include nextgroup=naturalObjName skipwhite |
25 | 25 |
26 " define data | 26 " define data |
27 syn keyword naturalKeyword define data end-define | 27 syn keyword naturalKeyword define data end-define |
28 syn keyword naturalKeyword independent global parameter local redefine view | 28 syn keyword naturalKeyword independent global parameter local redefine view |
29 syn keyword naturalKeyword const[ant] init initial | 29 syn keyword naturalKeyword const[ant] init initial |
30 | 30 |
31 " loops | 31 " loops |
32 syn keyword naturalLoop read end-read end-work find end-find histogram end-histogram | 32 syn keyword naturalLoop read end-read end-work find end-find histogram end-histogram |
33 syn keyword naturalLoop end-all sort end-sort sorted descending ascending | 33 syn keyword naturalLoop end-all sort end-sort sorted descending ascending |
34 syn keyword naturalRepeat repeat end-repeat while until for step end-for | 34 syn keyword naturalRepeat repeat end-repeat while until for step end-for |
35 syn keyword naturalKeyword in file with field starting from ending at thru by isn where | 35 syn keyword naturalKeyword in file with field starting from ending at thru by isn where |
36 syn keyword naturalError on error end-error | 36 syn keyword naturalError on error end-error |
37 syn keyword naturalKeyword accept reject end-enddata number unique retain as release | 37 syn keyword naturalKeyword accept reject end-enddata number unique retain as release |
38 syn keyword naturalKeyword start end-start break end-break physical page top sequence | 38 syn keyword naturalKeyword start end-start break end-break physical page top sequence |
39 syn keyword naturalKeyword end-toppage end-endpage end-endfile before processing | 39 syn keyword naturalKeyword end-toppage end-endpage end-endfile before processing |
40 syn keyword naturalKeyword end-before | 40 syn keyword naturalKeyword end-before |
41 | 41 |
42 " conditionals | 42 " conditionals |
43 syn keyword naturalConditional if then else end-if end-norec | 43 syn keyword naturalConditional if then else end-if end-norec |
44 syn keyword naturalConditional decide end-decide value when condition none any | 44 syn keyword naturalConditional decide end-decide value when condition none any |
45 | 45 |
46 " assignment / calculation | 46 " assignment / calculation |
47 syn keyword naturalKeyword reset assign move left right justified compress to into edited | 47 syn keyword naturalKeyword reset assign move left right justified compress to into edited |
48 syn keyword naturalKeyword add subtract multiply divide compute name | 48 syn keyword naturalKeyword add subtract multiply divide compute name |
49 syn keyword naturalKeyword all giving remainder rounded leaving space | 49 syn keyword naturalKeyword all giving remainder rounded leaving space numeric |
50 syn keyword naturalKeyword examine full replace giving separate delimiter modified | 50 syn keyword naturalKeyword examine full replace giving separate delimiter modified |
51 syn keyword naturalKeyword suspend identical suppress | 51 syn keyword naturalKeyword suspend identical suppress |
52 | 52 |
53 " program flow | 53 " program flow |
54 syn keyword naturalFlow callnat fetch return enter escape bottom top stack formatted | 54 syn keyword naturalFlow callnat fetch return enter escape bottom top stack formatted |
55 syn keyword naturalFlow command call | 55 syn keyword naturalFlow command call |
56 syn keyword naturalflow end-subroutine routine | 56 syn keyword naturalflow end-subroutine routine |
57 | 57 |
58 " file operations | 58 " file operations |
59 syn keyword naturalKeyword update store get delete end transaction work once close | 59 syn keyword naturalKeyword update store get delete end transaction work once close |
60 | 60 |
61 " other keywords | 61 " other keywords |
62 syn keyword naturalKeyword first every of no record[s] found ignore immediate | 62 syn keyword naturalKeyword first every of no record[s] found ignore immediate |
63 syn keyword naturalKeyword set settime key control stop terminate | 63 syn keyword naturalKeyword set settime key control stop terminate |
64 | 64 |
65 " in-/output | 65 " in-/output |
66 syn keyword naturalKeyword write display input reinput notitle nohdr map newpage mark | 66 syn keyword naturalKeyword write display input reinput notitle nohdr map newpage |
67 syn keyword naturalKeyword alarm text help eject index | 67 syn keyword naturalKeyword alarm text help eject index window base size |
68 syn keyword naturalKeyword format printer skip lines | 68 syn keyword naturalKeyword format printer skip lines |
69 | 69 |
70 " functions | 70 " functions |
71 syn keyword naturalKeyword abs atn cos exp frac int log sgn sin sqrt tan val old | 71 syn keyword naturalKeyword abs atn cos exp frac int log sgn sin sqrt tan val old |
72 syn keyword naturalKeyword pos | |
72 | 73 |
73 " report mode keywords | 74 " report mode keywords |
74 syn keyword naturalRMKeyword same loop obtain indexed do doend | 75 syn keyword naturalRMKeyword same loop obtain indexed do doend |
75 | 76 |
76 " Subroutine name | 77 " Subroutine name |
77 syn keyword naturalFlow perform subroutine nextgroup=naturalFunction skipwhite | 78 syn keyword naturalFlow perform subroutine nextgroup=naturalFunction skipwhite |
78 syn match naturalFunction "\<[a-z][-_a-z0-9]*\>" | 79 syn match naturalFunction "\<[a-z][-_a-z0-9]*\>" |
79 | 80 |
80 syn keyword naturalFlow using nextgroup=naturalKeyword,naturalObjName skipwhite | 81 syn keyword naturalFlow using nextgroup=naturalKeyword,naturalObjName skipwhite |
81 syn match naturalObjName "\<[a-z][-_a-z0-9]\{,7}\>" | 82 syn match naturalObjName "\<[a-z][-_a-z0-9]\{,7}\>" |
82 | 83 |
83 " Labels | 84 " Labels |
84 syn match naturalLabel "\<[+#a-z][-_#a-z0-9]*\." | 85 syn match naturalLabel "\<[+#a-z][-_#a-z0-9]*\." |
85 syn match naturalRef "\<[+#a-z][-_#a-z0-9]*\>\.\<[+#a-z][*]\=[-_#a-z0-9]*\>" | 86 syn match naturalRef "\<[+#a-z][-_#a-z0-9]*\>\.\<[+#a-z][*]\=[-_#a-z0-9]*\>" |
87 | |
88 " mark keyword special handling | |
89 syn keyword naturalKeyword mark nextgroup=naturalMark skipwhite | |
90 syn match naturalMark "\<\*[a-z][-_#.a-z0-9]*\>" | |
86 | 91 |
87 " System variables | 92 " System variables |
88 syn match naturalSysVar "\<\*[a-z][-a-z0-9]*\>" | 93 syn match naturalSysVar "\<\*[a-z][-a-z0-9]*\>" |
89 | 94 |
90 "integer number, or floating point number without a dot. | 95 "integer number, or floating point number without a dot. |
91 syn match naturalNumber "\<-\=\d\+\>" | 96 syn match naturalNumber "\<-\=\d\+\>" |
92 "floating point number, with dot | 97 "floating point number, with dot |
93 syn match naturalNumber "\<-\=\d\+\.\d\+\>" | 98 syn match naturalNumber "\<-\=\d\+\.\d\+\>" |
94 "floating point number, starting with a dot | 99 "floating point number, starting with a dot |
95 syn match naturalNumber "\.\d\+" | 100 syn match naturalNumber "\.\d\+" |
96 | 101 |
97 " Formats in write statement | 102 " Formats in write statement |
98 syn match naturalFormat "\<\d\+[TX]\>" | 103 syn match naturalFormat "\<\d\+[TX]\>" |
99 | 104 |
100 " String and Character contstants | 105 " String and Character contstants |
101 syn match naturalString "H'\x\+'" | 106 syn match naturalString "H'\x\+'" |
102 syn region naturalString start=+"+ end=+"+ | 107 syn region naturalString start=+"+ end=+"+ |
103 syn region naturalString start=+'+ end=+'+ | 108 syn region naturalString start=+'+ end=+'+ |
104 | 109 |
105 " Type definition | 110 " Type definition |
106 syn match naturalAttribute "\<[-a-z][a-z]=[-a-z0-9_\.,]\+\>" | 111 syn match naturalAttribute "\<[-a-z][a-z]=[-a-z0-9_\.,]\+\>" |
107 syn match naturalType contained "\<[ABINP]\d\+\(,\d\+\)\=\>" | 112 syn match naturalType contained "\<[ABINP]\d\+\(,\d\+\)\=\>" |
108 syn match naturalType contained "\<[CL]\>" | 113 syn match naturalType contained "\<[CL]\>" |
109 | 114 |
110 " "TODO" / other comments | 115 " "TODO" / other comments |
111 syn keyword naturalTodo contained todo test | 116 syn keyword naturalTodo contained todo test |
112 syn match naturalCommentMark contained "[a-z][^ \t/:|]*\(\s[^ \t/:'"|]\+\)*:\s"he=e-1 | 117 syn match naturalCommentMark contained "[a-z][^ \t/:|]*\(\s[^ \t/:'"|]\+\)*:\s"he=e-1 |
113 | 118 |
114 " comments | 119 " comments |
115 syn region naturalComment start="/\*" end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark | 120 syn region naturalComment start="/\*" end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark |
116 syn region naturalComment start="^\*[\ \*]" end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark | 121 syn region naturalComment start="^\*[ *]" end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark |
117 syn region naturalComment start="^\d\{4} \*[\ \*]"lc=5 end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark | 122 syn region naturalComment start="^\d\{4} \*[\ \*]"lc=5 end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark |
118 syn match naturalComment "^*$" | 123 syn match naturalComment "^\*$" |
119 syn match naturalComment "^\d\{4} \*$"lc=5 | 124 syn match naturalComment "^\d\{4} \*$"lc=5 |
120 " /* is legal syntax in parentheses e.g. "#ident(label./*)" | 125 " /* is legal syntax in parentheses e.g. "#ident(label./*)" |
121 syn region naturalPComment contained start="/\*\s*[^),]" end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark | 126 syn region naturalPComment contained start="/\*\s*[^),]" end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark |
122 | 127 |
123 " operators | 128 " operators |
124 syn keyword naturalOperator and or not eq ne gt lt ge le mask scan | 129 syn keyword naturalOperator and or not eq ne gt lt ge le mask scan modified |
125 | 130 |
126 " constants | 131 " constants |
127 syn keyword naturalBoolean true false | 132 syn keyword naturalBoolean true false |
128 | 133 syn match naturalLineNo "^\d\{4}" |
129 syn match naturalLineNo "^\d\{4}" | |
130 | 134 |
131 " identifiers | 135 " identifiers |
132 syn match naturalIdent "\<[+#a-z][-_#a-z0-9]*\>[^\.']"me=e-1 | 136 syn match naturalIdent "\<[+#a-z][-_#a-z0-9]*\>[^\.']"me=e-1 |
133 syn match naturalIdent "\<[+#a-z][-_#a-z0-9]*$" | 137 syn match naturalIdent "\<[+#a-z][-_#a-z0-9]*$" |
134 syn match naturalLegalIdent "[+#a-z][-_#a-z0-9]*/[-_#a-z0-9]*" | 138 syn match naturalLegalIdent "[+#a-z][-_#a-z0-9]*/[-_#a-z0-9]*" |
135 | 139 |
136 " parentheses | 140 " parentheses |
137 syn region naturalPar matchgroup=naturalParGui start="(" end=")" contains=naturalLabel,naturalRef,naturalOperator,@naturalConstant,naturalType,naturalSysVar,naturalPar,naturalLineNo,naturalPComment | 141 syn region naturalPar matchgroup=naturalParGui start="(" end=")" contains=naturalLabel,naturalRef,naturalOperator,@naturalConstant,naturalType,naturalSysVar,naturalPar,naturalLineNo,naturalPComment |
138 syn match naturalLineRef "(\d\{4})" | 142 syn match naturalLineRef "(\d\{4})" |
139 | 143 |
140 " build syntax groups | 144 " build syntax groups |
141 syntax cluster naturalConstant contains=naturalString,naturalNumber,naturalAttribute,naturalBoolean | 145 syntax cluster naturalConstant contains=naturalString,naturalNumber,naturalAttribute,naturalBoolean |
142 | 146 |
143 " folding | 147 " folding |
144 if v:version >= 600 | 148 if v:version >= 600 |
145 set foldignore=* | 149 set foldignore=* |
146 endif | 150 endif |
147 | 151 |
148 | 152 |
149 if v:version >= 508 || !exists("did_natural_syntax_inits") | 153 if v:version >= 508 || !exists("did_natural_syntax_inits") |
150 if v:version < 508 | 154 if v:version < 508 |
151 let did_natural_syntax_inits = 1 | 155 let did_natural_syntax_inits = 1 |
152 command -nargs=+ HiLink hi link <args> | 156 command -nargs=+ HiLink hi link <args> |
153 else | 157 else |
154 command -nargs=+ HiLink hi def link <args> | 158 command -nargs=+ HiLink hi def link <args> |
155 endif | 159 endif |
156 " The default methods for highlighting. Can be overridden later | 160 " The default methods for highlighting. Can be overridden later |
157 | 161 |
158 " Constants | 162 " Constants |
159 HiLink naturalFormat Constant | 163 HiLink naturalFormat Constant |
160 HiLink naturalAttribute Constant | 164 HiLink naturalAttribute Constant |
161 HiLink naturalNumber Number | 165 HiLink naturalNumber Number |
162 HiLink naturalString String | 166 HiLink naturalString String |
163 HiLink naturalBoolean Boolean | 167 HiLink naturalBoolean Boolean |
164 | 168 |
165 " All kinds of keywords | 169 " All kinds of keywords |
166 HiLink naturalConditional Conditional | 170 HiLink naturalConditional Conditional |
167 HiLink naturalRepeat Repeat | 171 HiLink naturalRepeat Repeat |
168 HiLink naturalLoop Repeat | 172 HiLink naturalLoop Repeat |
169 HiLink naturalFlow Keyword | 173 HiLink naturalFlow Keyword |
170 HiLink naturalError Keyword | 174 HiLink naturalError Keyword |
171 HiLink naturalKeyword Keyword | 175 HiLink naturalKeyword Keyword |
172 HiLink naturalOperator Operator | 176 HiLink naturalOperator Operator |
173 HiLink naturalParGui Operator | 177 HiLink naturalParGui Operator |
174 | 178 |
175 " Labels | 179 " Labels |
176 HiLink naturalLabel Label | 180 HiLink naturalLabel Label |
177 HiLink naturalRefLabel Label | 181 HiLink naturalRefLabel Label |
178 | 182 |
179 " Comments | 183 " Comments |
180 HiLink naturalPComment Comment | 184 HiLink naturalPComment Comment |
181 HiLink naturalComment Comment | 185 HiLink naturalComment Comment |
182 HiLink naturalTodo Todo | 186 HiLink naturalTodo Todo |
183 HiLink naturalCommentMark PreProc | 187 HiLink naturalCommentMark PreProc |
184 | 188 |
185 HiLink naturalInclude Include | 189 HiLink naturalInclude Include |
186 HiLink naturalSysVar Identifier | 190 HiLink naturalSysVar Identifier |
187 HiLink naturalLineNo LineNr | 191 HiLink naturalLineNo LineNr |
188 HiLink naturalLineRef Error | 192 HiLink naturalLineRef Error |
189 HiLink naturalSpecial Special | 193 HiLink naturalSpecial Special |
190 HiLink naturalComKey Todo | 194 HiLink naturalComKey Todo |
191 | 195 |
192 " illegal things | 196 " illegal things |
193 HiLink naturalRMKeyword Error | 197 HiLink naturalRMKeyword Error |
194 HiLink naturalLegalIdent Error | 198 HiLink naturalLegalIdent Error |
195 | 199 |
196 HiLink naturalType Type | 200 HiLink naturalType Type |
197 HiLink naturalFunction Function | 201 HiLink naturalFunction Function |
198 HiLink naturalObjName Function | 202 HiLink naturalObjName PreProc |
199 | 203 |
200 delcommand HiLink | 204 delcommand HiLink |
201 endif | 205 endif |
202 | 206 |
203 let b:current_syntax = "natural" | 207 let b:current_syntax = "natural" |
204 | 208 |
205 " vim:set ts=4 sw=4 noet ft=vim list: | 209 " vim:set ts=8 sw=8 noet ft=vim: |