summaryrefslogtreecommitdiff
path: root/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cap_n_proto.xml
blob: 3e7d1470bf75f0cabea0cfcacfe8f3584dd527df (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
114
115
116
117
118
119
120
121
122
<lexer>
  <config>
    <name>Cap&#39;n Proto</name>
    <alias>capnp</alias>
    <filename>*.capnp</filename>
  </config>
  <rules>
    <state name="root">
      <rule pattern="#.*?$">
        <token type="CommentSingle"/>
      </rule>
      <rule pattern="@[0-9a-zA-Z]*">
        <token type="NameDecorator"/>
      </rule>
      <rule pattern="=">
        <token type="Literal"/>
        <push state="expression"/>
      </rule>
      <rule pattern=":">
        <token type="NameClass"/>
        <push state="type"/>
      </rule>
      <rule pattern="\$">
        <token type="NameAttribute"/>
        <push state="annotation"/>
      </rule>
      <rule pattern="(struct|enum|interface|union|import|using|const|annotation|extends|in|of|on|as|with|from|fixed)\b">
        <token type="Keyword"/>
      </rule>
      <rule pattern="[\w.]+">
        <token type="Name"/>
      </rule>
      <rule pattern="[^#@=:$\w]+">
        <token type="Text"/>
      </rule>
    </state>
    <state name="type">
      <rule pattern="[^][=;,(){}$]+">
        <token type="NameClass"/>
      </rule>
      <rule pattern="[[(]">
        <token type="NameClass"/>
        <push state="parentype"/>
      </rule>
      <rule>
        <pop depth="1"/>
      </rule>
    </state>
    <state name="parentype">
      <rule pattern="[^][;()]+">
        <token type="NameClass"/>
      </rule>
      <rule pattern="[[(]">
        <token type="NameClass"/>
        <push/>
      </rule>
      <rule pattern="[])]">
        <token type="NameClass"/>
        <pop depth="1"/>
      </rule>
      <rule>
        <pop depth="1"/>
      </rule>
    </state>
    <state name="expression">
      <rule pattern="[^][;,(){}$]+">
        <token type="Literal"/>
      </rule>
      <rule pattern="[[(]">
        <token type="Literal"/>
        <push state="parenexp"/>
      </rule>
      <rule>
        <pop depth="1"/>
      </rule>
    </state>
    <state name="parenexp">
      <rule pattern="[^][;()]+">
        <token type="Literal"/>
      </rule>
      <rule pattern="[[(]">
        <token type="Literal"/>
        <push/>
      </rule>
      <rule pattern="[])]">
        <token type="Literal"/>
        <pop depth="1"/>
      </rule>
      <rule>
        <pop depth="1"/>
      </rule>
    </state>
    <state name="annotation">
      <rule pattern="[^][;,(){}=:]+">
        <token type="NameAttribute"/>
      </rule>
      <rule pattern="[[(]">
        <token type="NameAttribute"/>
        <push state="annexp"/>
      </rule>
      <rule>
        <pop depth="1"/>
      </rule>
    </state>
    <state name="annexp">
      <rule pattern="[^][;()]+">
        <token type="NameAttribute"/>
      </rule>
      <rule pattern="[[(]">
        <token type="NameAttribute"/>
        <push/>
      </rule>
      <rule pattern="[])]">
        <token type="NameAttribute"/>
        <pop depth="1"/>
      </rule>
      <rule>
        <pop depth="1"/>
      </rule>
    </state>
  </rules>
</lexer>