Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/pony.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
---|---|---|---|---|---|
2 | <!DOCTYPE language SYSTEM "language.dtd" | 2 | <!DOCTYPE language SYSTEM "language.dtd" | ||
3 | [ | 3 | [ | ||
4 | <!ENTITY space " "> | 4 | <!ENTITY punctuators ":!&()%+-/.*<=>?[]{|}~^,;"> | ||
5 | <!ENTITY punctuators ":!%&space;&()+-/.*<=>?[]{|}~^,;"> | | |||
6 | <!ENTITY EXP "(?:[eE][+-]?[0-9](?:_?[0-9]+)*)"> | 5 | <!ENTITY EXP "(?:[eE][+-]?[0-9](?:_?[0-9]+)*)"> | ||
7 | <!ENTITY HEX "[0-9A-Fa-f]"> | 6 | <!ENTITY HEX "[0-9A-Fa-f]"> | ||
8 | <!ENTITY SPECHAR "(?:\\[abefnrtv\\0]|\\x&HEX;&HEX;|\\u&HEX;&HEX;&HEX;&HEX;|\\U&HEX;&HEX;&HEX;&HEX;&HEX;&HEX;)"> | 7 | <!ENTITY SPECHAR "(?:\\[abefnrtv\\0]|\\x&HEX;&HEX;|\\u&HEX;&HEX;&HEX;&HEX;|\\U&HEX;&HEX;&HEX;&HEX;&HEX;&HEX;)"> | ||
9 | <!ENTITY IDVAR "[a-z][_a-zA-Z0-9]*'*(?!\w)"> | 8 | <!ENTITY IDVAR "[a-z][_a-zA-Z0-9]*'*(?!\w)"> | ||
10 | <!ENTITY IDTYPE "_?[A-Z][_a-zA-Z0-9]*"> | 9 | <!ENTITY IDTYPE "_?[A-Z][_a-zA-Z0-9]*"> | ||
11 | ]> | 10 | ]> | ||
12 | <language author="Jonathan Poelen (jonathan.poelen@gmail.com)" | 11 | <language author="Jonathan Poelen (jonathan.poelen@gmail.com)" | ||
13 | name="Pony" section="Sources" | 12 | name="Pony" section="Sources" | ||
14 | version="4" kateversion="5.0" | 13 | version="5" kateversion="5.0" | ||
15 | indenter="ruby" | 14 | indenter="ruby" | ||
16 | extensions="*.pony" | 15 | extensions="*.pony" | ||
17 | mimetype="text/x-pony" | 16 | mimetype="text/x-pony" | ||
18 | priority="5" | 17 | priority="5" | ||
19 | license="MIT" | 18 | license="MIT" | ||
20 | > | 19 | > | ||
21 | <!-- https://github.com/ponylang/ponyc/blob/master/pony.g --> | 20 | <!-- https://github.com/ponylang/ponyc/blob/master/pony.g --> | ||
22 | 21 | | |||
23 | <highlighting> | 22 | <highlighting> | ||
24 | <list name="class_def"> | 23 | <list name="class_def"> | ||
25 | <item>type</item> | 24 | <item>type</item> | ||
26 | <item>interface</item> | 25 | <item>interface</item> | ||
27 | <item>trait</item> | 26 | <item>trait</item> | ||
28 | <item>primitive</item> | 27 | <item>primitive</item> | ||
29 | <item>struct</item> | 28 | <item>struct</item> | ||
30 | <item>class</item> | 29 | <item>class</item> | ||
31 | <item>actor</item> | 30 | <item>actor</item> | ||
32 | </list> | 31 | </list> | ||
33 | <list name="field"> | | |||
34 | <item>var</item> | | |||
35 | <item>let</item> | | |||
36 | <item>embed</item> | | |||
37 | </list> | | |||
38 | <list name="method"> | 32 | <list name="method"> | ||
39 | <item>fun</item> | 33 | <item>fun</item> | ||
40 | <item>be</item> | 34 | <item>be</item> | ||
41 | </list> | 35 | </list> | ||
42 | <list name="method_new"> | 36 | <list name="method_new"> | ||
43 | <item>new</item> | 37 | <item>new</item> | ||
44 | </list> | 38 | </list> | ||
45 | <list name="controlflow"> | 39 | <list name="controlflow"> | ||
Show All 22 Lines | |||||
68 | <list name="controlflow_else"> | 62 | <list name="controlflow_else"> | ||
69 | <item>else</item> | 63 | <item>else</item> | ||
70 | <item>elseif</item> | 64 | <item>elseif</item> | ||
71 | <item>elseiftype</item> | 65 | <item>elseiftype</item> | ||
72 | </list> | 66 | </list> | ||
73 | <list name="controlflow_end"> | 67 | <list name="controlflow_end"> | ||
74 | <item>end</item> | 68 | <item>end</item> | ||
75 | </list> | 69 | </list> | ||
76 | <list name="binop"> | 70 | <list name="operators"> | ||
77 | <item>and</item> | 71 | <item>and</item> | ||
78 | <item>or</item> | 72 | <item>or</item> | ||
79 | <item>xor</item> | 73 | <item>xor</item> | ||
74 | <item>not</item> | ||||
80 | </list> | 75 | </list> | ||
81 | <list name="new_overloaders"> | 76 | <list name="new_overloaders"> | ||
82 | <item>create</item> | 77 | <item>create</item> | ||
83 | </list> | 78 | </list> | ||
84 | <list name="overloaders"> | 79 | <list name="overloaders"> | ||
85 | <item>update</item> | 80 | <item>update</item> | ||
86 | <item>apply</item> | 81 | <item>apply</item> | ||
87 | <item>add</item> | 82 | <item>add</item> | ||
88 | <item>sub</item> | 83 | <item>sub</item> | ||
89 | <item>mul</item> | 84 | <item>mul</item> | ||
90 | <item>div</item> | 85 | <item>div</item> | ||
91 | <item>mod</item> | 86 | <item>mod</item> | ||
92 | <item>eq</item> | 87 | <item>eq</item> | ||
93 | <item>ne</item> | 88 | <item>ne</item> | ||
94 | <item>lt</item> | 89 | <item>lt</item> | ||
95 | <item>le</item> | 90 | <item>le</item> | ||
96 | <item>ge</item> | 91 | <item>ge</item> | ||
97 | <item>gt</item> | 92 | <item>gt</item> | ||
98 | <item>shl</item> | 93 | <item>shl</item> | ||
99 | <item>shr</item> | 94 | <item>shr</item> | ||
100 | <item>op_and</item> | 95 | <item>op_and</item> | ||
101 | <item>op_or</item> | 96 | <item>op_or</item> | ||
102 | <item>op_xor</item> | 97 | <item>op_xor</item> | ||
103 | </list> | 98 | </list> | ||
104 | <list name="unop"> | | |||
105 | <item>not</item> | | |||
106 | </list> | | |||
107 | <list name="capability"> | 99 | <list name="capability"> | ||
108 | <item>iso</item> | 100 | <item>iso</item> | ||
109 | <item>trn</item> | 101 | <item>trn</item> | ||
110 | <item>ref</item> | 102 | <item>ref</item> | ||
111 | <item>val</item> | 103 | <item>val</item> | ||
112 | <item>box</item> | 104 | <item>box</item> | ||
113 | <item>tag</item> | 105 | <item>tag</item> | ||
114 | </list> | 106 | </list> | ||
Show All 15 Lines | 114 | <list name="keyword"> | |||
130 | <item>where</item> | 122 | <item>where</item> | ||
131 | <item>is</item> | 123 | <item>is</item> | ||
132 | <item>consume</item> | 124 | <item>consume</item> | ||
133 | <item>addressof</item> | 125 | <item>addressof</item> | ||
134 | <item>digestof</item> | 126 | <item>digestof</item> | ||
135 | <!-- literal --> | 127 | <!-- literal --> | ||
136 | <item>true</item> | 128 | <item>true</item> | ||
137 | <item>false</item> | 129 | <item>false</item> | ||
130 | <!-- field --> | ||||
131 | <item>var</item> | ||||
132 | <item>let</item> | ||||
133 | <item>embed</item> | ||||
138 | </list> | 134 | </list> | ||
139 | <list name="types"> | 135 | <list name="types"> | ||
140 | <item>None</item> | 136 | <item>None</item> | ||
141 | <item>String</item> | 137 | <item>String</item> | ||
142 | <item>Bool</item> | 138 | <item>Bool</item> | ||
143 | <item>ISize</item> | 139 | <item>ISize</item> | ||
144 | <item>ILong</item> | 140 | <item>ILong</item> | ||
145 | <item>I8</item> | 141 | <item>I8</item> | ||
Show All 38 Lines | 157 | <context attribute="Normal Text" lineEndContext="#stay" name="Normal"> | |||
184 | <keyword attribute="Control Flow" context="#stay" String="controlflow_else" endRegion="Block" beginRegion="Block"/> | 180 | <keyword attribute="Control Flow" context="#stay" String="controlflow_else" endRegion="Block" beginRegion="Block"/> | ||
185 | <keyword attribute="Control Flow" context="#stay" String="controlflow_end" endRegion="Block"/> | 181 | <keyword attribute="Control Flow" context="#stay" String="controlflow_end" endRegion="Block"/> | ||
186 | <keyword attribute="Control Flow" context="#stay" String="controlflow"/> | 182 | <keyword attribute="Control Flow" context="#stay" String="controlflow"/> | ||
187 | <Detect2Chars attribute="Attributes" context="Attributes" char="\" char1="\"/> | 183 | <Detect2Chars attribute="Attributes" context="Attributes" char="\" char1="\"/> | ||
188 | 184 | | |||
189 | <keyword attribute="Keyword" context="DefClass" String="class_def"/> | 185 | <keyword attribute="Keyword" context="DefClass" String="class_def"/> | ||
190 | <keyword attribute="Keyword" context="DefFun" String="method"/> | 186 | <keyword attribute="Keyword" context="DefFun" String="method"/> | ||
191 | <keyword attribute="Keyword" context="DefNew" String="method_new"/> | 187 | <keyword attribute="Keyword" context="DefNew" String="method_new"/> | ||
192 | <keyword attribute="Keyword" context="#stay" String="field"/> | | |||
193 | <keyword attribute="Keyword" context="#stay" String="keyword"/> | 188 | <keyword attribute="Keyword" context="#stay" String="keyword"/> | ||
194 | 189 | | |||
195 | <keyword attribute="Capability" context="#stay" String="capability"/> | 190 | <keyword attribute="Capability" context="#stay" String="capability"/> | ||
196 | 191 | | |||
197 | <keyword attribute="Symbol" context="#stay" String="binop"/> | 192 | <keyword attribute="Symbol" context="#stay" String="operators"/> | ||
198 | <keyword attribute="Symbol" context="#stay" String="unop"/> | | |||
199 | 193 | | |||
200 | <RegExpr attribute="Normal Text" context="#stay" String="&IDVAR;" /> | 194 | <RegExpr attribute="Normal Text" context="#stay" String="&IDVAR;" /> | ||
201 | 195 | | |||
202 | <RegExpr attribute="Char" context="#stay" String="'[^\\]'" /> <!-- only ascii char --> | 196 | <RegExpr attribute="Char" context="#stay" String="'[^\\']'" /> <!-- only ascii char --> | ||
203 | <RegExpr attribute="Special Char" context="#stay" String="'&SPECHAR;'" /> | 197 | <RegExpr attribute="Special Char" context="#stay" String="'(?:&SPECHAR;|\\')'" /> | ||
204 | <DetectChar attribute="Error" context="#stay" char="'" /> | 198 | <DetectChar attribute="Error" context="#stay" char="'" /> | ||
205 | <DetectChar attribute="String" context="String" char=""" /> | 199 | <DetectChar attribute="String" context="String" char=""" /> | ||
206 | 200 | | |||
207 | <RegExpr attribute="Data Type" context="#stay" String="&IDTYPE;" /> | 201 | <RegExpr attribute="Data Type" context="#stay" String="&IDTYPE;" /> | ||
208 | 202 | | |||
209 | <DetectChar attribute="Constraint" context="Constraint" char="#" lookAhead="true" /> | 203 | <keyword attribute="Constraint" context="#stay" String="gencapability"/> | ||
204 | | ||||
205 | <RegExpr attribute="Error" context="#stay" String="#\w+"/> | ||||
210 | 206 | | |||
211 | <DetectIdentifier /> | 207 | <DetectIdentifier /> | ||
212 | </context> | 208 | </context> | ||
213 | 209 | | |||
214 | 210 | | |||
215 | <context attribute="String" lineEndContext="SimpleString" name="String" fallthrough="true" fallthroughContext="SimpleString"> | 211 | <context attribute="String" lineEndContext="SimpleString" name="String" fallthrough="true" fallthroughContext="SimpleString"> | ||
216 | <Detect2Chars attribute="String" context="LongString" char=""" char1="""/> | 212 | <Detect2Chars attribute="String" context="LongString" char=""" char1="""/> | ||
217 | </context> | 213 | </context> | ||
218 | 214 | | |||
219 | <context attribute="String" lineEndContext="#stay" name="SimpleString"> | 215 | <context attribute="String" lineEndContext="#stay" name="SimpleString"> | ||
220 | <RegExpr attribute="Special Char" context="#stay" String="&SPECHAR;" /> | 216 | <RegExpr attribute="Special Char" context="#stay" String="&SPECHAR;|\\"" /> | ||
221 | <RegExpr attribute="Error" context="#stay" String="\\." /> | 217 | <RegExpr attribute="Error" context="#stay" String="\\." /> | ||
222 | <DetectChar attribute="String" context="#pop#pop" char="""/> | 218 | <DetectChar attribute="String" context="#pop#pop" char="""/> | ||
219 | <DetectIdentifier /> | ||||
223 | </context> | 220 | </context> | ||
224 | 221 | | |||
225 | <context attribute="String" lineEndContext="#stay" name="LongString"> | 222 | <context attribute="String" lineEndContext="#stay" name="LongString"> | ||
223 | <DetectSpaces /> | ||||
226 | <RegExpr attribute="Special Char" context="#stay" String="&SPECHAR;" /> | 224 | <RegExpr attribute="Special Char" context="#stay" String="&SPECHAR;" /> | ||
227 | <RegExpr attribute="Error" context="#stay" String="\\." /> | 225 | <RegExpr attribute="Error" context="#stay" String="\\." /> | ||
228 | <RegExpr attribute="String" context="#pop#pop" String=""{3,}"/> | 226 | <StringDetect attribute="String" context="#pop#pop" String="""""/> | ||
227 | <DetectIdentifier /> | ||||
229 | </context> | 228 | </context> | ||
230 | 229 | | |||
231 | 230 | | |||
232 | <context attribute="Comment" lineEndContext="#pop" name="Commentar 1"> | 231 | <context attribute="Comment" lineEndContext="#pop" name="Commentar 1"> | ||
233 | <LineContinue attribute="Comment" context="#stay"/> | | |||
234 | <IncludeRules context="##Alerts" /> | 232 | <IncludeRules context="##Alerts" /> | ||
233 | <DetectIdentifier /> | ||||
235 | </context> | 234 | </context> | ||
236 | 235 | | |||
237 | <context attribute="Comment" lineEndContext="#stay" name="Commentar 2"> | 236 | <context attribute="Comment" lineEndContext="#stay" name="Commentar 2"> | ||
237 | <DetectSpaces /> | ||||
238 | <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/> | 238 | <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/> | ||
239 | <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" endRegion="Comment"/> | 239 | <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" endRegion="Comment"/> | ||
240 | <IncludeRules context="##Alerts" /> | 240 | <IncludeRules context="##Alerts" /> | ||
241 | <DetectIdentifier /> | ||||
241 | </context> | 242 | </context> | ||
242 | 243 | | |||
243 | 244 | | |||
244 | <context attribute="Normal Text" lineEndContext="#stay" name="DefNew" fallthrough="true" fallthroughContext="#pop"> | 245 | <context attribute="Normal Text" lineEndContext="#stay" name="def_base"> | ||
245 | <DetectSpaces/> | 246 | <DetectSpaces/> | ||
246 | <Detect2Chars attribute="Attributes" context="Attributes" char="\" char1="\"/> | 247 | <Detect2Chars attribute="Attributes" context="Attributes" char="\" char1="\"/> | ||
247 | <keyword attribute="Capability" context="#stay" String="capability"/> | 248 | <keyword attribute="Capability" context="#stay" String="capability"/> | ||
248 | <DetectChar attribute="External Function" context="External Function And Pop" char="@"/> | 249 | <DetectChar attribute="External Function" context="#pop!External Function" char="@"/> | ||
250 | </context> | ||||
251 | | ||||
252 | <context attribute="Normal Text" lineEndContext="#stay" name="DefNew" fallthrough="true" fallthroughContext="#pop"> | ||||
253 | <IncludeRules context="def_base" /> | ||||
249 | <keyword attribute="Overloaders" context="#pop" String="new_overloaders"/> | 254 | <keyword attribute="Overloaders" context="#pop" String="new_overloaders"/> | ||
250 | <DetectIdentifier attribute="Function"/> | 255 | <DetectIdentifier attribute="Function"/> | ||
251 | </context> | 256 | </context> | ||
252 | 257 | | |||
253 | <context attribute="Normal Text" lineEndContext="#stay" name="DefFun" fallthrough="true" fallthroughContext="#pop"> | 258 | <context attribute="Normal Text" lineEndContext="#stay" name="DefFun" fallthrough="true" fallthroughContext="#pop"> | ||
254 | <DetectSpaces/> | 259 | <IncludeRules context="def_base" /> | ||
255 | <Detect2Chars attribute="Attributes" context="Attributes" char="\" char1="\"/> | | |||
256 | <keyword attribute="Capability" context="#stay" String="capability"/> | | |||
257 | <DetectChar attribute="External Function" context="External Function And Pop" char="@"/> | | |||
258 | <keyword attribute="Overloaders" context="#pop" String="overloaders"/> | 260 | <keyword attribute="Overloaders" context="#pop" String="overloaders"/> | ||
259 | <DetectIdentifier attribute="Function"/> | 261 | <DetectIdentifier attribute="Function"/> | ||
260 | </context> | 262 | </context> | ||
261 | 263 | | |||
262 | <context attribute="Normal Text" lineEndContext="#stay" name="DefClass" fallthrough="true" fallthroughContext="#pop"> | 264 | <context attribute="Normal Text" lineEndContext="#stay" name="DefClass" fallthrough="true" fallthroughContext="#pop"> | ||
263 | <DetectSpaces/> | 265 | <IncludeRules context="def_base" /> | ||
264 | <Detect2Chars attribute="Attributes" context="Attributes" char="\" char1="\"/> | | |||
265 | <keyword attribute="Capability" context="#stay" String="capability"/> | | |||
266 | <DetectChar attribute="External Function" context="External Function And Pop" char="@"/> | | |||
267 | <RegExpr attribute="Data Type" context="#pop" String="&IDTYPE;"/> | 266 | <RegExpr attribute="Data Type" context="#pop" String="&IDTYPE;"/> | ||
268 | <DetectIdentifier attribute="Error" context="#pop"/> | 267 | <DetectIdentifier attribute="Error" context="#pop"/> | ||
269 | </context> | 268 | </context> | ||
270 | 269 | | |||
271 | 270 | | |||
272 | <context attribute="External Function" lineEndContext="#pop" name="External Function" fallthrough="true" fallthroughContext="#pop"> | 271 | <context attribute="External Function" lineEndContext="#pop" name="External Function" fallthrough="true" fallthroughContext="#pop"> | ||
273 | <DetectIdentifier attribute="External Function"/> | 272 | <DetectIdentifier attribute="External Function"/> | ||
274 | </context> | 273 | </context> | ||
275 | 274 | | |||
276 | <context attribute="External Function" lineEndContext="#pop#pop" name="External Function And Pop" fallthrough="true" fallthroughContext="#pop#pop"> | | |||
277 | <DetectIdentifier attribute="External Function"/> | | |||
278 | </context> | | |||
279 | | ||||
280 | 275 | | |||
281 | <context attribute="Attributes" lineEndContext="#pop" name="Attributes"> | 276 | <context attribute="Attributes" lineEndContext="#pop" name="Attributes"> | ||
282 | <DetectSpaces/> | 277 | <DetectSpaces/> | ||
283 | <Detect2Chars attribute="Attributes" context="#pop" char="\" char1="\"/> | 278 | <Detect2Chars attribute="Attributes" context="#pop" char="\" char1="\"/> | ||
284 | <DetectChar attribute="Attributes" context="#stay" char=","/> | 279 | <DetectChar attribute="Attributes" context="#stay" char=","/> | ||
285 | <DetectIdentifier/> | 280 | <DetectIdentifier/> | ||
286 | </context> | 281 | </context> | ||
287 | | ||||
288 | | ||||
289 | <context attribute="Error" lineEndContext="#pop" name="Constraint" fallthrough="true" fallthroughContext="#pop"> | | |||
290 | <keyword attribute="Constraint" context="#stay" String="gencapability"/> | | |||
291 | </context> | | |||
292 | </contexts> | 282 | </contexts> | ||
293 | <itemDatas> | 283 | <itemDatas> | ||
294 | <itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/> | 284 | <itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/> | ||
295 | <itemData name="Control Flow" defStyleNum="dsControlFlow" spellChecking="false"/> | 285 | <itemData name="Control Flow" defStyleNum="dsControlFlow" spellChecking="false"/> | ||
296 | <itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/> | 286 | <itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/> | ||
297 | <itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false"/> | 287 | <itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false"/> | ||
298 | <itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/> | 288 | <itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/> | ||
299 | <itemData name="External Function" defStyleNum="dsFunction" spellChecking="false"/> | 289 | <itemData name="External Function" defStyleNum="dsFunction" spellChecking="false"/> | ||
Show All 25 Lines |