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 space " "> | ||
5 | <!ENTITY punctuators ":!%&space;&()+-/.*<=>?[]{|}~^,;"> | 5 | <!ENTITY punctuators ":!%&space;&()+-/.*<=>?[]{|}~^,;"> | ||
6 | <!ENTITY ID "([_a-zA-Z][_a-zA-Z0-9]*)"> | 6 | <!ENTITY EXP "(?:[eE][+-]?[0-9](?:_?[0-9]+)*)"> | ||
7 | <!ENTITY EXP "([eE][+-]?[0-9](_?[0-9]+)*)"> | | |||
8 | <!ENTITY HEX "[0-9A-Fa-f]"> | 7 | <!ENTITY HEX "[0-9A-Fa-f]"> | ||
9 | <!ENTITY SPECHAR "(\\[abefnrtv\\0]|\\x&HEX;&HEX;|\\u&HEX;&HEX;&HEX;&HEX;|\\U&HEX;&HEX;&HEX;&HEX;&HEX;&HEX;)"> | 8 | <!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)"> | ||||
10 | <!ENTITY IDTYPE "_?[A-Z][_a-zA-Z0-9]*"> | ||||
10 | ]> | 11 | ]> | ||
11 | <language author="Jonathan Poelen (jonathan.poelen@gmail.com)" | 12 | <language author="Jonathan Poelen (jonathan.poelen@gmail.com)" | ||
12 | name="Pony" section="Sources" | 13 | name="Pony" section="Sources" | ||
13 | version="3" kateversion="5.0" | 14 | version="4" kateversion="5.0" | ||
14 | indenter="ruby" | 15 | indenter="ruby" | ||
15 | extensions="*.pony" | 16 | extensions="*.pony" | ||
16 | mimetype="text/x-pony" | 17 | mimetype="text/x-pony" | ||
17 | priority="5" | 18 | priority="5" | ||
18 | license="MIT" | 19 | license="MIT" | ||
19 | > | 20 | > | ||
20 | <!-- https://github.com/ponylang/ponyc/blob/master/pony.g --> | 21 | <!-- https://github.com/ponylang/ponyc/blob/master/pony.g --> | ||
21 | 22 | | |||
Show All 40 Lines | 57 | <list name="controlflow_begin"> | |||
62 | <item>repeat</item> | 63 | <item>repeat</item> | ||
63 | <item>for</item> | 64 | <item>for</item> | ||
64 | <item>with</item> | 65 | <item>with</item> | ||
65 | <item>try</item> | 66 | <item>try</item> | ||
66 | </list> | 67 | </list> | ||
67 | <list name="controlflow_else"> | 68 | <list name="controlflow_else"> | ||
68 | <item>else</item> | 69 | <item>else</item> | ||
69 | <item>elseif</item> | 70 | <item>elseif</item> | ||
71 | <item>elseiftype</item> | ||||
70 | </list> | 72 | </list> | ||
71 | <list name="controlflow_end"> | 73 | <list name="controlflow_end"> | ||
72 | <item>end</item> | 74 | <item>end</item> | ||
73 | </list> | 75 | </list> | ||
74 | <list name="binop"> | 76 | <list name="binop"> | ||
75 | <item>and</item> | 77 | <item>and</item> | ||
76 | <item>or</item> | 78 | <item>or</item> | ||
77 | <item>xor</item> | 79 | <item>xor</item> | ||
Show All 34 Lines | |||||
112 | </list> | 114 | </list> | ||
113 | <list name="gencapability"> | 115 | <list name="gencapability"> | ||
114 | <item>#read</item> | 116 | <item>#read</item> | ||
115 | <item>#send</item> | 117 | <item>#send</item> | ||
116 | <item>#share</item> | 118 | <item>#share</item> | ||
117 | <item>#alias</item> | 119 | <item>#alias</item> | ||
118 | <item>#any</item> | 120 | <item>#any</item> | ||
119 | </list> | 121 | </list> | ||
120 | <!-- <list name="literal"> | | |||
121 | <item>true</item> | | |||
122 | <item>false</item> | | |||
123 | </list>--> | | |||
124 | <list name="keyword"> | 122 | <list name="keyword"> | ||
123 | <item>this</item> | ||||
125 | <item>use</item> | 124 | <item>use</item> | ||
126 | <item>object</item> | 125 | <item>object</item> | ||
127 | <item>as</item> | 126 | <item>as</item> | ||
128 | <item>is</item> | 127 | <item>is</item> | ||
129 | <item>isnt</item> | 128 | <item>isnt</item> | ||
130 | <item>in</item> | 129 | <item>in</item> | ||
131 | <item>where</item> | 130 | <item>where</item> | ||
132 | <item>is</item> | 131 | <item>is</item> | ||
133 | <item>consume</item> | 132 | <item>consume</item> | ||
134 | <item>addressof</item> | 133 | <item>addressof</item> | ||
135 | <item>digestof</item> | 134 | <item>digestof</item> | ||
135 | <!-- literal --> | ||||
136 | <item>true</item> | ||||
137 | <item>false</item> | ||||
136 | </list> | 138 | </list> | ||
137 | <!-- <list name="types"> | 139 | <list name="types"> | ||
138 | <item>this</item> | | |||
139 | <item>None</item> | 140 | <item>None</item> | ||
140 | <item>String</item> | 141 | <item>String</item> | ||
141 | <item>Bool</item> | 142 | <item>Bool</item> | ||
142 | <item>ISize</item> | 143 | <item>ISize</item> | ||
143 | <item>ILong</item> | 144 | <item>ILong</item> | ||
145 | <item>I8</item> | ||||
144 | <item>I16</item> | 146 | <item>I16</item> | ||
145 | <item>I32</item> | 147 | <item>I32</item> | ||
146 | <item>I64</item> | 148 | <item>I64</item> | ||
147 | <item>I128</item> | 149 | <item>I128</item> | ||
148 | <item>USize</item> | 150 | <item>USize</item> | ||
149 | <item>ULong</item> | 151 | <item>ULong</item> | ||
152 | <item>U8</item> | ||||
150 | <item>U16</item> | 153 | <item>U16</item> | ||
151 | <item>U32</item> | 154 | <item>U32</item> | ||
152 | <item>U64</item> | 155 | <item>U64</item> | ||
153 | <item>U128</item> | 156 | <item>U128</item> | ||
154 | <item>F32</item> | 157 | <item>F32</item> | ||
155 | <item>F64</item> | 158 | <item>F64</item> | ||
156 | </list>--> | 159 | </list> | ||
157 | <contexts> | 160 | <contexts> | ||
158 | <context attribute="Normal Text" lineEndContext="#stay" name="Normal"> | 161 | <context attribute="Normal Text" lineEndContext="#stay" name="Normal"> | ||
159 | <DetectSpaces /> | 162 | <DetectSpaces /> | ||
160 | 163 | | |||
161 | <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" /> | 164 | <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" /> | ||
162 | <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" /> | 165 | <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" /> | ||
163 | 166 | | |||
164 | <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/> | 167 | <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/> | ||
165 | <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/> | 168 | <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/> | ||
166 | 169 | | |||
167 | <RegExpr attribute="Hex" context="#stay" String="[\+\-]?0x&HEX;(_?&HEX;+)*\b" /> | 170 | <RegExpr attribute="Hex" context="#stay" String="[\+\-]?0x&HEX;(?:_?&HEX;+)*\b" /> | ||
168 | <RegExpr attribute="Binary" context="#stay" String="[\+\-]?0b[01](_?[01]+)*\b" /> | 171 | <RegExpr attribute="Binary" context="#stay" String="[\+\-]?0b[01](?:_?[01]+)*\b" /> | ||
169 | <RegExpr attribute="Float" context="#stay" String="[\+\-]?[0-9](_?[0-9]+)*(\.[0-9](_?[0-9]+)*&EXP;?|&EXP;)\b" /> | 172 | <RegExpr attribute="Float" context="#stay" String="[\+\-]?[0-9](?:_?[0-9]+)*(?:\.[0-9](?:_?[0-9]+)*&EXP;?|&EXP;)\b" /> | ||
170 | <RegExpr attribute="Decimal" context="#stay" String="[\+\-]?[0-9](_?[0-9]+)*\b" /> | 173 | <RegExpr attribute="Error" context="#stay" String="[\+\-]?[0-9](?:_?[0-9]+)*\." /> | ||
171 | <RegExpr attribute="Error" context="#stay" String="[\+\-]?\.?[0-9].*\b" /> | 174 | <RegExpr attribute="Decimal" context="#stay" String="[\+\-]?[0-9](?:_?[0-9]+)*\b" /> | ||
175 | <RegExpr attribute="Error" context="#stay" String="[\+\-]?\.?[0-9]\w*" /> | ||||
172 | 176 | | |||
173 | <DetectChar attribute="External Function" context="External Function" char="@" /> | 177 | <DetectChar attribute="External Function" context="External Function" char="@" /> | ||
178 | <LineContinue attribute="Error" char=";" /> | ||||
174 | <AnyChar attribute="Symbol" context="#stay" String="&punctuators;" /> | 179 | <AnyChar attribute="Symbol" context="#stay" String="&punctuators;" /> | ||
175 | 180 | | |||
176 | <!-- <keyword attribute="Data Type" context="#stay" String="types"/> --> | 181 | <keyword attribute="Data Type" context="#stay" String="types"/> | ||
177 | <StringDetect attribute="Data Type" context="#stay" String="this" /> | | |||
178 | 182 | | |||
179 | <keyword attribute="Control Flow" context="#stay" String="controlflow_begin" beginRegion="Block"/> | 183 | <keyword attribute="Control Flow" context="#stay" String="controlflow_begin" beginRegion="Block"/> | ||
180 | <keyword attribute="Control Flow" context="#stay" String="controlflow_else" endRegion="Block" beginRegion="Block"/> | 184 | <keyword attribute="Control Flow" context="#stay" String="controlflow_else" endRegion="Block" beginRegion="Block"/> | ||
181 | <keyword attribute="Control Flow" context="#stay" String="controlflow_end" endRegion="Block"/> | 185 | <keyword attribute="Control Flow" context="#stay" String="controlflow_end" endRegion="Block"/> | ||
182 | <keyword attribute="Control Flow" context="#stay" String="controlflow"/> | 186 | <keyword attribute="Control Flow" context="#stay" String="controlflow"/> | ||
183 | <Detect2Chars attribute="Attributes" context="Attributes" char="\" char1="\"/> | 187 | <Detect2Chars attribute="Attributes" context="Attributes" char="\" char1="\"/> | ||
184 | 188 | | |||
185 | <keyword attribute="Keyword" context="DefClass" String="class_def"/> | 189 | <keyword attribute="Keyword" context="DefClass" String="class_def"/> | ||
186 | <keyword attribute="Keyword" context="DefFun" String="method"/> | 190 | <keyword attribute="Keyword" context="DefFun" String="method"/> | ||
187 | <keyword attribute="Keyword" context="DefNew" String="method_new"/> | 191 | <keyword attribute="Keyword" context="DefNew" String="method_new"/> | ||
188 | <keyword attribute="Keyword" context="#stay" String="field"/> | 192 | <keyword attribute="Keyword" context="#stay" String="field"/> | ||
189 | <keyword attribute="Keyword" context="#stay" String="keyword"/> | 193 | <keyword attribute="Keyword" context="#stay" String="keyword"/> | ||
190 | 194 | | |||
191 | <keyword attribute="Capability" context="#stay" String="capability"/> | 195 | <keyword attribute="Capability" context="#stay" String="capability"/> | ||
192 | 196 | | |||
193 | <keyword attribute="Symbol" context="#stay" String="binop"/> | 197 | <keyword attribute="Symbol" context="#stay" String="binop"/> | ||
194 | <keyword attribute="Symbol" context="#stay" String="unop"/> | 198 | <keyword attribute="Symbol" context="#stay" String="unop"/> | ||
195 | 199 | | |||
196 | <RegExpr attribute="Char" context="#stay" String="'.'" /> | 200 | <RegExpr attribute="Normal Text" context="#stay" String="&IDVAR;" /> | ||
201 | | ||||
202 | <RegExpr attribute="Char" context="#stay" String="'[^\\]'" /> <!-- only ascii char --> | ||||
197 | <RegExpr attribute="Special Char" context="#stay" String="'&SPECHAR;'" /> | 203 | <RegExpr attribute="Special Char" context="#stay" String="'&SPECHAR;'" /> | ||
198 | <RegExpr attribute="Error" context="#stay" String="''|'([^']+'?|\b)" /> | 204 | <DetectChar attribute="Error" context="#stay" char="'" /> | ||
199 | <DetectChar attribute="String" context="String" char=""" /> | 205 | <DetectChar attribute="String" context="String" char=""" /> | ||
200 | 206 | | |||
201 | <RegExpr attribute="Data Type" context="#stay" String="[A-Z]&ID;?\b" /> | 207 | <RegExpr attribute="Data Type" context="#stay" String="&IDTYPE;" /> | ||
202 | 208 | | |||
203 | <DetectChar attribute="Constraint" context="Constraint" char="#" lookAhead="true" /> | 209 | <DetectChar attribute="Constraint" context="Constraint" char="#" lookAhead="true" /> | ||
204 | 210 | | |||
205 | <DetectIdentifier /> | 211 | <DetectIdentifier /> | ||
206 | </context> | 212 | </context> | ||
207 | 213 | | |||
208 | 214 | | |||
209 | <context attribute="String" lineEndContext="SimpleString" name="String" fallthrough="true" fallthroughContext="SimpleString"> | 215 | <context attribute="String" lineEndContext="SimpleString" name="String" fallthrough="true" fallthroughContext="SimpleString"> | ||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 253 | <context attribute="Normal Text" lineEndContext="#stay" name="DefFun" fallthrough="true" fallthroughContext="#pop"> | |||
253 | <DetectIdentifier attribute="Function"/> | 259 | <DetectIdentifier attribute="Function"/> | ||
254 | </context> | 260 | </context> | ||
255 | 261 | | |||
256 | <context attribute="Normal Text" lineEndContext="#stay" name="DefClass" fallthrough="true" fallthroughContext="#pop"> | 262 | <context attribute="Normal Text" lineEndContext="#stay" name="DefClass" fallthrough="true" fallthroughContext="#pop"> | ||
257 | <DetectSpaces/> | 263 | <DetectSpaces/> | ||
258 | <Detect2Chars attribute="Attributes" context="Attributes" char="\" char1="\"/> | 264 | <Detect2Chars attribute="Attributes" context="Attributes" char="\" char1="\"/> | ||
259 | <keyword attribute="Capability" context="#stay" String="capability"/> | 265 | <keyword attribute="Capability" context="#stay" String="capability"/> | ||
260 | <DetectChar attribute="External Function" context="External Function And Pop" char="@"/> | 266 | <DetectChar attribute="External Function" context="External Function And Pop" char="@"/> | ||
261 | <RegExpr attribute="Data Type" context="#pop" String="_*[A-Z][_0-9a-zA-Z]*"/> | 267 | <RegExpr attribute="Data Type" context="#pop" String="&IDTYPE;"/> | ||
262 | <DetectIdentifier attribute="Error" /> | 268 | <DetectIdentifier attribute="Error" context="#pop"/> | ||
263 | </context> | 269 | </context> | ||
264 | 270 | | |||
265 | 271 | | |||
266 | <context attribute="External Function" lineEndContext="#pop" name="External Function" fallthrough="true" fallthroughContext="#pop"> | 272 | <context attribute="External Function" lineEndContext="#pop" name="External Function" fallthrough="true" fallthroughContext="#pop"> | ||
267 | <DetectIdentifier attribute="External Function"/> | 273 | <DetectIdentifier attribute="External Function"/> | ||
268 | </context> | 274 | </context> | ||
269 | 275 | | |||
270 | <context attribute="External Function" lineEndContext="#pop#pop" name="External Function And Pop" fallthrough="true" fallthroughContext="#pop#pop"> | 276 | <context attribute="External Function" lineEndContext="#pop#pop" name="External Function And Pop" fallthrough="true" fallthroughContext="#pop#pop"> | ||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |