summaryrefslogtreecommitdiff
path: root/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ebnf.xml
blob: df5d62ffa6d2078ad27d2233c79dd06a4148ace5 (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
<lexer>
  <config>
    <name>EBNF</name>
    <alias>ebnf</alias>
    <filename>*.ebnf</filename>
    <mime_type>text/x-ebnf</mime_type>
  </config>
  <rules>
    <state name="comment">
      <rule pattern="[^*)]">
        <token type="CommentMultiline"/>
      </rule>
      <rule>
        <include state="comment_start"/>
      </rule>
      <rule pattern="\*\)">
        <token type="CommentMultiline"/>
        <pop depth="1"/>
      </rule>
      <rule pattern="[*)]">
        <token type="CommentMultiline"/>
      </rule>
    </state>
    <state name="identifier">
      <rule pattern="([a-zA-Z][\w \-]*)">
        <token type="Keyword"/>
      </rule>
    </state>
    <state name="root">
      <rule>
        <include state="whitespace"/>
      </rule>
      <rule>
        <include state="comment_start"/>
      </rule>
      <rule>
        <include state="identifier"/>
      </rule>
      <rule pattern="=">
        <token type="Operator"/>
        <push state="production"/>
      </rule>
    </state>
    <state name="production">
      <rule>
        <include state="whitespace"/>
      </rule>
      <rule>
        <include state="comment_start"/>
      </rule>
      <rule>
        <include state="identifier"/>
      </rule>
      <rule pattern="&#34;[^&#34;]*&#34;">
        <token type="LiteralStringDouble"/>
      </rule>
      <rule pattern="&#39;[^&#39;]*&#39;">
        <token type="LiteralStringSingle"/>
      </rule>
      <rule pattern="(\?[^?]*\?)">
        <token type="NameEntity"/>
      </rule>
      <rule pattern="[\[\]{}(),|]">
        <token type="Punctuation"/>
      </rule>
      <rule pattern="-">
        <token type="Operator"/>
      </rule>
      <rule pattern=";">
        <token type="Punctuation"/>
        <pop depth="1"/>
      </rule>
      <rule pattern="\.">
        <token type="Punctuation"/>
        <pop depth="1"/>
      </rule>
    </state>
    <state name="whitespace">
      <rule pattern="\s+">
        <token type="Text"/>
      </rule>
    </state>
    <state name="comment_start">
      <rule pattern="\(\*">
        <token type="CommentMultiline"/>
        <push state="comment"/>
      </rule>
    </state>
  </rules>
</lexer>