Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/typescript.xml
Show All 30 Lines | 27 | Ex: | |||
---|---|---|---|---|---|
31 | Attributes: path, types, no-default-lib, name | 31 | Attributes: path, types, no-default-lib, name | ||
32 | 32 | | |||
33 | TODO: The keywords of built-in classes & functions can be included | 33 | TODO: The keywords of built-in classes & functions can be included | ||
34 | in "javascript.xml". The only drawback is that some XML files use | 34 | in "javascript.xml". The only drawback is that some XML files use | ||
35 | JavaScript highlighting, through "IncludeRules", and should not | 35 | JavaScript highlighting, through "IncludeRules", and should not | ||
36 | incorporate these keywords (for example: "qml.xml"). | 36 | incorporate these keywords (for example: "qml.xml"). | ||
37 | 37 | | |||
38 | Change log: | 38 | Change log: | ||
39 | * v2 [2018-12-29]: Don't highlight built-in classes as functions, | ||||
40 | fix float-points, improve types detection and other fixes. | ||||
39 | * v1 [2018-11-18]: Initial version | 41 | * v1 [2018-11-18]: Initial version | ||
40 | --> | 42 | --> | ||
41 | 43 | | |||
42 | <language name="TypeScript" | 44 | <language name="TypeScript" | ||
43 | version="1" | 45 | version="2" | ||
44 | kateversion="5.53" | 46 | kateversion="5.53" | ||
45 | section="Scripts" | 47 | section="Scripts" | ||
46 | extensions="*.ts" | 48 | extensions="*.ts" | ||
47 | priority="9" | 49 | priority="9" | ||
48 | mimetype="text/typescript;application/typescript;text/x-typescript;application/x-typescript" | 50 | mimetype="text/typescript;application/typescript;text/x-typescript;application/x-typescript" | ||
49 | indenter="cstyle" | 51 | indenter="cstyle" | ||
50 | author="Nibaldo González (nibgonz@gmail.com)" | 52 | author="Nibaldo González (nibgonz@gmail.com)" | ||
51 | license="MIT"> | 53 | license="MIT"> | ||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 101 | <list name="types_primitives"> | |||
100 | <item>string</item> | 102 | <item>string</item> | ||
101 | <item>number</item> | 103 | <item>number</item> | ||
102 | <item>boolean</item> | 104 | <item>boolean</item> | ||
103 | <item>symbol</item> | 105 | <item>symbol</item> | ||
104 | <item>any</item> | 106 | <item>any</item> | ||
105 | <item>void</item> | 107 | <item>void</item> | ||
106 | <item>never</item> | 108 | <item>never</item> | ||
107 | <item>unknown</item> | 109 | <item>unknown</item> | ||
110 | <item>undefined</item> | ||||
111 | <item>null</item> | ||||
108 | </list> | 112 | </list> | ||
109 | 113 | | |||
110 | <!-- Built-in Classes & Functions --> | 114 | <!-- Built-in Classes & Functions --> | ||
111 | 115 | | |||
112 | <list name="class_builtin"> | 116 | <list name="class_builtin"> | ||
113 | <item>Array</item> | 117 | <item>Array</item> | ||
114 | <item>ArrayBuffer</item> | 118 | <item>ArrayBuffer</item> | ||
115 | <item>Atomics</item> | 119 | <item>Atomics</item> | ||
▲ Show 20 Lines • Show All 1522 Lines • ▼ Show 20 Line(s) | 1641 | <contexts> | |||
1638 | 1642 | | |||
1639 | <context name="Shebang" attribute="Normal Text" lineEndContext="Normal" lineEmptyContext="Normal" fallthrough="true" fallthroughContext="Normal"> | 1643 | <context name="Shebang" attribute="Normal Text" lineEndContext="Normal" lineEmptyContext="Normal" fallthrough="true" fallthroughContext="Normal"> | ||
1640 | <Detect2Chars context="ShebangLine" attribute="Comment" char="#" char1="!" column="0" /> | 1644 | <Detect2Chars context="ShebangLine" attribute="Comment" char="#" char1="!" column="0" /> | ||
1641 | </context> | 1645 | </context> | ||
1642 | <context name="ShebangLine" attribute="Comment" lineEndContext="#pop!Normal" /> | 1646 | <context name="ShebangLine" attribute="Comment" lineEndContext="#pop!Normal" /> | ||
1643 | 1647 | | |||
1644 | <context name="Normal" attribute="Normal Text" lineEndContext="#stay"> | 1648 | <context name="Normal" attribute="Normal Text" lineEndContext="#stay"> | ||
1645 | <StringDetect context="#stay" attribute="Symbol" String="..." /> | 1649 | <StringDetect context="#stay" attribute="Symbol" String="..." /> | ||
1646 | <IncludeRules context="Numbers" /> | 1650 | <IncludeRules context="FindNumbers" /> | ||
1647 | <IncludeRules context="FindStrings" /> | 1651 | <IncludeRules context="FindStrings" /> | ||
1648 | 1652 | | |||
1649 | <!-- Abstract --> | 1653 | <!-- Abstract --> | ||
1650 | <RegExpr context="#stay" attribute="Reserved" String="\b(abstract)(?=\s+(class|interface)\b)" /> | 1654 | <RegExpr context="#stay" attribute="Reserved" String="\b(abstract)(?=\s+(class|interface)\b)" /> | ||
1651 | <!-- New --> | 1655 | <!-- New --> | ||
1652 | <RegExpr context="NewTarget" attribute="Keyword" String="\bnew(?=\s*[\?!]?\.\s*target\b)" /> | 1656 | <RegExpr context="NewTarget" attribute="Keyword" String="\bnew(?=\s*[\?!]?\.\s*target\b)" /> | ||
1653 | <RegExpr context="MemberObject" attribute="Objects" String="\bnew(?=[\?!]?\.)" /> | 1657 | <RegExpr context="MemberObject" attribute="Objects" String="\bnew(?=[\?!]?\.)" /> | ||
1654 | <WordDetect context="#stay" attribute="Keyword" String="new" /> | 1658 | <WordDetect context="#stay" attribute="Keyword" String="new" /> | ||
1655 | <!-- Import --> | 1659 | <!-- Import --> | ||
1656 | <WordDetect context="Import" attribute="Module" String="import" /> | 1660 | <WordDetect context="Import" attribute="Module" String="import" /> | ||
1657 | <!-- Export types --> | 1661 | <!-- Export types --> | ||
1658 | <keyword context="ControlExport" attribute="Module" String="control_export_types" /> | 1662 | <keyword context="ControlExport" attribute="Module" String="control_export_types" /> | ||
1659 | 1663 | | |||
1660 | <!-- Keywords --> | 1664 | <!-- Keywords --> | ||
1661 | <keyword context="NoRegExp" attribute="ControlFlow" String="controlflow" /> | 1665 | <keyword context="#stay" attribute="ControlFlow" String="controlflow" /> | ||
1662 | <RegExpr context="#stay" attribute="ControlFlow" String="\bdefault(?=\s*[\?!]?:)" /> | 1666 | <RegExpr context="#stay" attribute="ControlFlow" String="\bdefault(?=\s*[\?!]?:)" /> | ||
1663 | <RegExpr context="#stay" String="&identifier;(?=\s*[\?!]?:)" /> | 1667 | <RegExpr context="#stay" String="&identifier;(?=\s*[\?!]?:)" /> | ||
1664 | 1668 | | |||
1665 | <WordDetect context="Annotation" attribute="Reserved" String="type" /> | 1669 | <WordDetect context="TypeDeclaration" attribute="Reserved" String="type" /> | ||
1666 | <keyword context="#stay" attribute="Module" String="module" /> | 1670 | <keyword context="#stay" attribute="Module" String="module" /> | ||
1667 | <keyword context="NoRegExp" attribute="Keyword" String="keywords" /> | 1671 | <keyword context="#stay" attribute="Keyword" String="keywords" /> <!-- NoRegExp? --> | ||
1668 | <keyword context="#stay" attribute="Reserved" String="reserved" /> | 1672 | <keyword context="#stay" attribute="Reserved" String="reserved" /> | ||
1669 | <keyword context="NoRegExp" attribute="Keyword" String="primitives" /> | 1673 | <keyword context="NoRegExp" attribute="Keyword" String="primitives" /> | ||
1670 | <keyword context="#stay" attribute="Keyword" String="object_iden" /> | 1674 | <keyword context="#stay" attribute="Keyword" String="object_iden" /> | ||
1671 | 1675 | | |||
1676 | <!-- Built-in Classes --> | ||||
1677 | <WordDetect context="FindMemberObjectMath" attribute="Built-in Objects" String="Math" /> | ||||
1678 | <WordDetect context="FindMemberObjectPromise" attribute="Built-in Objects" String="Promise" /> | ||||
1679 | <WordDetect context="FindMemberObjectJSON" attribute="Built-in Objects" String="JSON" /> | ||||
1680 | <WordDetect context="FindMemberObjectConsole" attribute="Built-in Objects" String="console" /> | ||||
1681 | <WordDetect context="FindMemberObjectProcess" attribute="Built-in Objects" String="process" /> | ||||
1682 | <keyword context="#stay" attribute="Built-in Objects" String="class_builtin" /> | ||||
1683 | <keyword context="FindMemberObjectDOM" attribute="Built-in Objects" String="class_dom" /> | ||||
1684 | <keyword context="FindMemberObjectNode" attribute="Built-in Objects" String="class_node" /> | ||||
1685 | <keyword context="FindMemberObjectDOM" attribute="Built-in Objects" String="dom_variable" /> | ||||
1686 | | ||||
1672 | <IncludeRules context="FindFunctionName" /> | 1687 | <IncludeRules context="FindFunctionName" /> | ||
1673 | <IncludeRules context="FindObjects" /> | 1688 | <RegExpr context="MemberObject" attribute="Objects" String="&identifier;(?=\s*[\?!]?\.)" /> | ||
1689 | <DetectChar context="MemberObject" char="." /> | ||||
1690 | | ||||
1674 | <keyword context="#stay" attribute="Function Name" String="functions" /> | 1691 | <keyword context="#stay" attribute="Function Name" String="functions" /> | ||
1675 | 1692 | | |||
1676 | <DetectChar context="Annotation" attribute="Symbol" char=":" /> | | |||
1677 | <DetectChar context="Object" attribute="Symbol" char="{" beginRegion="Brace" /> | 1693 | <DetectChar context="Object" attribute="Symbol" char="{" beginRegion="Brace" /> | ||
1678 | <DetectChar context="#stay" attribute="Symbol" char="[" beginRegion="List" /> | 1694 | <DetectChar context="#stay" attribute="Symbol" char="[" beginRegion="List" /> | ||
1679 | <DetectChar context="#stay" attribute="Symbol" char="]" endRegion="List" /> | 1695 | <DetectChar context="#stay" attribute="Symbol" char="]" endRegion="List" /> | ||
1680 | <DetectChar context="#stay" attribute="Symbol" char="?" /> <!-- Fix of conditional expression from the JavaScript highlighting --> | 1696 | <DetectChar context="#stay" attribute="Symbol" char="?" /> <!-- Fix of conditional expression from the JavaScript highlighting --> | ||
1681 | 1697 | | |||
1698 | <!-- Highlight types after ":" and between "<" and ">" --> | ||||
1699 | <DetectChar context="Types" attribute="Symbol" char=":" /> | ||||
1700 | <RegExpr context="TypesAngleBracket" attribute="Symbol" String="<(?=(&identifier;|[\[\{\(<]).*>)" /> | ||||
1701 | | ||||
1682 | <IncludeRules context="Normal##JavaScript" /> | 1702 | <IncludeRules context="Normal##JavaScript" /> | ||
1683 | </context> | 1703 | </context> | ||
1684 | 1704 | | |||
1685 | <context name="Object" attribute="Normal Text" lineEndContext="#stay"> | 1705 | <context name="Object" attribute="Normal Text" lineEndContext="#stay"> | ||
1686 | <DetectChar context="#pop" attribute="Symbol" char="}" endRegion="Brace" /> | 1706 | <DetectChar context="#pop" attribute="Symbol" char="}" endRegion="Brace" /> | ||
1687 | <keyword context="NoRegExp" attribute="Keyword" String="keywords" /> | 1707 | <keyword context="NoRegExp" attribute="Keyword" String="keywords" /> | ||
1688 | <IncludeRules context="Normal" /> | 1708 | <IncludeRules context="Normal" /> | ||
1689 | </context> | 1709 | </context> | ||
1690 | 1710 | | |||
1691 | <context name="Numbers" attribute="Normal Text" lineEndContext="#stay"> | 1711 | <context name="NoRegExp" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | ||
1712 | <IncludeRules context="NoRegExp##JavaScript" /> | ||||
1713 | </context> | ||||
1714 | | ||||
1715 | <context name="FindNumbers" attribute="Normal Text" lineEndContext="#stay"> | ||||
1692 | <RegExpr context="NoRegExp" attribute="Hexadecimal" String="\b(0x[\da-f][\da-f_]*)\b" insensitive="true" /> | 1716 | <RegExpr context="NoRegExp" attribute="Hexadecimal" String="\b(0x[\da-f][\da-f_]*)\b" insensitive="true" /> | ||
1693 | <RegExpr context="NoRegExp" attribute="Binary" String="\b(0b[01][01_]*)\b" insensitive="true" /> | 1717 | <RegExpr context="NoRegExp" attribute="Binary" String="\b(0b[01][01_]*)\b" insensitive="true" /> | ||
1718 | <RegExpr context="NoRegExp" attribute="Float" String="(\b\d[\d_]*\.?|(\b\d[\d_]*)?\.\d[\d_]*)[eE][\+\-]?\d[\d_]*\b" /> | ||||
1719 | <RegExpr context="NoRegExp" attribute="Float" String="(\.\d[\d_]*\b|\b\d[\d_]*\.(\d[\d_]*\b)?)" /> | ||||
1694 | <RegExpr context="NoRegExp" attribute="Octal" String="\b(0o?[0-7][0-7_]*)\b" insensitive="true" /> | 1720 | <RegExpr context="NoRegExp" attribute="Octal" String="\b(0o?[0-7][0-7_]*)\b" insensitive="true" /> | ||
1695 | <RegExpr context="NoRegExp" attribute="Float" String="\b(\.\d[\d_]*|\d[\d_]*\.(\d[\d_]*)?|(\d[\d_]*\.?|(\d[\d_]*)?\.\d[\d_]*)[eE][\+\-]?\d[\d_]*)\b" /> | | |||
1696 | <RegExpr context="NoRegExp" attribute="Decimal" String="\b(\d[\d_]*)\b" /> | 1721 | <RegExpr context="NoRegExp" attribute="Decimal" String="\b(\d[\d_]*)\b" /> | ||
1697 | </context> | 1722 | </context> | ||
1698 | 1723 | | |||
1699 | <context name="NoRegExp" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | | |||
1700 | <IncludeRules context="NoRegExp##JavaScript" /> | | |||
1701 | </context> | | |||
1702 | | ||||
1703 | <context name="FindFunctionName" attribute="Normal Text" lineEndContext="#stay"> | 1724 | <context name="FindFunctionName" attribute="Normal Text" lineEndContext="#stay"> | ||
1704 | <RegExpr context="#stay" attribute="Function Name" String="&identifier;(?=\s*(<((\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|('(\\.|[^'])*')|("(\\.|[^"])*")|(`(\\.|[^`])*`)|[^<>]|<.*>)*>)?\()" /> | 1725 | <RegExpr context="#stay" attribute="Function Name" String="&identifier;(?=\s*(<((\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|('(\\.|[^'])*')|("(\\.|[^"])*")|(`(\\.|[^`])*`)|[^<>]|<.*>)*>)?\()" /> | ||
1705 | </context> | 1726 | </context> | ||
1706 | 1727 | | |||
1707 | <context name="FindStrings" attribute="Normal Text" lineEndContext="#stay"> | 1728 | <context name="FindStrings" attribute="Normal Text" lineEndContext="#stay"> | ||
1708 | <DetectChar context="Template" attribute="Template" char="`" /> | 1729 | <DetectChar context="Template" attribute="Template" char="`" /> | ||
1709 | <IncludeRules context="FindStrings##JavaScript" /> | 1730 | <IncludeRules context="FindStrings##JavaScript" /> | ||
1710 | </context> | 1731 | </context> | ||
1711 | | ||||
1712 | <context name="Template" attribute="Template" lineEndContext="#stay"> | 1732 | <context name="Template" attribute="Template" lineEndContext="#stay"> | ||
1713 | <IncludeRules context="Escape##JavaScript" /> | 1733 | <IncludeRules context="Escape##JavaScript" /> | ||
1714 | <Detect2Chars context="Substitution" attribute="Substitution" char="$" char1="{" /> | 1734 | <Detect2Chars context="Substitution" attribute="Substitution" char="$" char1="{" /> | ||
1715 | <DetectChar context="#pop" attribute="Template" char="`" /> | 1735 | <DetectChar context="#pop" attribute="Template" char="`" /> | ||
1716 | </context> | 1736 | </context> | ||
1717 | <context name="Substitution" attribute="Normal Text" lineEndContext="#stay"> | 1737 | <context name="Substitution" attribute="Normal Text" lineEndContext="#stay"> | ||
1718 | <DetectChar context="#pop" attribute="Substitution" char="}" /> | 1738 | <DetectChar context="#pop" attribute="Substitution" char="}" /> | ||
1719 | <IncludeRules context="Normal" /> | 1739 | <IncludeRules context="Normal" /> | ||
1720 | </context> | 1740 | </context> | ||
1721 | 1741 | | |||
1722 | <!-- Highlight types after ":" --> | 1742 | <!-- Highlight types after the "type" keyword --> | ||
1723 | <context name="Annotation" attribute="Normal Text" lineEndContext="#pop"> | 1743 | <context name="TypeDeclaration" attribute="Normal Text" lineEndContext="#stay"> | ||
1724 | <DetectSpaces /> | 1744 | <DetectSpaces /> | ||
1745 | <IncludeRules context="TypeDeclarationEnd" /> | ||||
1746 | <IncludeRules context="TypesFindBrackets" /> | ||||
1747 | <IncludeRules context="DefaultTypes" /> | ||||
1748 | <IncludeRules context="Normal" /> | ||||
1749 | </context> | ||||
1750 | <context name="TypeDeclarationEnd" attribute="Normal Text" lineEndContext="#stay"> | ||||
1725 | <AnyChar context="#pop" String=";,{})]" lookAhead="true" /> | 1751 | <AnyChar context="#pop" String=";,{})]" lookAhead="true" /> | ||
1752 | </context> | ||||
1753 | | ||||
1754 | <!-- Highlight types after ":" --> | ||||
1755 | <context name="Types" attribute="Normal Text" lineEndContext="#pop"> | ||||
1756 | <IncludeRules context="FixPopLineEndContext" /> | ||||
1757 | <IncludeRules context="TypesCommon" /> | ||||
1758 | </context> | ||||
1759 | <context name="TypesCommon" attribute="Normal Text" lineEndContext="#pop"> | ||||
1760 | <DetectSpaces /> | ||||
1761 | <!-- NOTE: The "TypesEnd" context is used by "typescript-react.xml" --> | ||||
1762 | <IncludeRules context="TypesEnd" /> | ||||
1763 | <!-- IMPORTANT: If you modify this rule, do so in "typescript-react.xml"! --> | ||||
1764 | <RegExpr context="#pop!TypesNewLine" attribute="Symbol" String="\|(?=\s*($|//|(/\*.*\*/\s*)+$))" /> | ||||
1765 | | ||||
1766 | <IncludeRules context="TypesFindBrackets" /> | ||||
1767 | <IncludeRules context="DefaultTypes" /> | ||||
1768 | <IncludeRules context="Normal" /> | ||||
1769 | </context> | ||||
1770 | <context name="TypesEnd" attribute="Normal Text" lineEndContext="#stay"> | ||||
1771 | <AnyChar context="#pop" String=";,})]" lookAhead="true" /> | ||||
1772 | <RegExpr context="#pop" String="\=(?!>)" lookAhead="true" /> | ||||
1726 | <Detect2Chars context="#pop" char="/" char1="/" lookAhead="true" /> | 1773 | <Detect2Chars context="#pop" char="/" char1="/" lookAhead="true" /> | ||
1727 | <IncludeRules context="DefaultAnnotation" /> | | |||
1728 | </context> | 1774 | </context> | ||
1729 | <context name="DefaultAnnotation" attribute="Normal Text" lineEndContext="#stay"> | 1775 | <context name="TypesNewLine" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!TypesCommon"> | ||
1776 | <DetectSpaces /> | ||||
1777 | <IncludeRules context="FindComments##JavaScript" /> | ||||
1778 | </context> | ||||
1779 | | ||||
1780 | <!-- NOTE: The "NoRegExp" context invalidates lineEndContext="#pop", | ||||
1781 | therefore the following rule is necessary --> | ||||
1782 | <context name="FixPopLineEndContext" attribute="Normal Text" lineEndContext="#stay"> | ||||
1783 | <RegExpr context="#pop" String="\S" firstNonSpace="true" lookAhead="true" /> | ||||
1784 | </context> | ||||
1785 | | ||||
1786 | <context name="DefaultTypes" attribute="Normal Text" lineEndContext="#stay"> | ||||
1730 | <keyword context="NoRegExp" attribute="Types/Primitives" String="types_primitives" /> | 1787 | <keyword context="NoRegExp" attribute="Types/Primitives" String="types_primitives" /> | ||
1731 | <DetectChar context="SquareBracket" attribute="Symbol" char="[" beginRegion="List" /> | 1788 | <RegExpr context="#stay" attribute="Symbol" String="<\s*>" /> | ||
1732 | <DetectChar context="RoundBracket" char="(" /> | | |||
1733 | <DetectChar context="tBracket" attribute="Symbol" char="<" /> | | |||
1734 | <IncludeRules context="Normal" /> | | |||
1735 | </context> | 1789 | </context> | ||
1736 | <context name="SquareBracket" attribute="Normal Text" lineEndContext="#stay"> | 1790 | <context name="TypesFindBrackets" attribute="Normal Text" lineEndContext="#stay"> | ||
1791 | <DetectChar context="TypesSquareBracket" attribute="Symbol" char="[" beginRegion="List" /> | ||||
1792 | <DetectChar context="TypesCurlyBracket" attribute="Symbol" char="{" beginRegion="Brace" /> | ||||
1793 | <DetectChar context="TypesRoundBracket" char="(" /> | ||||
1794 | </context> | ||||
1795 | | ||||
1796 | <context name="TypesSquareBracket" attribute="Normal Text" lineEndContext="#stay"> | ||||
1737 | <DetectChar context="#pop" attribute="Symbol" char="]" endRegion="List" /> | 1797 | <DetectChar context="#pop" attribute="Symbol" char="]" endRegion="List" /> | ||
1738 | <IncludeRules context="DefaultAnnotation" /> | 1798 | <IncludeRules context="TypesFindBrackets" /> | ||
1799 | <IncludeRules context="DefaultTypes" /> | ||||
1800 | <IncludeRules context="Normal" /> | ||||
1801 | </context> | ||||
1802 | <context name="TypesCurlyBracket" attribute="Normal Text" lineEndContext="#pop!Object"> | ||||
1803 | <DetectChar context="#pop" attribute="Symbol" char="}" endRegion="Brace" /> | ||||
1804 | <RegExpr context="#pop!Object" String="\S" firstNonSpace="true" lookAhead="true" /> <!-- FixPopLineEndContext --> | ||||
1805 | <IncludeRules context="TypesFindBrackets" /> | ||||
1806 | <IncludeRules context="DefaultTypes" /> | ||||
1807 | <IncludeRules context="Object" /> | ||||
1739 | </context> | 1808 | </context> | ||
1740 | <context name="RoundBracket" attribute="Normal Text" lineEndContext="#pop"> | 1809 | <context name="TypesRoundBracket" attribute="Normal Text" lineEndContext="#pop"> | ||
1741 | <DetectChar context="#pop" char=")" /> | 1810 | <DetectChar context="#pop" char=")" /> | ||
1742 | <IncludeRules context="DefaultAnnotation" /> | 1811 | <IncludeRules context="FixPopLineEndContext" /> | ||
1812 | <IncludeRules context="TypesFindBrackets" /> | ||||
1813 | <IncludeRules context="DefaultTypes" /> | ||||
1814 | <IncludeRules context="Normal" /> | ||||
1743 | </context> | 1815 | </context> | ||
1744 | <context name="tBracket" attribute="Normal Text" lineEndContext="#pop"> | 1816 | | ||
1817 | <context name="TypesAngleBracket" attribute="Normal Text" lineEndContext="#pop"> | ||||
1745 | <DetectChar context="#pop" attribute="Symbol" char=">" /> | 1818 | <DetectChar context="#pop" attribute="Symbol" char=">" /> | ||
1746 | <IncludeRules context="DefaultAnnotation" /> | 1819 | <IncludeRules context="TypesAngleBracketEnd" /> | ||
1820 | <IncludeRules context="FixPopLineEndContext" /> | ||||
1821 | <IncludeRules context="TypesFindBrackets" /> | ||||
1822 | <IncludeRules context="DefaultTypes" /> | ||||
1823 | <IncludeRules context="Normal" /> | ||||
1824 | </context> | ||||
1825 | <context name="TypesAngleBracketEnd" attribute="Normal Text" lineEndContext="#stay"> | ||||
1826 | <AnyChar context="#pop" String="})];" lookAhead="true" /> | ||||
1747 | </context> | 1827 | </context> | ||
1748 | 1828 | | |||
1829 | <!-- new.target --> | ||||
1749 | <context name="NewTarget" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | 1830 | <context name="NewTarget" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | ||
1750 | <DetectSpaces /> | 1831 | <DetectSpaces /> | ||
1751 | <AnyChar context="#stay" attribute="Symbol" String=".?!" /> | 1832 | <AnyChar context="#stay" attribute="Symbol" String=".?!" /> | ||
1752 | <WordDetect context="#pop!NoRegExp" attribute="Keyword" String="target" /> | 1833 | <WordDetect context="#pop!NoRegExp" attribute="Keyword" String="target" /> | ||
1753 | </context> | 1834 | </context> | ||
1754 | 1835 | | |||
1836 | <!-- After keyword list "control_export_types" --> | ||||
1755 | <context name="ControlExport" attribute="Normal Text" lineEndContext="#pop"> | 1837 | <context name="ControlExport" attribute="Normal Text" lineEndContext="#pop"> | ||
1756 | <AnyChar context="#pop" attribute="Normal Text" String="{;" lookAhead="true" /> | 1838 | <AnyChar context="#pop" attribute="Normal Text" String="{;" lookAhead="true" /> | ||
1757 | <IncludeRules context="FindStrings" /> | 1839 | <IncludeRules context="FindStrings" /> | ||
1758 | <RegExpr context="#stay" attribute="Types/Primitives" String="&identifier;" /> | 1840 | <RegExpr context="#stay" attribute="Types/Primitives" String="&identifier;" /> | ||
1759 | <IncludeRules context="FindComments##JavaScript" /> | 1841 | <IncludeRules context="FindComments##JavaScript" /> | ||
1760 | </context> | 1842 | </context> | ||
1761 | 1843 | | |||
1844 | <!-- "import" keyword --> | ||||
1762 | <context name="Import" attribute="Normal Text" lineEndContext="#pop"> | 1845 | <context name="Import" attribute="Normal Text" lineEndContext="#pop"> | ||
1763 | <DetectChar context="#pop!ImportRequireKey" attribute="Symbol" char="=" /> | 1846 | <DetectChar context="#pop!ImportRequireKey" attribute="Symbol" char="=" /> | ||
1764 | <WordDetect context="#pop!NoRegExp" attribute="Keyword" String="meta" /> <!-- importmeta_property --> | 1847 | <WordDetect context="#pop!NoRegExp" attribute="Keyword" String="meta" /> <!-- importmeta_property --> | ||
1765 | <IncludeRules context="Normal" /> | 1848 | <IncludeRules context="Normal" /> | ||
1766 | </context> | 1849 | </context> | ||
1767 | <context name="ImportRequireKey" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | 1850 | <context name="ImportRequireKey" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | ||
1768 | <RegExpr context="#stay" attribute="Keyword" String="\s*\b(require)\s*(?=\()" /> | 1851 | <RegExpr context="#stay" attribute="Keyword" String="\s*\b(require)\s*(?=\()" /> | ||
1769 | <DetectChar context="ImportRequire" attribute="Symbol" char="(" beginRegion="import" /> | 1852 | <DetectChar context="ImportRequire" attribute="Symbol" char="(" beginRegion="import" /> | ||
1770 | </context> | 1853 | </context> | ||
1771 | <context name="ImportRequire" attribute="Normal Text" lineEndContext="#stay"> | 1854 | <context name="ImportRequire" attribute="Normal Text" lineEndContext="#stay"> | ||
1772 | <DetectChar context="#pop#pop" attribute="Symbol" char=")" endRegion="import" /> | 1855 | <DetectChar context="#pop#pop" attribute="Symbol" char=")" endRegion="import" /> | ||
1773 | <IncludeRules context="FindStrings" /> | 1856 | <IncludeRules context="FindStrings" /> | ||
1774 | <IncludeRules context="Numbers" /> | 1857 | <IncludeRules context="FindNumbers" /> | ||
1775 | <IncludeRules context="FindComments##JavaScript" /> | 1858 | <IncludeRules context="FindComments##JavaScript" /> | ||
1776 | </context> | 1859 | </context> | ||
1777 | 1860 | | |||
1778 | <context name="FindObjects" attribute="Normal Text" lineEndContext="#stay"> | 1861 | <!-- Member Objects --> | ||
1779 | <!-- Built-in Classes --> | | |||
1780 | <WordDetect context="FindMemberObjectMath" attribute="Built-in Objects" String="Math" /> | | |||
1781 | <WordDetect context="FindMemberObjectPromise" attribute="Built-in Objects" String="Promise" /> | | |||
1782 | <WordDetect context="FindMemberObjectJSON" attribute="Built-in Objects" String="JSON" /> | | |||
1783 | <WordDetect context="FindMemberObjectConsole" attribute="Built-in Objects" String="console" /> | | |||
1784 | <WordDetect context="FindMemberObjectProcess" attribute="Built-in Objects" String="process" /> | | |||
1785 | <keyword context="#stay" attribute="Built-in Objects" String="class_builtin" /> | | |||
1786 | <keyword context="FindMemberObjectDOM" attribute="Built-in Objects" String="class_dom" /> | | |||
1787 | <keyword context="FindMemberObjectNode" attribute="Built-in Objects" String="class_node" /> | | |||
1788 | <keyword context="FindMemberObjectDOM" attribute="Built-in Objects" String="dom_variable" /> | | |||
1789 | | ||||
1790 | <RegExpr context="MemberObject" attribute="Objects" String="&identifier;(?=\s*[\?!]?\.)" /> | | |||
1791 | <DetectChar context="MemberObject" char="." /> | | |||
1792 | </context> | | |||
1793 | 1862 | | |||
1794 | <context name="MemberObject" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | 1863 | <context name="MemberObject" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | ||
1795 | <IncludeRules context="DefaultMemberObject" /> | 1864 | <IncludeRules context="DefaultMemberObject" /> | ||
1796 | <!-- Common functions --> | 1865 | <!-- Common functions --> | ||
1797 | <keyword context="#pop!NoRegExp" attribute="Function Name" String="function_eventhandler" /> | 1866 | <keyword context="#pop!NoRegExp" attribute="Function Name" String="function_eventhandler" /> | ||
1798 | <keyword context="#pop!NoRegExp" attribute="Function Name" String="function_common" /> | 1867 | <keyword context="#pop!NoRegExp" attribute="Function Name" String="function_common" /> | ||
1799 | </context> | 1868 | </context> | ||
1800 | 1869 | | |||
Show All 14 Lines | 1870 | <context name="DefaultMemberObject" attribute="Normal Text" lineEndContext="#pop"> | |||
1815 | <keyword context="#pop!NoRegExp" attribute="Function Name" String="functions" /> | 1884 | <keyword context="#pop!NoRegExp" attribute="Function Name" String="functions" /> | ||
1816 | </context> | 1885 | </context> | ||
1817 | <context name="FixPointMemberObject" attribute="Normal Text" lineEndContext="#pop"> | 1886 | <context name="FixPointMemberObject" attribute="Normal Text" lineEndContext="#pop"> | ||
1818 | <StringDetect context="#pop" attribute="Symbol" String="?..." /> | 1887 | <StringDetect context="#pop" attribute="Symbol" String="?..." /> | ||
1819 | <StringDetect context="#pop" attribute="Symbol" String="!..." /> | 1888 | <StringDetect context="#pop" attribute="Symbol" String="!..." /> | ||
1820 | <StringDetect context="#pop" attribute="Symbol" String="..." /> | 1889 | <StringDetect context="#pop" attribute="Symbol" String="..." /> | ||
1821 | </context> | 1890 | </context> | ||
1822 | 1891 | | |||
1892 | <!-- Built-in Classes --> | ||||
1893 | | ||||
1823 | <!-- DOM Classes --> | 1894 | <!-- DOM Classes --> | ||
1824 | <context name="FindMemberObjectDOM" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!NoRegExp"> | 1895 | <context name="FindMemberObjectDOM" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!NoRegExp"> | ||
1825 | <DetectSpaces /> | 1896 | <DetectSpaces /> | ||
1826 | <IncludeRules context="FixPointMemberObject" /> | 1897 | <IncludeRules context="FixPointMemberObject" /> | ||
1827 | <DetectChar context="#pop!MemberObjectDOM" attribute="Symbol" char="." /> | 1898 | <DetectChar context="#pop!MemberObjectDOM" attribute="Symbol" char="." /> | ||
1828 | <Detect2Chars context="#pop!MemberObjectDOM" attribute="Symbol" char="?" char1="." /> | 1899 | <Detect2Chars context="#pop!MemberObjectDOM" attribute="Symbol" char="?" char1="." /> | ||
1829 | <Detect2Chars context="#pop!MemberObjectDOM" attribute="Symbol" char="!" char1="." /> | 1900 | <Detect2Chars context="#pop!MemberObjectDOM" attribute="Symbol" char="!" char1="." /> | ||
1830 | </context> | 1901 | </context> | ||
▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines |