summaryrefslogtreecommitdiff
path: root/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/qml.xml
blob: 43eb3eb3db5d661e3133bd46182b8bf357a72263 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<lexer>
  <config>
    <name>QML</name>
    <alias>qml</alias>
    <alias>qbs</alias>
    <filename>*.qml</filename>
    <filename>*.qbs</filename>
    <mime_type>application/x-qml</mime_type>
    <mime_type>application/x-qt.qbs+qml</mime_type>
    <dot_all>true</dot_all>
  </config>
  <rules>
    <state name="root">
      <rule pattern="^(?=\s|/|&lt;!--)">
        <token type="Text"/>
        <push state="slashstartsregex"/>
      </rule>
      <rule>
        <include state="commentsandwhitespace"/>
      </rule>
      <rule pattern="\+\+|--|~|&amp;&amp;|\?|:|\|\||\\(?=\n)|(&lt;&lt;|&gt;&gt;&gt;?|==?|!=?|[-&lt;&gt;+*%&amp;|^/])=?">
        <token type="Operator"/>
        <push state="slashstartsregex"/>
      </rule>
      <rule pattern="[{(\[;,]">
        <token type="Punctuation"/>
        <push state="slashstartsregex"/>
      </rule>
      <rule pattern="[})\].]">
        <token type="Punctuation"/>
      </rule>
      <rule pattern="\bid\s*:\s*[A-Za-z][\w.]*">
        <token type="KeywordDeclaration"/>
        <push state="slashstartsregex"/>
      </rule>
      <rule pattern="\b[A-Za-z][\w.]*\s*:">
        <token type="Keyword"/>
        <push state="slashstartsregex"/>
      </rule>
      <rule pattern="(for|in|while|do|break|return|continue|switch|case|default|if|else|throw|try|catch|finally|new|delete|typeof|instanceof|void|this)\b">
        <token type="Keyword"/>
        <push state="slashstartsregex"/>
      </rule>
      <rule pattern="(var|let|with|function)\b">
        <token type="KeywordDeclaration"/>
        <push state="slashstartsregex"/>
      </rule>
      <rule pattern="(abstract|boolean|byte|char|class|const|debugger|double|enum|export|extends|final|float|goto|implements|import|int|interface|long|native|package|private|protected|public|short|static|super|synchronized|throws|transient|volatile)\b">
        <token type="KeywordReserved"/>
      </rule>
      <rule pattern="(true|false|null|NaN|Infinity|undefined)\b">
        <token type="KeywordConstant"/>
      </rule>
      <rule pattern="(Array|Boolean|Date|Error|Function|Math|netscape|Number|Object|Packages|RegExp|String|sun|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|Error|eval|isFinite|isNaN|parseFloat|parseInt|document|this|window)\b">
        <token type="NameBuiltin"/>
      </rule>
      <rule pattern="[$a-zA-Z_]\w*">
        <token type="NameOther"/>
      </rule>
      <rule pattern="[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?">
        <token type="LiteralNumberFloat"/>
      </rule>
      <rule pattern="0x[0-9a-fA-F]+">
        <token type="LiteralNumberHex"/>
      </rule>
      <rule pattern="[0-9]+">
        <token type="LiteralNumberInteger"/>
      </rule>
      <rule pattern="&#34;(\\\\|\\&#34;|[^&#34;])*&#34;">
        <token type="LiteralStringDouble"/>
      </rule>
      <rule pattern="&#39;(\\\\|\\&#39;|[^&#39;])*&#39;">
        <token type="LiteralStringSingle"/>
      </rule>
    </state>
    <state name="commentsandwhitespace">
      <rule pattern="\s+">
        <token type="Text"/>
      </rule>
      <rule pattern="&lt;!--">
        <token type="Comment"/>
      </rule>
      <rule pattern="//.*?\n">
        <token type="CommentSingle"/>
      </rule>
      <rule pattern="/\*.*?\*/">
        <token type="CommentMultiline"/>
      </rule>
    </state>
    <state name="slashstartsregex">
      <rule>
        <include state="commentsandwhitespace"/>
      </rule>
      <rule pattern="/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/([gim]+\b|\B)">
        <token type="LiteralStringRegex"/>
        <pop depth="1"/>
      </rule>
      <rule pattern="(?=/)">
        <token type="Text"/>
        <push state="#pop" state="badregex"/>
      </rule>
      <rule>
        <pop depth="1"/>
      </rule>
    </state>
    <state name="badregex">
      <rule pattern="\n">
        <token type="Text"/>
        <pop depth="1"/>
      </rule>
    </state>
  </rules>
</lexer>