Warning, /frameworks/syntax-highlighting/data/syntax/brightscript.xml is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <!DOCTYPE language>
0003 <language
0004         name="BrightScript"
0005         section="Scripts"
0006         extensions="*.brs"
0007         version="11"
0008         kateversion="5.0"
0009         author="Daniel Levin (dendy.ua@gmail.com)"
0010         license="MIT">
0011 
0012 <highlighting>
0013 
0014 
0015 
0016 
0017 <list name="library"><item>library</item></list>
0018 
0019 <list name="function"><item>function</item></list>
0020 <list name="endfunction"><item>endfunction</item></list>
0021 <list name="sub"><item>sub</item></list>
0022 <list name="endsub"><item>endsub</item></list>
0023 <list name="as"><item>as</item></list>
0024 
0025 <list name="exit"><item>exit</item></list>
0026 
0027 <list name="if"><item>if</item></list>
0028 <list name="endif"><item>endif</item></list>
0029 <list name="then"><item>then</item></list>
0030 <list name="else"><item>else</item></list>
0031 <list name="elseif"><item>elseif</item></list>
0032 
0033 <list name="while"><item>while</item></list>
0034 <list name="endwhile"><item>endwhile</item></list>
0035 <list name="exitwhile"><item>exitwhile</item></list>
0036 
0037 <list name="for"><item>for</item></list>
0038 <list name="endfor"><item>endfor</item></list>
0039 <list name="each"><item>each</item></list>
0040 <list name="in"><item>in</item></list>
0041 <list name="to"><item>to</item></list>
0042 <list name="step"><item>step</item></list>
0043 <list name="next"><item>next</item></list>
0044 
0045 <list name="print"><item>print</item></list>
0046 <list name="return"><item>return</item></list>
0047 
0048 <list name="dim"><item>dim</item></list>
0049 <list name="stop"><item>stop</item></list>
0050 <list name="goto"><item>goto</item></list>
0051 
0052 <list name="try"><item>try</item></list>
0053 <list name="endtry"><item>endtry</item></list>
0054 <list name="catch"><item>catch</item></list>
0055 <list name="throw"><item>throw</item></list>
0056 
0057 <list name="m"><item>m</item></list>
0058 <list name="top">
0059         <item>top</item>
0060         <item>global</item>
0061 </list>
0062 
0063 <list name="end_of_scope">
0064         <item>then</item>
0065         <item>end</item>
0066         <item>exit</item>
0067 </list>
0068 
0069 <list name="unary">
0070         <item>not</item>
0071 </list>
0072 
0073 <list name="builtin_functions">
0074         <item>tab</item>
0075         <item>pos</item>
0076         <item>CreateObject</item>
0077         <item>Type</item>
0078         <item>GetGlobalAA</item>
0079         <item>Box</item>
0080         <item>Run</item>
0081         <item>Eval</item>
0082         <item>GetLastRunCompileError</item>
0083         <item>GetLastRunRuntimeError</item>
0084         <item>ObjFun</item>
0085 </list>
0086 
0087 <list name="utility_functions">
0088         <item>Sleep</item>
0089         <item>Wait</item>
0090         <item>GetInterface</item>
0091         <item>FindMemberFunction</item>
0092         <item>UpTime</item>
0093         <item>RebootSystem</item>
0094         <item>ListDir</item>
0095         <item>ReadAsciiFile</item>
0096         <item>WriteAsciiFile</item>
0097         <item>CopyFile</item>
0098         <item>MoveFile</item>
0099         <item>MatchFiles</item>
0100         <item>DeleteFile</item>
0101         <item>DeleteDirectory</item>
0102         <item>CreateDirectory</item>
0103         <item>FormatDrive</item>
0104         <item>StrToI</item>
0105         <item>RunGarbageCollector</item>
0106         <item>ParseJson</item>
0107         <item>FormatJson</item>
0108         <item>Tr</item>
0109 </list>
0110 
0111 <list name="string_functions">
0112         <item>UCase</item>
0113         <item>LCase</item>
0114         <item>Asc</item>
0115         <item>Chr</item>
0116         <item>Instr</item>
0117         <item>Left</item>
0118         <item>Len</item>
0119         <item>Mid</item>
0120         <item>Str</item>
0121         <item>StrI</item>
0122         <item>String</item>
0123         <item>StringI</item>
0124         <item>Val</item>
0125         <item>Substitute</item>
0126 </list>
0127 
0128 <list name="math_functions">
0129         <item>Abs</item>
0130         <item>Atn</item>
0131         <item>Cdbl</item>
0132         <item>Cint</item>
0133         <item>Cos</item>
0134         <item>Csng</item>
0135         <item>Exp</item>
0136         <item>Fix</item>
0137         <item>Int</item>
0138         <item>Log</item>
0139         <item>Rnd</item>
0140         <item>Sgn</item>
0141         <item>Sin</item>
0142         <item>Sqr</item>
0143         <item>Tan</item>
0144 </list>
0145 
0146 <list name="comments">
0147         <item>rem</item>
0148 </list>
0149 
0150 <list name="types">
0151         <item>invalid</item>
0152         <item>void</item>
0153         <item>dynamic</item>
0154         <item>boolean</item>
0155         <item>integer</item>
0156         <item>longinteger</item>
0157         <item>float</item>
0158         <item>double</item>
0159         <item>string</item>
0160         <item>object</item>
0161         <item>function</item>
0162         <item>interface</item>
0163 </list>
0164 
0165 <list name="constants">
0166         <item>true</item>
0167         <item>false</item>
0168         <item>invalid</item>
0169         <item>LINE_NUM</item>
0170 </list>
0171 
0172 
0173 
0174 
0175 <contexts>
0176 
0177 <!-- Contexts starting with @ are for inclusion only. -->
0178 
0179 <context name="global" attribute="g" lineEndContext="#stay">
0180         <DetectSpaces/>
0181         <keyword String="library" attribute="import" context="library"/>
0182         <IncludeRules context="@comment"/>
0183         <IncludeRules context="@macro"/>
0184         <IncludeRules context="@function"/>
0185         <IncludeRules context="@sub"/>
0186 </context>
0187 
0188 
0189 <!-- Import statement, which might appear at the global context:
0190          library "mylibname.brs"
0191 -->
0192 <context name="library" attribute="import" lineEndContext="#pop">
0193         <DetectSpaces/>
0194         <DetectChar char="&quot;" attribute="string" context="#pop!string"/>
0195 </context>
0196 
0197 
0198 <!-- Comments have higher priority over anything else. -->
0199 <context name="@comment" attribute="g" lineEndContext="#stay">
0200         <DetectSpaces/>
0201         <DetectChar char="'" attribute="comment" context="comment"/>
0202         <keyword String="comments" attribute="comment" context="comment"/>
0203 </context>
0204 
0205 <context name="comment" attribute="comment" lineEndContext="#pop">
0206         <IncludeRules context="##Comments"/>
0207 </context>
0208 
0209 
0210 <!-- Macro statement starts with # and might appear anywhere in the code:
0211          #if foo
0212              ...
0213          #else
0214              ...
0215          #endif
0216 -->
0217 <context name="@macro" attribute="g" lineEndContext="#stay">
0218         <DetectChar char="#" attribute="macro" context="macro_line"/>
0219 </context>
0220 
0221 <context name="macro_line" attribute="macro" lineEndContext="#pop">
0222         <IncludeRules context="@comment"/>
0223 </context>
0224 
0225 
0226 <!-- Colon starts a new line. -->
0227 <context name="line_break" attribute="g" lineEndContext="#stay">
0228         <IncludeRules context="@line_break"/>
0229 </context>
0230 
0231 <context name="@line_break" attribute="g" lineEndContext="#stay">
0232         <DetectChar char=":" attribute="line_break" context="#pop"/>
0233 </context>
0234 
0235 
0236 <!-- Common rules for function and sub. -->
0237 <context name="@code_end" attribute="g" lineEndContext="#stay">
0238         <RegExpr String="end\s+(if|for|while)" insensitive="true" attribute="control"/>
0239 </context>
0240 
0241 <context name="arg_as_type" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
0242         <DetectSpaces/>
0243         <DetectIdentifier attribute="var" context="#pop!arg_params"/>
0244 </context>
0245 
0246 <context name="arg_params" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
0247         <DetectSpaces/>
0248         <keyword String="as" context="as_type" lookAhead="true"/>
0249         <DetectChar char="=" attribute="assign" context="rvalue"/>
0250 </context>
0251 
0252 <context name="as_type" attribute="g" lineEndContext="#stay">
0253         <keyword String="as" attribute="keyword" context="as_type_value"/>
0254 </context>
0255 
0256 <context name="as_type_value" attribute="g" lineEndContext="#stay">
0257         <keyword String="types" attribute="type" context="#pop#pop"/>
0258         <DetectIdentifier attribute="invalid" context="#pop#pop"/>
0259 </context>
0260 
0261 
0262 <!-- Inline lambda call for sub/function -->
0263 <context name="inline_call" attribute="g" lineEndContext="#pop">
0264         <DetectSpaces/>
0265         <DetectChar char="(" attribute="scope" context="#pop!lvalue_call_args"/>
0266 </context>
0267 
0268 
0269 <!-- Regular function definition. -->
0270 <context name="@function" attribute="g" lineEndContext="#stay">
0271         <keyword String="function" attribute="keyword" context="function" beginRegion="function"/>
0272 </context>
0273 
0274 <context name="function" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="function_name">
0275 </context>
0276 
0277 <context name="function_name" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!function_code">
0278         <DetectSpaces/>
0279         <DetectIdentifier attribute="func" context="#pop!func_open_brace"/>
0280         <DetectChar char="(" context="#pop!func_open_brace" lookAhead="true"/>
0281 </context>
0282 
0283 <context name="func_open_brace" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!function_code">
0284         <DetectSpaces/>
0285         <DetectChar char="(" attribute="scope" context="func_args"/>
0286 </context>
0287 
0288 <context name="func_args" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop!function_code">
0289         <DetectSpaces/>
0290         <DetectIdentifier context="arg_as_type" lookAhead="true"/>
0291         <DetectChar char=")" attribute="scope" context="#pop#pop!function_ret"/>
0292         <DetectChar char="," attribute="coma" context="arg_as_type"/>
0293 </context>
0294 
0295 <context name="function_ret" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!function_code">
0296         <DetectChar char=" " context="#stay"/>
0297         <keyword String="as" context="as_type" lookAhead="true"/>
0298 </context>
0299 
0300 <context name="function_code" attribute="g" lineEndContext="#stay">
0301         <DetectSpaces/>
0302         <RegExpr String="end\s+function" insensitive="true" context="#pop!function_solid_end" lookAhead="true"/>
0303         <keyword String="endfunction" context="#pop!function_solid_end" lookAhead="true"/>
0304         <IncludeRules context="@code"/>
0305 </context>
0306 
0307 <context name="function_solid_end" attribute="g" lineEndContext="#stay">
0308         <StringDetect String="end" insensitive="true" attribute="keyword" context="#pop!function_end"/>
0309 </context>
0310 
0311 <context name="function_end" attribute="keyword" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
0312         <DetectSpaces/>
0313         <StringDetect String="function" insensitive="true" attribute="keyword" context="#pop#pop!inline_call" endRegion="function"/>
0314 </context>
0315 
0316 
0317 <!-- sub is a function with void return type. -->
0318 <context name="@sub" attribute="g" lineEndContext="#stay">
0319         <keyword String="sub" attribute="keyword" context="sub" beginRegion="sub"/>
0320 </context>
0321 
0322 <context name="sub" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="sub_name">
0323 </context>
0324 
0325 <context name="sub_name" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!sub_code">
0326         <DetectSpaces/>
0327         <DetectIdentifier attribute="func" context="#pop!sub_open_brace"/>
0328         <DetectChar char="(" context="#pop!sub_open_brace" lookAhead="true"/>
0329 </context>
0330 
0331 <context name="sub_open_brace" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!sub_code">
0332         <DetectSpaces/>
0333         <DetectChar char="(" attribute="scope" context="sub_args"/>
0334 </context>
0335 
0336 <context name="sub_args" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop!sub_code">
0337         <DetectSpaces/>
0338         <DetectIdentifier context="arg_as_type" lookAhead="true"/>
0339         <DetectChar char=")" attribute="scope" context="#pop#pop!sub_ret"/>
0340         <DetectChar char="," attribute="coma" context="arg_as_type"/>
0341 </context>
0342 
0343 <context name="sub_ret" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!sub_code">
0344         <DetectChar char=" " context="#stay"/>
0345         <keyword String="as" context="as_type" lookAhead="true"/>
0346 </context>
0347 
0348 <context name="sub_code" attribute="g" lineEndContext="#stay">
0349         <DetectSpaces/>
0350         <RegExpr String="end\s+sub" insensitive="true" context="#pop!sub_solid_end" lookAhead="true"/>
0351         <keyword String="endsub" context="#pop!sub_solid_end" lookAhead="true"/>
0352         <IncludeRules context="@code"/>
0353 </context>
0354 
0355 <context name="sub_solid_end" attribute="g" lineEndContext="#stay">
0356         <StringDetect String="end" insensitive="true" attribute="keyword" context="#pop!sub_end"/>
0357 </context>
0358 
0359 <context name="sub_end" attribute="keyword" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
0360         <DetectSpaces/>
0361         <StringDetect String="sub" insensitive="true" attribute="keyword" context="#pop#pop!inline_call" endRegion="sub"/>
0362 </context>
0363 
0364 
0365 <!-- @code represents execution body, including function and sub contents.
0366 -->
0367 <context name="@code" attribute="g" lineEndContext="#stay">
0368         <IncludeRules context="@macro"/>
0369         <IncludeRules context="@comment"/>
0370         <IncludeRules context="@code_end"/>
0371 
0372         <keyword String="print" attribute="print" context="print"/>
0373         <keyword String="goto" attribute="keyword" context="goto"/>
0374         <keyword String="return" attribute="control" context="rvalue"/>
0375         <keyword String="stop" attribute="keyword"/>
0376 
0377         <keyword String="dim" attribute="keyword" context="dim"/>
0378 
0379         <keyword String="if" attribute="control" context="rvalue"/>
0380         <keyword String="then" attribute="control"/>
0381         <keyword String="else" attribute="control"/>
0382         <keyword String="elseif" attribute="control"/>
0383         <keyword String="endif" attribute="control"/>
0384 
0385         <keyword String="while" attribute="control" context="rvalue"/>
0386         <keyword String="endwhile" attribute="control"/>
0387         <keyword String="exitwhile" attribute="control"/>
0388 
0389         <keyword String="for" attribute="control" context="for"/>
0390         <keyword String="endfor" attribute="control"/>
0391         <keyword String="next" attribute="control"/>
0392 
0393         <keyword String="exit" attribute="control" context="exit"/>
0394 
0395         <keyword String="try" context="try_test" lookAhead="true"/>
0396         <keyword String="throw" attribute="keyword" context="rvalue"/>
0397 
0398         <DetectChar char=":" context="line_break" lookAhead="true"/>
0399 
0400         <DetectIdentifier context="lvalue" lookAhead="true"/>
0401 </context>
0402 
0403 <context name="try_test" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!lvalue">
0404         <RegExpr String="try\s*('|$)" context="#pop!try_begin" lookAhead="true"/>
0405 </context>
0406 
0407 <context name="try_begin" attribute="g" lineEndContext="#pop">
0408         <DetectIdentifier attribute="keyword" context="#pop!try_body"/>
0409 </context>
0410 
0411 <context name="try_body" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
0412         <DetectSpaces/>
0413         <StringDetect String="end" insensitive="true" attribute="keyword" context="#pop!try_end"/>
0414         <keyword String="endtry" attribute="keyword" context="#pop"/>
0415         <keyword String="catch" context="catch_test" lookAhead="true"/>
0416         <IncludeRules context="@code"/>
0417 </context>
0418 
0419 <context name="try_end" attribute="g" lineEndContext="#pop">
0420         <DetectSpaces/>
0421         <keyword String="try" attribute="keyword" context="#pop"/>
0422 </context>
0423 
0424 <context name="catch_test" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!lvalue">
0425         <RegExpr String="catch\s*[a-zA-Z_]" attribute="control" context="#pop!catch_expr" lookAhead="true"/>
0426 </context>
0427 
0428 <context name="catch_expr" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
0429         <keyword String="catch" attribute="keyword" context="#pop!catch_var"/>
0430 </context>
0431 
0432 <context name="catch_var" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
0433         <DetectSpaces/>
0434         <DetectIdentifier attribute="var" context="#pop"/>
0435 </context>
0436 
0437 <context name="print" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="rvalue">
0438         <AnyChar String=",;" attribute="coma"/>
0439         <IncludeRules context="@line_break"/>
0440 </context>
0441 
0442 <context name="goto" attribute="g" lineEndContext="#pop">
0443         <DetectSpaces/>
0444         <DetectIdentifier attribute="label" context="#pop"/>
0445 </context>
0446 
0447 <context name="dim" attribute="g" lineEndContext="#pop">
0448         <DetectSpaces/>
0449         <DetectIdentifier attribute="var" context="#pop!dim_array"/>
0450         <IncludeRules context="@comment"/>
0451 </context>
0452 
0453 <context name="dim_array" attribute="g" lineEndContext="#pop">
0454         <DetectSpaces/>
0455         <DetectChar char="[" attribute="operator" context="#pop!array"/>
0456         <IncludeRules context="@comment"/>
0457 </context>
0458 
0459 <context name="for" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!for_var">
0460         <DetectSpaces/>
0461         <keyword String="each" attribute="control" context="#pop!for_each"/>
0462         <IncludeRules context="@comment"/>
0463 </context>
0464 
0465 <context name="for_each" attribute="g" lineEndContext="#pop">
0466         <DetectSpaces/>
0467         <DetectIdentifier attribute="var" context="#pop!for_in"/>
0468         <IncludeRules context="@comment"/>
0469 </context>
0470 
0471 <context name="for_in" attribute="g" lineEndContext="#pop">
0472         <DetectSpaces/>
0473         <keyword String="in" attribute="control" context="#pop!rvalue"/>
0474         <IncludeRules context="@comment"/>
0475 </context>
0476 
0477 <context name="for_var" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="lvalue">
0478         <DetectSpaces/>
0479         <keyword String="to" attribute="control" context="#pop!for_to"/>
0480         <IncludeRules context="@comment"/>
0481 </context>
0482 
0483 <context name="for_to" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="rvalue">
0484         <DetectSpaces/>
0485         <keyword String="step" attribute="control" context="#pop!rvalue"/>
0486 </context>
0487 
0488 <context name="exit" attribute="g" lineEndContext="#pop">
0489         <DetectSpaces/>
0490         <keyword String="for" attribute="control" context="#pop"/>
0491         <keyword String="while" attribute="control" context="#pop"/>
0492         <IncludeRules context="@comment"/>
0493 </context>
0494 
0495 
0496 
0497 <!-- Builtin functions are reserved keywords. They cannot be used as a local variable names.
0498      Thus doing something like below is an error and will be highlighted with 'invalid':
0499          eval = 1
0500          foo = eval
0501      It is still valid to use any word, including reserved ones, as an variable parameter:
0502          foo.eval = 1
0503          foo = bar.eval
0504          foo.eval()
0505 -->
0506 <context name="@lvalue_builtin_functions" attribute="g" lineEndContext="#stay">
0507     <keyword String="builtin_functions" context="#pop!lvalue_builtin_function" lookAhead="true"/>
0508 </context>
0509 
0510 <context name="lvalue_builtin_function" attribute="g" lineEndContext="#pop">
0511         <RegExpr String="[a-zA-Z_][a-zA-Z0-1_]*\s*\(" context="#pop!lvalue_builtin_call" lookAhead="true"/>
0512         <DetectIdentifier attribute="invalid" context="#pop"/>
0513 </context>
0514 
0515 <context name="lvalue_builtin_call" attribute="g" lineEndContext="#pop">
0516         <DetectIdentifier attribute="builtin_func" context="#pop!lvalue_call_open_brace"/>
0517 </context>
0518 
0519 
0520 <context name="@rvalue_builtin_functions" attribute="g" lineEndContext="#stay">
0521     <keyword String="builtin_functions" context="#pop!rvalue_builtin_function" lookAhead="true"/>
0522 </context>
0523 
0524 <context name="rvalue_builtin_function" attribute="g" lineEndContext="#pop">
0525         <RegExpr String="[a-zA-Z_][a-zA-Z0-1_]*\s*\(" context="#pop!rvalue_builtin_call" lookAhead="true"/>
0526         <DetectIdentifier attribute="invalid" context="#pop"/>
0527 </context>
0528 
0529 <context name="rvalue_builtin_call" attribute="g" lineEndContext="#pop">
0530         <DetectIdentifier attribute="builtin_func" context="#pop!rvalue_call_open_brace"/>
0531 </context>
0532 
0533 
0534 <!-- Library functions have nothing special comparing to other functions. They just have different
0535      highlighting colors. It is valid to shadow function with a variable with the same name,
0536      although it is not recommended and might be considered as a warning by various linters.
0537 -->
0538 <context name="@lvalue_library_functions" attribute="g" lineEndContext="#stay">
0539         <keyword String="utility_functions" context="#pop!lvalue_library_function" lookAhead="true"/>
0540         <keyword String="string_functions" context="#pop!lvalue_library_function" lookAhead="true"/>
0541         <keyword String="math_functions" context="#pop!lvalue_library_function" lookAhead="true"/>
0542 </context>
0543 
0544 <context name="lvalue_library_function" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!lvalue_var">
0545         <RegExpr String="[a-zA-Z_][a-zA-Z0-1_]*\s*\(" context="#pop!lvalue_library_call" lookAhead="true"/>
0546 </context>
0547 
0548 <context name="lvalue_library_call" attribute="g" lineEndContext="#pop">
0549         <DetectIdentifier attribute="library_func" context="#pop!lvalue_call_open_brace"/>
0550 </context>
0551 
0552 
0553 <context name="@rvalue_library_functions" attribute="g" lineEndContext="#stay">
0554         <keyword String="utility_functions" context="#pop!rvalue_library_function" lookAhead="true"/>
0555         <keyword String="string_functions" context="#pop!rvalue_library_function" lookAhead="true"/>
0556         <keyword String="math_functions" context="#pop!rvalue_library_function" lookAhead="true"/>
0557 </context>
0558 
0559 <context name="rvalue_library_function" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!rvalue_var">
0560         <RegExpr String="[a-zA-Z_][a-zA-Z0-1_]*\s*\(" context="#pop!rvalue_library_call" lookAhead="true"/>
0561 </context>
0562 
0563 <context name="rvalue_library_call" attribute="g" lineEndContext="#pop">
0564         <DetectIdentifier attribute="library_func" context="#pop!rvalue_call_open_brace"/>
0565 </context>
0566 
0567 
0568 <!-- lvalue contexts represent expressions of the left side of the assignment operators or
0569          standalone function calls.
0570 -->
0571 <context name="lvalue" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!lvalue_exp">
0572         <DetectSpaces/>
0573         <keyword String="m" attribute="m" context="#pop!lvalue_m_dot"/>
0574         <IncludeRules context="@lvalue_builtin_functions"/>
0575         <IncludeRules context="@lvalue_library_functions"/>
0576         <IncludeRules context="@comment"/>
0577 </context>
0578 
0579 <context name="lvalue_exp" attribute="g" lineEndContext="#pop">
0580         <DetectSpaces/>
0581         <RegExpr String="[a-zA-Z_][a-zA-Z0-1_]*\s*\(" context="#pop!lvalue_call" lookAhead="true"/>
0582         <RegExpr String="[a-zA-Z_][a-zA-Z0-1_]*:" attribute="label" context="#pop"/>
0583         <DetectIdentifier context="#pop!lvalue_var" lookAhead="true"/>
0584 </context>
0585 
0586 <context name="lvalue_m_dot" attribute="g" lineEndContext="#pop">
0587         <DetectSpaces/>
0588         <DetectChar char="." attribute="operator" context="#pop!lvalue_top"/>
0589         <IncludeRules context="@comment"/>
0590         <IncludeRules context="@lvalue_ops"/>
0591 </context>
0592 
0593 <context name="lvalue_top" attribute="g" lineEndContext="#pop">
0594         <DetectSpaces/>
0595         <keyword String="top" attribute="top" context="#pop!lvalue_operator"/>
0596         <DetectIdentifier context="#pop!lvalue_exp" lookAhead="true"/>
0597         <IncludeRules context="@comment"/>
0598 </context>
0599 
0600 <context name="lvalue_var" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
0601         <DetectIdentifier attribute="var" context="#pop!lvalue_var_postfix"/>
0602 </context>
0603 
0604 <context name="lvalue_var_postfix" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!lvalue_operator">
0605         <AnyChar String="$%&amp;!#" attribute="var" context="#pop!lvalue_operator"/>
0606 </context>
0607 
0608 <context name="lvalue_operator" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
0609         <DetectSpaces/>
0610         <DetectChar char="." attribute="operator" context="#pop!lvalue_exp"/>
0611         <IncludeRules context="@lvalue_ops"/>
0612 </context>
0613 
0614 <context name="@lvalue_ops" attribute="g" lineEndContext="#stay">
0615         <IncludeRules context="@lvalue_call_open_brace"/>
0616         <DetectChar char="[" attribute="operator" context="lvalue_array"/>
0617         <RegExpr String="(=|\+=|\-=|\*=|/=|\\=|&lt;&lt;=|&gt;&gt;=)" attribute="assign" context="#pop!rvalue"/>
0618 </context>
0619 
0620 <context name="lvalue_array" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="rvalue">
0621         <DetectSpaces/>
0622         <DetectChar char="," attribute="coma"/>
0623         <DetectChar char="]" attribute="operator" context="#pop!lvalue_operator"/>
0624 </context>
0625 
0626 <context name="lvalue_call" attribute="g" lineEndContext="#stay">
0627         <DetectIdentifier attribute="func" context="#pop!lvalue_call_open_brace"/>
0628 </context>
0629 
0630 <context name="lvalue_call_open_brace" attribute="g" lineEndContext="#stay">
0631         <IncludeRules context="@lvalue_call_open_brace"/>
0632 </context>
0633 
0634 <context name="@lvalue_call_open_brace" attribute="g" lineEndContext="#stay">
0635         <DetectChar char="(" attribute="scope" context="lvalue_call_args"/>
0636 </context>
0637 
0638 <context name="lvalue_call_args" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="rvalue">
0639         <DetectSpaces/>
0640         <DetectChar char=")" attribute="scope" context="#pop#pop!lvalue_operator"/>
0641         <DetectChar char="," attribute="coma"/>
0642 </context>
0643 
0644 
0645 <!-- rvalue contexts represent expressions on the right side of assignment operators and arguments
0646          to other functions, 'print' calls, object keys, array values, etc.
0647 -->
0648 <context name="rvalue" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
0649         <DetectSpaces/>
0650         <AnyChar String="-+" attribute="unary"/>
0651         <IncludeRules context="@comment"/>
0652         <IncludeRules context="@function"/>
0653         <IncludeRules context="@sub"/>
0654         <keyword String="unary" attribute="unary"/>
0655         <keyword String="end_of_scope" context="#pop#pop" lookAhead="true"/>
0656         <DetectChar char="&quot;" attribute="string" context="#pop!string"/>
0657         <DetectChar char="[" attribute="operator" context="#pop!array"/>
0658         <DetectChar char="(" attribute="scope" context="#pop!rvalue_scope"/>
0659         <DetectChar char="{" attribute="operator" context="#pop!object"/>
0660         <keyword String="constants" attribute="constant" context="#pop!rvalue_operator"/>
0661         <RegExpr String="[-+]?[0-9]*\.[0-9]" context="#pop!float" lookAhead="true"/>
0662         <RegExpr String="[-+]?[0-9]" context="#pop!int" lookAhead="true"/>
0663         <StringDetect String="&amp;h" insensitive="true" attribute="dec" context="#pop!hex"/>
0664         <keyword String="m" attribute="m" context="#pop!rvalue_m_dot"/>
0665         <IncludeRules context="@rvalue_builtin_functions"/>
0666         <IncludeRules context="@rvalue_library_functions"/>
0667         <IncludeRules context="@rvalue_dot"/>
0668 </context>
0669 
0670 <context name="rvalue_var" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
0671         <DetectIdentifier attribute="var" context="#pop!rvalue_var_postfix"/>
0672 </context>
0673 
0674 <context name="rvalue_var_postfix" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!rvalue_operator">
0675         <AnyChar String="$%&amp;!#" attribute="var" context="#pop!rvalue_operator"/>
0676 </context>
0677 
0678 <context name="rvalue_operator" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!rvalue_end">
0679         <DetectSpaces/>
0680         <AnyChar String=".@" attribute="operator" context="#pop!rvalue_dot"/>
0681         <IncludeRules context="@rvalue_ops"/>
0682 </context>
0683 
0684 <context name="@rvalue_ops" attribute="g" lineEndContext="#stay">
0685         <IncludeRules context="@rvalue_call_open_brace"/>
0686         <DetectChar char="[" attribute="operator" context="#pop!array"/>
0687 </context>
0688 
0689 <context name="rvalue_end" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
0690         <DetectSpaces/>
0691         <RegExpr String="=|&lt;&gt;|&lt;&lt;|&gt;&gt;|&lt;=|&gt;=|&lt;|&gt;|\^|\-|\+|\*|\/|\\|(and|or|mod)(?=\W)" insensitive="true" attribute="binary" context="#pop!rvalue"/>
0692 </context>
0693 
0694 <context name="rvalue_m_dot" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!rvalue_end">
0695         <DetectSpaces/>
0696         <DetectChar char="." attribute="operator" context="#pop!rvalue_top"/>
0697         <IncludeRules context="@comment"/>
0698         <IncludeRules context="@rvalue_ops"/>
0699 </context>
0700 
0701 <context name="rvalue_top" attribute="g" lineEndContext="#pop">
0702         <DetectSpaces/>
0703         <keyword String="top" attribute="top" context="#pop!rvalue_operator"/>
0704         <DetectIdentifier context="#pop!rvalue_dot" lookAhead="true"/>
0705         <IncludeRules context="@comment"/>
0706 </context>
0707 
0708 <context name="rvalue_scope" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="rvalue">
0709         <DetectSpaces/>
0710         <DetectChar char=")" attribute="scope" context="#pop!rvalue_operator"/>
0711 </context>
0712 
0713 <context name="rvalue_dot" attribute="g" lineEndContext="#stay">
0714         <IncludeRules context="@rvalue_dot"/>
0715 </context>
0716 
0717 <context name="@rvalue_dot" attribute="g" lineEndContext="#stay">
0718         <RegExpr String="[a-zA-Z_][a-zA-Z0-1_]*\s*\(" context="#pop!rvalue_call" lookAhead="true"/>
0719         <DetectIdentifier context="#pop!rvalue_var" lookAhead="true"/>
0720 </context>
0721 
0722 
0723 <!-- Other rvalue expressions. -->
0724 <context name="string" attribute="string" lineEndContext="#pop#pop">
0725         <DetectChar char="&quot;" attribute="string" context="#pop!rvalue_operator"/>
0726 </context>
0727 
0728 <context name="array" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="rvalue">
0729         <DetectSpaces/>
0730         <DetectChar char="," attribute="coma"/>
0731         <DetectChar char="]" attribute="operator" context="#pop!rvalue_operator"/>
0732 </context>
0733 
0734 <context name="object" attribute="g" lineEndContext="#stay">
0735         <DetectSpaces/>
0736         <IncludeRules context="@comment"/>
0737         <DetectChar char="," attribute="coma"/>
0738         <DetectChar char="}" attribute="operator" context="#pop!rvalue_operator"/>
0739         <DetectChar char="&quot;" attribute="var" context="object_param_string"/>
0740         <DetectIdentifier attribute="var" context="object_param_colon"/>
0741 </context>
0742 
0743 <context name="object_param_string" attribute="var" lineEndContext="#pop">
0744         <DetectChar char="&quot;" attribute="var" context="#pop!object_param_colon"/>
0745 </context>
0746 
0747 <context name="object_param_colon" attribute="g" lineEndContext="#pop">
0748         <DetectSpaces/>
0749         <IncludeRules context="@comment"/>
0750         <DetectChar char=":" attribute="operator" context="#pop!rvalue"/>
0751 </context>
0752 
0753 <context name="float" attribute="float" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
0754         <!-- documentation says this is a valid string, but implementation gives compile error -->
0755         <!--<RegExpr String="[-+]?[0-9]*\.[0-9]+([eE][-+]?[0-9]+)?\$" attribute="string" context="postfix_delimiter"/>-->
0756         <!--<RegExpr String="[-+]?[0-9]*\.[0-9]+([eE][-+]?[0-9]+)?[%&amp;]" attribute="dec" context="postfix_delimiter"/>-->
0757         <RegExpr String="[-+]?[0-9]*\.[0-9]+([eE][-+]?[0-9]+)?[!#]?" attribute="float" context="postfix_delimiter"/>
0758 </context>
0759 
0760 <context name="int" attribute="dec" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
0761         <!-- documentation says this is a valid string, but implementation gives compile error -->
0762         <!--<RegExpr String="[-+]?[0-9]*\$" attribute="string" context="postfix_delimiter"/>-->
0763         <RegExpr String="[-+]?[0-9]*[!#]" attribute="float" context="postfix_delimiter"/>
0764         <RegExpr String="[-+]?[0-9]*[%&amp;]?" attribute="dec" context="postfix_delimiter"/>
0765 </context>
0766 
0767 <context name="hex" attribute="invalid" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
0768         <RegExpr String="[0-9a-fA-F]+" insensitive="true" attribute="dec" context="#pop"/>
0769 </context>
0770 
0771 <context name="postfix_delimiter" attribute="g" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
0772         <RegExpr String="[\s\W]" context="#pop#pop!rvalue_operator" lookAhead="true"/>
0773 </context>
0774 
0775 <context name="rvalue_call" attribute="g" lineEndContext="#stay">
0776         <DetectIdentifier attribute="func" context="#pop!rvalue_call_open_brace"/>
0777 </context>
0778 
0779 <context name="rvalue_call_open_brace" attribute="g" lineEndContext="#stay">
0780         <IncludeRules context="@rvalue_call_open_brace"/>
0781 </context>
0782 
0783 <context name="@rvalue_call_open_brace" attribute="g" lineEndContext="#stay">
0784         <DetectChar char="(" attribute="scope" context="rvalue_call_args"/>
0785 </context>
0786 
0787 <context name="rvalue_call_args" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="rvalue">
0788         <DetectSpaces/>
0789         <DetectChar char=")" attribute="scope" context="#pop#pop!rvalue_operator"/>
0790         <DetectChar char="," attribute="coma"/>
0791 </context>
0792 
0793 </contexts>
0794 
0795 
0796 
0797 
0798 <itemDatas>
0799         <itemData name="g"            defStyleNum="dsNormal"/>
0800         <itemData name="import"       defStyleNum="dsImport"/>
0801         <itemData name="func"         defStyleNum="dsFunction"/>
0802         <itemData name="keyword"      defStyleNum="dsKeyword"/>
0803         <itemData name="control"      defStyleNum="dsControlFlow"/>
0804         <itemData name="assign"       defStyleNum="dsOperator"/>
0805         <itemData name="binary"       defStyleNum="dsOperator"/>
0806         <itemData name="unary"        defStyleNum="dsOperator"/>
0807         <itemData name="operator"     defStyleNum="dsOperator"/>
0808         <itemData name="scope"        defStyleNum="dsOperator"/>
0809         <itemData name="coma"         defStyleNum="dsOperator"/>
0810         <itemData name="type"         defStyleNum="dsDataType"/>
0811         <itemData name="var"          defStyleNum="dsVariable"/>
0812         <itemData name="comment"      defStyleNum="dsComment"/>
0813         <itemData name="print"        defStyleNum="dsBuiltIn"/>
0814         <itemData name="builtin_func" defStyleNum="dsBuiltIn"/>
0815         <itemData name="library_func" defStyleNum="dsBuiltIn"/>
0816         <itemData name="dec"          defStyleNum="dsDecVal"/>
0817         <itemData name="float"        defStyleNum="dsFloat"/>
0818         <itemData name="string"       defStyleNum="dsString"/>
0819         <itemData name="constant"     defStyleNum="dsConstant"/>
0820         <itemData name="macro"        defStyleNum="dsPreprocessor"/>
0821         <itemData name="label"        defStyleNum="dsSpecialChar"/>
0822         <itemData name="line_break"   defStyleNum="dsSpecialChar"/>
0823         <itemData name="m"            defStyleNum="dsExtension"/>
0824         <itemData name="top"          defStyleNum="dsExtension"/>
0825         <itemData name="invalid"      defStyleNum="dsError"/>
0826 </itemDatas>
0827 
0828 </highlighting>
0829 
0830 
0831 
0832 
0833 <general>
0834         <comments>
0835                 <comment name="singleLine" start="'"/>
0836         </comments>
0837 
0838         <keywords casesensitive="0" additionalDeliminator="'"/>
0839 </general>
0840 
0841 </language>
0842 <!-- kate: replace-tabs off; -->