| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language |
| 3 |
[ |
| 4 |
<!ENTITY punctuators ":!&()%+-/.*<=>?[]{|}~^,;"> |
| 5 |
<!ENTITY EXP "(?:[eE][+-]?[0-9](?:_?[0-9]+)*)"> |
| 6 |
<!ENTITY HEX "[0-9A-Fa-f]"> |
| 7 |
<!ENTITY SPECHAR "(?:\\[abefnrtv\\0]|\\x&HEX;&HEX;|\\u&HEX;&HEX;&HEX;&HEX;|\\U&HEX;&HEX;&HEX;&HEX;&HEX;&HEX;)"> |
| 8 |
<!ENTITY IDVAR "[a-z][_a-zA-Z0-9]*'*(?!\w)"> |
| 9 |
<!ENTITY IDTYPE "_?[A-Z][_a-zA-Z0-9]*"> |
| 10 |
]> |
| 11 |
<language author="Jonathan Poelen ([email protected])" |
| 12 |
name="Pony" section="Sources" |
| 13 |
version="7" kateversion="5.0" |
| 14 |
indenter="ruby" |
| 15 |
extensions="*.pony" |
| 16 |
mimetype="text/x-pony" |
| 17 |
priority="5" |
| 18 |
license="MIT" |
| 19 |
> |
| 20 |
<!-- https://github.com/ponylang/ponyc/blob/master/pony.g --> |
| 21 |
|
| 22 |
<highlighting> |
| 23 |
<list name="class_def"> |
| 24 |
<item>type</item> |
| 25 |
<item>interface</item> |
| 26 |
<item>trait</item> |
| 27 |
<item>primitive</item> |
| 28 |
<item>struct</item> |
| 29 |
<item>class</item> |
| 30 |
<item>actor</item> |
| 31 |
</list> |
| 32 |
<list name="method"> |
| 33 |
<item>fun</item> |
| 34 |
<item>be</item> |
| 35 |
</list> |
| 36 |
<list name="method_new"> |
| 37 |
<item>new</item> |
| 38 |
</list> |
| 39 |
<list name="controlflow"> |
| 40 |
<item>do</item> |
| 41 |
<item>then</item> |
| 42 |
<item>return</item> |
| 43 |
<item>break</item> |
| 44 |
<item>continue</item> |
| 45 |
<item>error</item> |
| 46 |
<item>compile_intrinsic</item> |
| 47 |
<item>compile_error</item> |
| 48 |
<item>recover</item> <!-- not a control flow, but ended by 'end' --> |
| 49 |
<item>until</item> |
| 50 |
</list> |
| 51 |
<list name="controlflow_begin"> |
| 52 |
<item>if</item> |
| 53 |
<item>ifdef</item> |
| 54 |
<item>iftype</item> |
| 55 |
<item>match</item> |
| 56 |
<item>while</item> |
| 57 |
<item>repeat</item> |
| 58 |
<item>for</item> |
| 59 |
<item>with</item> |
| 60 |
<item>try</item> |
| 61 |
</list> |
| 62 |
<list name="controlflow_else"> |
| 63 |
<item>else</item> |
| 64 |
<item>elseif</item> |
| 65 |
<item>elseiftype</item> |
| 66 |
</list> |
| 67 |
<list name="controlflow_end"> |
| 68 |
<item>end</item> |
| 69 |
</list> |
| 70 |
<list name="operators"> |
| 71 |
<item>and</item> |
| 72 |
<item>or</item> |
| 73 |
<item>xor</item> |
| 74 |
<item>not</item> |
| 75 |
</list> |
| 76 |
<list name="new_overloaders"> |
| 77 |
<item>create</item> |
| 78 |
</list> |
| 79 |
<list name="overloaders"> |
| 80 |
<item>update</item> |
| 81 |
<item>apply</item> |
| 82 |
<item>add</item> |
| 83 |
<item>sub</item> |
| 84 |
<item>mul</item> |
| 85 |
<item>div</item> |
| 86 |
<item>mod</item> |
| 87 |
<item>eq</item> |
| 88 |
<item>ne</item> |
| 89 |
<item>lt</item> |
| 90 |
<item>le</item> |
| 91 |
<item>ge</item> |
| 92 |
<item>gt</item> |
| 93 |
<item>shl</item> |
| 94 |
<item>shr</item> |
| 95 |
<item>op_and</item> |
| 96 |
<item>op_or</item> |
| 97 |
<item>op_xor</item> |
| 98 |
</list> |
| 99 |
<list name="capability"> |
| 100 |
<item>iso</item> |
| 101 |
<item>trn</item> |
| 102 |
<item>ref</item> |
| 103 |
<item>val</item> |
| 104 |
<item>box</item> |
| 105 |
<item>tag</item> |
| 106 |
</list> |
| 107 |
<list name="gencapability"> |
| 108 |
<item>#read</item> |
| 109 |
<item>#send</item> |
| 110 |
<item>#share</item> |
| 111 |
<item>#alias</item> |
| 112 |
<item>#any</item> |
| 113 |
</list> |
| 114 |
<list name="keyword"> |
| 115 |
<item>this</item> |
| 116 |
<item>use</item> |
| 117 |
<item>object</item> |
| 118 |
<item>as</item> |
| 119 |
<item>is</item> |
| 120 |
<item>isnt</item> |
| 121 |
<item>in</item> |
| 122 |
<item>where</item> |
| 123 |
<item>is</item> |
| 124 |
<item>consume</item> |
| 125 |
<item>addressof</item> |
| 126 |
<item>digestof</item> |
| 127 |
<!-- literal --> |
| 128 |
<item>true</item> |
| 129 |
<item>false</item> |
| 130 |
<!-- field --> |
| 131 |
<item>var</item> |
| 132 |
<item>let</item> |
| 133 |
<item>embed</item> |
| 134 |
</list> |
| 135 |
<list name="types"> |
| 136 |
<item>None</item> |
| 137 |
<item>String</item> |
| 138 |
<item>Bool</item> |
| 139 |
<item>ISize</item> |
| 140 |
<item>ILong</item> |
| 141 |
<item>I8</item> |
| 142 |
<item>I16</item> |
| 143 |
<item>I32</item> |
| 144 |
<item>I64</item> |
| 145 |
<item>I128</item> |
| 146 |
<item>USize</item> |
| 147 |
<item>ULong</item> |
| 148 |
<item>U8</item> |
| 149 |
<item>U16</item> |
| 150 |
<item>U32</item> |
| 151 |
<item>U64</item> |
| 152 |
<item>U128</item> |
| 153 |
<item>F32</item> |
| 154 |
<item>F64</item> |
| 155 |
</list> |
| 156 |
<contexts> |
| 157 |
<context attribute="Normal Text" lineEndContext="#stay" name="Normal"> |
| 158 |
<DetectSpaces /> |
| 159 |
|
| 160 |
<DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" /> |
| 161 |
<DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" /> |
| 162 |
|
| 163 |
<Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/> |
| 164 |
<Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/> |
| 165 |
|
| 166 |
<RegExpr attribute="Hex" context="#stay" String="[\+\-]?0x&HEX;(?:_?&HEX;+)*\b" /> |
| 167 |
<RegExpr attribute="Binary" context="#stay" String="[\+\-]?0b[01](?:_?[01]+)*\b" /> |
| 168 |
<RegExpr attribute="Float" context="#stay" String="[\+\-]?[0-9](?:_?[0-9]+)*(?:\.[0-9](?:_?[0-9]+)*&EXP;?|&EXP;)\b" /> |
| 169 |
<RegExpr attribute="Error" context="#stay" String="[\+\-]?[0-9](?:_?[0-9]+)*\." /> |
| 170 |
<RegExpr attribute="Decimal" context="#stay" String="[\+\-]?[0-9](?:_?[0-9]+)*\b" /> |
| 171 |
<RegExpr attribute="Error" context="#stay" String="[\+\-]?\.?[0-9]\w*" /> |
| 172 |
|
| 173 |
<DetectChar attribute="External Function" context="External Function" char="@" /> |
| 174 |
<LineContinue attribute="Error" char=";" /> |
| 175 |
<AnyChar attribute="Symbol" context="#stay" String="&punctuators;" /> |
| 176 |
|
| 177 |
<keyword attribute="Data Type" context="#stay" String="types"/> |
| 178 |
|
| 179 |
<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"/> |
| 181 |
<keyword attribute="Control Flow" context="#stay" String="controlflow_end" endRegion="Block"/> |
| 182 |
<keyword attribute="Control Flow" context="#stay" String="controlflow"/> |
| 183 |
<Detect2Chars attribute="Attributes" context="Attributes" char="\" char1="\"/> |
| 184 |
|
| 185 |
<keyword attribute="Keyword" context="DefClass" String="class_def"/> |
| 186 |
<keyword attribute="Keyword" context="DefFun" String="method"/> |
| 187 |
<keyword attribute="Keyword" context="DefNew" String="method_new"/> |
| 188 |
<keyword attribute="Keyword" context="#stay" String="keyword"/> |
| 189 |
|
| 190 |
<keyword attribute="Capability" context="#stay" String="capability"/> |
| 191 |
|
| 192 |
<keyword attribute="Symbol" context="#stay" String="operators"/> |
| 193 |
|
| 194 |
<RegExpr attribute="Normal Text" context="#stay" String="&IDVAR;" /> |
| 195 |
|
| 196 |
<RegExpr attribute="Char" context="#stay" String="'[^\\']'" /> <!-- only ascii char --> |
| 197 |
<RegExpr attribute="Special Char" context="#stay" String="'(?:&SPECHAR;|\\')'" /> |
| 198 |
<DetectChar attribute="Error" context="#stay" char="'" /> |
| 199 |
<DetectChar attribute="String" context="String" char=""" /> |
| 200 |
|
| 201 |
<RegExpr attribute="Data Type" context="#stay" String="&IDTYPE;" /> |
| 202 |
|
| 203 |
<keyword attribute="Constraint" context="#stay" String="gencapability"/> |
| 204 |
|
| 205 |
<RegExpr attribute="Error" context="#stay" String="#\w+"/> |
| 206 |
|
| 207 |
<DetectIdentifier /> |
| 208 |
</context> |
| 209 |
|
| 210 |
|
| 211 |
<context attribute="String" lineEndContext="SimpleString" name="String" fallthrough="true" fallthroughContext="SimpleString"> |
| 212 |
<Detect2Chars attribute="String" context="LongString" char=""" char1="""/> |
| 213 |
</context> |
| 214 |
|
| 215 |
<context attribute="String" lineEndContext="#stay" name="SimpleString"> |
| 216 |
<RegExpr attribute="Special Char" context="#stay" String="&SPECHAR;|\\"" /> |
| 217 |
<RegExpr attribute="Error" context="#stay" String="\\." /> |
| 218 |
<DetectChar attribute="String" context="#pop#pop" char="""/> |
| 219 |
<DetectIdentifier /> |
| 220 |
</context> |
| 221 |
|
| 222 |
<context attribute="String" lineEndContext="#stay" name="LongString"> |
| 223 |
<DetectSpaces /> |
| 224 |
<RegExpr attribute="Special Char" context="#stay" String="&SPECHAR;" /> |
| 225 |
<RegExpr attribute="Error" context="#stay" String="\\." /> |
| 226 |
<StringDetect attribute="String" context="#pop#pop" String="""""/> |
| 227 |
<DetectIdentifier /> |
| 228 |
</context> |
| 229 |
|
| 230 |
|
| 231 |
<context attribute="Comment" lineEndContext="#pop" name="Commentar 1"> |
| 232 |
<DetectSpaces /> |
| 233 |
<IncludeRules context="##Comments" /> |
| 234 |
<DetectIdentifier /> |
| 235 |
</context> |
| 236 |
|
| 237 |
<context attribute="Comment" lineEndContext="#stay" name="Commentar 2"> |
| 238 |
<DetectSpaces /> |
| 239 |
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/> |
| 240 |
<Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/> |
| 241 |
<IncludeRules context="##Comments" /> |
| 242 |
<DetectIdentifier /> |
| 243 |
</context> |
| 244 |
|
| 245 |
|
| 246 |
<context attribute="Normal Text" lineEndContext="#stay" name="def_base"> |
| 247 |
<DetectSpaces/> |
| 248 |
<Detect2Chars attribute="Attributes" context="Attributes" char="\" char1="\"/> |
| 249 |
<keyword attribute="Capability" context="#stay" String="capability"/> |
| 250 |
<DetectChar attribute="External Function" context="#pop!External Function" char="@"/> |
| 251 |
</context> |
| 252 |
|
| 253 |
<context attribute="Normal Text" lineEndContext="#stay" name="DefNew" fallthrough="true" fallthroughContext="#pop"> |
| 254 |
<IncludeRules context="def_base" /> |
| 255 |
<keyword attribute="Overloaders" context="#pop" String="new_overloaders"/> |
| 256 |
<DetectIdentifier attribute="Function"/> |
| 257 |
</context> |
| 258 |
|
| 259 |
<context attribute="Normal Text" lineEndContext="#stay" name="DefFun" fallthrough="true" fallthroughContext="#pop"> |
| 260 |
<IncludeRules context="def_base" /> |
| 261 |
<keyword attribute="Overloaders" context="#pop" String="overloaders"/> |
| 262 |
<DetectIdentifier attribute="Function"/> |
| 263 |
</context> |
| 264 |
|
| 265 |
<context attribute="Normal Text" lineEndContext="#stay" name="DefClass" fallthrough="true" fallthroughContext="#pop"> |
| 266 |
<IncludeRules context="def_base" /> |
| 267 |
<RegExpr attribute="Data Type" context="#pop" String="&IDTYPE;"/> |
| 268 |
<DetectIdentifier attribute="Error" context="#pop"/> |
| 269 |
</context> |
| 270 |
|
| 271 |
|
| 272 |
<context attribute="External Function" lineEndContext="#pop" name="External Function" fallthrough="true" fallthroughContext="#pop"> |
| 273 |
<DetectIdentifier attribute="External Function"/> |
| 274 |
</context> |
| 275 |
|
| 276 |
|
| 277 |
<context attribute="Attributes" lineEndContext="#pop" name="Attributes"> |
| 278 |
<DetectSpaces/> |
| 279 |
<Detect2Chars attribute="Attributes" context="#pop" char="\" char1="\"/> |
| 280 |
<DetectChar attribute="Attributes" context="#stay" char=","/> |
| 281 |
<DetectIdentifier/> |
| 282 |
</context> |
| 283 |
</contexts> |
| 284 |
<itemDatas> |
| 285 |
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/> |
| 286 |
<itemData name="Control Flow" defStyleNum="dsControlFlow" spellChecking="false"/> |
| 287 |
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/> |
| 288 |
<itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false"/> |
| 289 |
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/> |
| 290 |
<itemData name="External Function" defStyleNum="dsFunction" spellChecking="false"/> |
| 291 |
<itemData name="Overloaders" defStyleNum="dsFunction" spellChecking="false"/> |
| 292 |
<itemData name="Attributes" defStyleNum="dsAttribute" spellChecking="false"/> |
| 293 |
<itemData name="Constraint" defStyleNum="dsAttribute" spellChecking="false"/> |
| 294 |
<itemData name="Capability" defStyleNum="dsAttribute" spellChecking="false" bold="false" italic="true" /> |
| 295 |
<itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false"/> |
| 296 |
<itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false"/> |
| 297 |
<itemData name="Binary" defStyleNum="dsBaseN" spellChecking="false"/> |
| 298 |
<itemData name="Float" defStyleNum="dsFloat" spellChecking="false"/> |
| 299 |
<itemData name="Char" defStyleNum="dsChar" spellChecking="false"/> |
| 300 |
<itemData name="Special Char" defStyleNum="dsSpecialChar" spellChecking="false"/> |
| 301 |
<itemData name="String" defStyleNum="dsString"/> |
| 302 |
<itemData name="Comment" defStyleNum="dsComment"/> |
| 303 |
<itemData name="Symbol" defStyleNum="dsOperator" spellChecking="false"/> |
| 304 |
<itemData name="Error" defStyleNum="dsError" spellChecking="false"/> |
| 305 |
</itemDatas> |
| 306 |
</highlighting> |
| 307 |
<general> |
| 308 |
<comments> |
| 309 |
<comment name="singleLine" start="//" position="afterwhitespace" /> |
| 310 |
<comment name="multiLine" start="/*" end="*/" region="Comment" /> |
| 311 |
</comments> |
| 312 |
<keywords casesensitive="1" weakDeliminator="#" /> |
| 313 |
</general> |
| 314 |
</language> |
| 315 |
<!-- kate: indent-width 2; tab-width 2; --> |