Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/brightscript.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 | <language | 3 | <language | ||
4 | name="BrightScript" | 4 | name="BrightScript" | ||
5 | section="Scripts" | 5 | section="Scripts" | ||
6 | extensions="*.brs" | 6 | extensions="*.brs" | ||
7 | version="4" | 7 | version="5" | ||
8 | kateversion="5.0" | 8 | kateversion="5.0" | ||
9 | author="Daniel Levin (dendy.ua@gmail.com)" | 9 | author="Daniel Levin (dendy.ua@gmail.com)" | ||
10 | license="MIT"> | 10 | license="MIT"> | ||
11 | 11 | | |||
12 | <highlighting> | 12 | <highlighting> | ||
13 | 13 | | |||
14 | 14 | | |||
15 | 15 | | |||
▲ Show 20 Lines • Show All 578 Lines • ▼ Show 20 Line(s) | |||||
594 | </context> | 594 | </context> | ||
595 | 595 | | |||
596 | 596 | | |||
597 | <!-- rvalue contexts represent expressions on the right side of assignment operators and arguments | 597 | <!-- rvalue contexts represent expressions on the right side of assignment operators and arguments | ||
598 | to other functions, 'print' calls, object keys, array values, etc. | 598 | to other functions, 'print' calls, object keys, array values, etc. | ||
599 | --> | 599 | --> | ||
600 | <context name="rvalue" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | 600 | <context name="rvalue" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | ||
601 | <DetectSpaces/> | 601 | <DetectSpaces/> | ||
602 | <DetectChar char="-" attribute="unary"/> | ||||
603 | <DetectChar char="+" attribute="unary"/> | ||||
602 | <IncludeRules context="@comment"/> | 604 | <IncludeRules context="@comment"/> | ||
603 | <IncludeRules context="@function"/> | 605 | <IncludeRules context="@function"/> | ||
604 | <IncludeRules context="@sub"/> | 606 | <IncludeRules context="@sub"/> | ||
605 | <keyword String="unary" attribute="unary"/> | 607 | <keyword String="unary" attribute="unary"/> | ||
606 | <keyword String="end_of_scope" context="#pop#pop" lookAhead="true"/> | 608 | <keyword String="end_of_scope" context="#pop#pop" lookAhead="true"/> | ||
607 | <DetectChar char=""" attribute="string" context="#pop!string"/> | 609 | <DetectChar char=""" attribute="string" context="#pop!string"/> | ||
608 | <DetectChar char="[" attribute="operator" context="#pop!array"/> | 610 | <DetectChar char="[" attribute="operator" context="#pop!array"/> | ||
609 | <DetectChar char="(" attribute="scope" context="#pop!rvalue_scope"/> | 611 | <DetectChar char="(" attribute="scope" context="#pop!rvalue_scope"/> | ||
610 | <DetectChar char="{" attribute="operator" context="#pop!object"/> | 612 | <DetectChar char="{" attribute="operator" context="#pop!object"/> | ||
611 | <keyword String="constants" attribute="constant" context="#pop!rvalue_operator"/> | 613 | <keyword String="constants" attribute="constant" context="#pop!rvalue_operator"/> | ||
612 | <RegExpr String="[-+]?[0-9]*\.[0-9]" context="#pop!float" lookAhead="true"/> | 614 | <RegExpr String="[-+]?[0-9]*\.[0-9]" context="#pop!float" lookAhead="true"/> | ||
613 | <RegExpr String="[-+]?[0-9]" context="#pop!int" lookAhead="true"/> | 615 | <RegExpr String="[-+]?[0-9]" context="#pop!int" lookAhead="true"/> | ||
616 | <StringDetect String="&h" insensitive="true" attribute="dec" context="#pop!hex"/> | ||||
614 | <keyword String="m" attribute="m" context="#pop!rvalue_m_dot"/> | 617 | <keyword String="m" attribute="m" context="#pop!rvalue_m_dot"/> | ||
615 | <IncludeRules context="@rvalue_builtin_functions"/> | 618 | <IncludeRules context="@rvalue_builtin_functions"/> | ||
616 | <IncludeRules context="@rvalue_library_functions"/> | 619 | <IncludeRules context="@rvalue_library_functions"/> | ||
617 | <IncludeRules context="@rvalue_dot"/> | 620 | <IncludeRules context="@rvalue_dot"/> | ||
618 | </context> | 621 | </context> | ||
619 | 622 | | |||
620 | <context name="rvalue_var" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | 623 | <context name="rvalue_var" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | ||
621 | <DetectIdentifier attribute="var" context="#pop!rvalue_var_postfix"/> | 624 | <DetectIdentifier attribute="var" context="#pop!rvalue_var_postfix"/> | ||
622 | </context> | 625 | </context> | ||
623 | 626 | | |||
624 | <context name="rvalue_var_postfix" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!rvalue_operator"> | 627 | <context name="rvalue_var_postfix" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!rvalue_operator"> | ||
625 | <AnyChar String="$%&!#" attribute="var" context="#pop!rvalue_operator"/> | 628 | <AnyChar String="$%&!#" attribute="var" context="#pop!rvalue_operator"/> | ||
626 | </context> | 629 | </context> | ||
627 | 630 | | |||
628 | <context name="rvalue_operator" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!rvalue_end"> | 631 | <context name="rvalue_operator" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!rvalue_end"> | ||
629 | <DetectSpaces/> | 632 | <DetectSpaces/> | ||
630 | <DetectChar char="." attribute="operator" context="#pop!rvalue_dot"/> | 633 | <DetectChar char="." attribute="operator" context="#pop!rvalue_dot"/> | ||
634 | <DetectChar char="@" attribute="operator" context="#pop!rvalue_dot"/> | ||||
631 | <IncludeRules context="@rvalue_ops"/> | 635 | <IncludeRules context="@rvalue_ops"/> | ||
632 | </context> | 636 | </context> | ||
633 | 637 | | |||
634 | <context name="@rvalue_ops" attribute="g" lineEndContext="#stay"> | 638 | <context name="@rvalue_ops" attribute="g" lineEndContext="#stay"> | ||
635 | <IncludeRules context="@rvalue_call_open_brace"/> | 639 | <IncludeRules context="@rvalue_call_open_brace"/> | ||
636 | <DetectChar char="[" attribute="operator" context="#pop!array"/> | 640 | <DetectChar char="[" attribute="operator" context="#pop!array"/> | ||
637 | </context> | 641 | </context> | ||
638 | 642 | | |||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | |||||
715 | 719 | | |||
716 | <context name="int" attribute="dec" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | 720 | <context name="int" attribute="dec" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | ||
717 | <!-- documentation says this is a valid string, but implementation gives compile error --> | 721 | <!-- documentation says this is a valid string, but implementation gives compile error --> | ||
718 | <!--<RegExpr String="[-+]?[0-9]*\$" attribute="string" context="postfix_delimiter"/>--> | 722 | <!--<RegExpr String="[-+]?[0-9]*\$" attribute="string" context="postfix_delimiter"/>--> | ||
719 | <RegExpr String="[-+]?[0-9]*[!#]" attribute="float" context="postfix_delimiter"/> | 723 | <RegExpr String="[-+]?[0-9]*[!#]" attribute="float" context="postfix_delimiter"/> | ||
720 | <RegExpr String="[-+]?[0-9]*[%&]?" attribute="dec" context="postfix_delimiter"/> | 724 | <RegExpr String="[-+]?[0-9]*[%&]?" attribute="dec" context="postfix_delimiter"/> | ||
721 | </context> | 725 | </context> | ||
722 | 726 | | |||
727 | <context name="hex" attribute="invalid" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | ||||
728 | <RegExpr String="[0-9a-fA-F]+" insensitive="true" attribute="dec" context="#pop"/> | ||||
729 | </context> | ||||
730 | | ||||
723 | <context name="postfix_delimiter" attribute="g" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop"> | 731 | <context name="postfix_delimiter" attribute="g" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop"> | ||
724 | <RegExpr String="[\s\W]" context="#pop#pop!rvalue_operator" lookAhead="true"/> | 732 | <RegExpr String="[\s\W]" context="#pop#pop!rvalue_operator" lookAhead="true"/> | ||
725 | </context> | 733 | </context> | ||
726 | 734 | | |||
727 | <context name="rvalue_call" attribute="g" lineEndContext="#stay"> | 735 | <context name="rvalue_call" attribute="g" lineEndContext="#stay"> | ||
728 | <DetectIdentifier attribute="func" context="#pop!rvalue_call_open_brace"/> | 736 | <DetectIdentifier attribute="func" context="#pop!rvalue_call_open_brace"/> | ||
729 | </context> | 737 | </context> | ||
730 | 738 | | |||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |