Mercurial > vim
annotate runtime/syntax/eiffel.vim @ 20416:5ab2bc28e113
Added tag v8.2.0762 for changeset b582eb6ef1928b50f2bb38e0dc4ba691fc52902a
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 15 May 2020 22:45:04 +0200 |
parents | 46763b01cd9a |
children |
rev | line source |
---|---|
7 | 1 " Eiffel syntax file |
2 " Language: Eiffel | |
3557 | 3 " Maintainer: Jocelyn Fiat <jfiat@eiffel.com> |
4 " Previous maintainer: Reimer Behrends <behrends@cse.msu.edu> | |
5 " Contributions from: Thilo Six | |
6 " | |
7 " URL: https://github.com/eiffelhub/vim-eiffel | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
8 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
9 if exists("b:current_syntax") |
7 | 10 finish |
11 endif | |
12 | |
3557 | 13 let s:keepcpo= &cpo |
3256 | 14 set cpo&vim |
15 | |
7 | 16 " Option handling |
17 | |
18 if exists("eiffel_ignore_case") | |
19 syn case ignore | |
20 else | |
21 syn case match | |
22 if exists("eiffel_pedantic") || exists("eiffel_strict") | |
23 syn keyword eiffelError current void result precursor none | |
24 syn keyword eiffelError CURRENT VOID RESULT PRECURSOR None | |
25 syn keyword eiffelError TRUE FALSE | |
26 endif | |
27 if exists("eiffel_pedantic") | |
28 syn keyword eiffelError true false | |
29 syn match eiffelError "\<[a-z_]\+[A-Z][a-zA_Z_]*\>" | |
30 syn match eiffelError "\<[A-Z][a-z_]*[A-Z][a-zA-Z_]*\>" | |
31 endif | |
32 if exists("eiffel_lower_case_predef") | |
33 syn keyword eiffelPredefined current void result precursor | |
34 endif | |
35 endif | |
36 | |
37 if exists("eiffel_hex_constants") | |
38 syn match eiffelNumber "\d[0-9a-fA-F]*[xX]" | |
39 endif | |
40 | |
41 " Keyword definitions | |
42 | |
3557 | 43 syn keyword eiffelTopStruct note indexing feature creation inherit |
7 | 44 syn match eiffelTopStruct "\<class\>" |
45 syn match eiffelKeyword "\<end\>" | |
46 syn match eiffelTopStruct "^end\>\(\s*--\s\+class\s\+\<[A-Z][A-Z0-9_]*\>\)\=" contains=eiffelClassName | |
47 syn match eiffelBrackets "[[\]]" | |
48 syn match eiffelBracketError "\]" | |
49 syn region eiffelGeneric transparent matchgroup=eiffelBrackets start="\[" end="\]" contains=ALLBUT,eiffelBracketError,eiffelGenericDecl,eiffelStringError,eiffelStringEscape,eiffelGenericCreate,eiffelTopStruct | |
50 if exists("eiffel_ise") | |
3557 | 51 syn match eiffelAgent "\<agent\>" |
52 syn match eiffelConvert "\<convert\>" | |
7 | 53 syn match eiffelCreate "\<create\>" |
54 syn match eiffelTopStruct contained "\<create\>" | |
3557 | 55 syn match eiffelTopStruct contained "\<convert\>" |
7 | 56 syn match eiffelGenericCreate contained "\<create\>" |
57 syn match eiffelTopStruct "^create\>" | |
58 syn region eiffelGenericDecl transparent matchgroup=eiffelBrackets contained start="\[" end="\]" contains=ALLBUT,eiffelCreate,eiffelTopStruct,eiffelGeneric,eiffelBracketError,eiffelStringEscape,eiffelStringError,eiffelBrackets | |
59 syn region eiffelClassHeader start="^class\>" end="$" contains=ALLBUT,eiffelCreate,eiffelGenericCreate,eiffelGeneric,eiffelStringEscape,eiffelStringError,eiffelBrackets | |
60 endif | |
3557 | 61 syn keyword eiffelDeclaration is do once deferred unique local attribute assign |
62 syn keyword eiffelDeclaration attached detachable Unique | |
7 | 63 syn keyword eiffelProperty expanded obsolete separate frozen |
64 syn keyword eiffelProperty prefix infix | |
65 syn keyword eiffelInheritClause rename redefine undefine select export as | |
66 syn keyword eiffelAll all | |
3557 | 67 syn keyword eiffelKeyword external alias some |
7 | 68 syn keyword eiffelStatement if else elseif inspect |
69 syn keyword eiffelStatement when then | |
70 syn match eiffelAssertion "\<require\(\s\+else\)\=\>" | |
71 syn match eiffelAssertion "\<ensure\(\s\+then\)\=\>" | |
72 syn keyword eiffelAssertion check | |
73 syn keyword eiffelDebug debug | |
3557 | 74 syn keyword eiffelStatement across from until loop |
7 | 75 syn keyword eiffelAssertion variant |
76 syn match eiffelAssertion "\<invariant\>" | |
77 syn match eiffelTopStruct "^invariant\>" | |
78 syn keyword eiffelException rescue retry | |
79 | |
80 syn keyword eiffelPredefined Current Void Result Precursor | |
81 | |
82 " Operators | |
83 syn match eiffelOperator "\<and\(\s\+then\)\=\>" | |
84 syn match eiffelOperator "\<or\(\s\+else\)\=\>" | |
85 syn keyword eiffelOperator xor implies not | |
86 syn keyword eiffelOperator strip old | |
87 syn keyword eiffelOperator Strip | |
88 syn match eiffelOperator "\$" | |
89 syn match eiffelCreation "!" | |
90 syn match eiffelExport "[{}]" | |
91 syn match eiffelArray "<<" | |
92 syn match eiffelArray ">>" | |
93 syn match eiffelConstraint "->" | |
94 syn match eiffelOperator "[@#|&][^ \e\t\b%]*" | |
95 | |
96 " Special classes | |
97 syn keyword eiffelAnchored like | |
98 syn keyword eiffelBitType BIT | |
99 | |
100 " Constants | |
101 if !exists("eiffel_pedantic") | |
102 syn keyword eiffelBool true false | |
103 endif | |
104 syn keyword eiffelBool True False | |
105 syn region eiffelString start=+"+ skip=+%"+ end=+"+ contains=eiffelStringEscape,eiffelStringError | |
106 syn match eiffelStringEscape contained "%[^/]" | |
107 syn match eiffelStringEscape contained "%/\d\+/" | |
108 syn match eiffelStringEscape contained "^[ \t]*%" | |
109 syn match eiffelStringEscape contained "%[ \t]*$" | |
110 syn match eiffelStringError contained "%/[^0-9]" | |
111 syn match eiffelStringError contained "%/\d\+[^0-9/]" | |
112 syn match eiffelBadConstant "'\(%[^/]\|%/\d\+/\|[^'%]\)\+'" | |
113 syn match eiffelBadConstant "''" | |
114 syn match eiffelCharacter "'\(%[^/]\|%/\d\+/\|[^'%]\)'" contains=eiffelStringEscape | |
115 syn match eiffelNumber "-\=\<\d\+\(_\d\+\)*\>" | |
116 syn match eiffelNumber "\<[01]\+[bB]\>" | |
117 syn match eiffelNumber "-\=\<\d\+\(_\d\+\)*\.\(\d\+\(_\d\+\)*\)\=\([eE][-+]\=\d\+\(_\d\+\)*\)\=" | |
118 syn match eiffelNumber "-\=\.\d\+\(_\d\+\)*\([eE][-+]\=\d\+\(_\d\+\)*\)\=" | |
119 syn match eiffelComment "--.*" contains=eiffelTodo | |
120 | |
121 syn case match | |
122 | |
123 " Case sensitive stuff | |
124 | |
125 syn keyword eiffelTodo contained TODO XXX FIXME | |
126 syn match eiffelClassName "\<[A-Z][A-Z0-9_]*\>" | |
127 | |
128 " Catch mismatched parentheses | |
129 syn match eiffelParenError ")" | |
130 syn region eiffelParen transparent start="(" end=")" contains=ALLBUT,eiffelParenError,eiffelStringError,eiffelStringEscape | |
131 | |
3557 | 132 if exists("eiffel_fold") |
133 " setlocal foldmethod=indent | |
134 " syn sync fromstart | |
135 endif | |
136 | |
7 | 137 " Should suffice for even very long strings and expressions |
138 syn sync lines=40 | |
139 | |
140 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
141 " Only when an item doesn't have highlighting yet |
7 | 142 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
143 hi def link eiffelKeyword Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
144 hi def link eiffelProperty Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
145 hi def link eiffelInheritClause Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
146 hi def link eiffelStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
147 hi def link eiffelDeclaration Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
148 hi def link eiffelAssertion Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
149 hi def link eiffelDebug Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
150 hi def link eiffelException Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
151 hi def link eiffelGenericCreate Statement |
7 | 152 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
153 hi def link eiffelAgent Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
154 hi def link eiffelConvert Statement |
7 | 155 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
156 hi def link eiffelTopStruct PreProc |
7 | 157 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
158 hi def link eiffelAll Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
159 hi def link eiffelAnchored Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
160 hi def link eiffelBitType Special |
7 | 161 |
162 | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
163 hi def link eiffelBool Boolean |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
164 hi def link eiffelString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
165 hi def link eiffelCharacter Character |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
166 hi def link eiffelClassName Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
167 hi def link eiffelNumber Number |
7 | 168 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
169 hi def link eiffelStringEscape Special |
7 | 170 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
171 hi def link eiffelOperator Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
172 hi def link eiffelArray Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
173 hi def link eiffelExport Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
174 hi def link eiffelCreation Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
175 hi def link eiffelBrackets Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
176 hi def link eiffelGeneric Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
177 hi def link eiffelGenericDecl Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
178 hi def link eiffelConstraint Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
179 hi def link eiffelCreate Special |
7 | 180 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
181 hi def link eiffelPredefined Constant |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
182 |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
183 hi def link eiffelComment Comment |
7 | 184 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
185 hi def link eiffelError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
186 hi def link eiffelBadConstant Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
187 hi def link eiffelStringError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
188 hi def link eiffelParenError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
189 hi def link eiffelBracketError Error |
7 | 190 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
191 hi def link eiffelTodo Todo |
7 | 192 |
193 | |
194 let b:current_syntax = "eiffel" | |
195 | |
3557 | 196 let &cpo = s:keepcpo |
197 unlet s:keepcpo | |
198 | |
7 | 199 " vim: ts=8 |