crates/highlight/syntaxes/ril.json 4.3 KiB raw
1
{
2
  "displayName": "Radiance IL",
3
  "fileTypes": [
4
    "ril"
5
  ],
6
  "name": "ril",
7
  "patterns": [
8
    {
9
      "include": "#comments"
10
    },
11
    {
12
      "include": "#symbols"
13
    },
14
    {
15
      "include": "#strings"
16
    },
17
    {
18
      "include": "#labels"
19
    },
20
    {
21
      "include": "#registers"
22
    },
23
    {
24
      "include": "#branches"
25
    },
26
    {
27
      "include": "#keywords"
28
    },
29
    {
30
      "include": "#numbers"
31
    },
32
    {
33
      "include": "#punctuation"
34
    }
35
  ],
36
  "repository": {
37
    "branches": {
38
      "patterns": [
39
        {
40
          "captures": {
41
            "1": {
42
              "name": "keyword.control.branch.ril"
43
            },
44
            "2": {
45
              "name": "keyword.operator.comparison.ril"
46
            }
47
          },
48
          "match": "\\b(br)\\.(eq|ne|slt|ult)\\b",
49
          "name": "keyword.control.branch.ril"
50
        }
51
      ]
52
    },
53
    "comments": {
54
      "patterns": [
55
        {
56
          "begin": "//",
57
          "beginCaptures": {
58
            "0": {
59
              "name": "punctuation.definition.comment.ril"
60
            }
61
          },
62
          "end": "$",
63
          "name": "comment.line.double-slash.ril",
64
          "patterns": [
65
            {
66
              "match": "\\b(?:TODO|FIXME)\\b",
67
              "name": "keyword.other.todo.ril"
68
            }
69
          ]
70
        }
71
      ]
72
    },
73
    "keywords": {
74
      "patterns": [
75
        {
76
          "match": "\\b(?:void|w8|w16|w32|w64)\\b",
77
          "name": "storage.type.ril"
78
        },
79
        {
80
          "match": "\\b(?:str|sym|undef|undefined)\\b",
81
          "name": "constant.language.ril"
82
        },
83
        {
84
          "match": "\\b(?:add|and|blit|call|copy|ebreak|ecall|eq|jmp|load|mul|ne|neg|not|or|reserve|ret|sdiv|sext|sge|shl|sload|slt|srem|sshr|store|sub|switch|udiv|uge|ult|unreachable|urem|ushr|xor|zext)\\b",
85
          "name": "keyword.other.instruction.ril"
86
        },
87
        {
88
          "match": "\\b(?:align|data|extern|fn|mut)\\b",
89
          "name": "keyword.control.ril"
90
        }
91
      ]
92
    },
93
    "labels": {
94
      "patterns": [
95
        {
96
          "match": "@[A-Za-z_][A-Za-z0-9_#.]*",
97
          "name": "entity.name.label.ril"
98
        }
99
      ]
100
    },
101
    "numbers": {
102
      "patterns": [
103
        {
104
          "match": "(?<![A-Za-z0-9_])-?0[xX][0-9A-Fa-f]+",
105
          "name": "constant.numeric.integer.hexadecimal.ril"
106
        },
107
        {
108
          "match": "(?<![A-Za-z0-9_])-?[0-9]+",
109
          "name": "constant.numeric.integer.decimal.ril"
110
        }
111
      ]
112
    },
113
    "punctuation": {
114
      "patterns": [
115
        {
116
          "match": "[{}]",
117
          "name": "punctuation.section.block.ril"
118
        },
119
        {
120
          "match": "[()]",
121
          "name": "punctuation.section.group.ril"
122
        },
123
        {
124
          "match": "[;:,]",
125
          "name": "punctuation.separator.ril"
126
        },
127
        {
128
          "match": "\\*",
129
          "name": "keyword.operator.ril"
130
        }
131
      ]
132
    },
133
    "registers": {
134
      "patterns": [
135
        {
136
          "match": "%[A-Za-z0-9_]+",
137
          "name": "variable.other.register.ril"
138
        }
139
      ]
140
    },
141
    "strings": {
142
      "patterns": [
143
        {
144
          "begin": "\"",
145
          "beginCaptures": {
146
            "0": {
147
              "name": "punctuation.definition.string.begin.ril"
148
            }
149
          },
150
          "end": "\"",
151
          "endCaptures": {
152
            "0": {
153
              "name": "punctuation.definition.string.end.ril"
154
            }
155
          },
156
          "name": "string.quoted.double.ril",
157
          "patterns": [
158
            {
159
              "match": "\\\\.",
160
              "name": "constant.character.escape.ril"
161
            }
162
          ]
163
        }
164
      ]
165
    },
166
    "symbols": {
167
      "patterns": [
168
        {
169
          "captures": {
170
            "1": {
171
              "name": "punctuation.definition.variable.ril"
172
            },
173
            "2": {
174
              "name": "punctuation.definition.string.begin.ril"
175
            },
176
            "3": {
177
              "name": "variable.other.symbol.quoted.ril"
178
            },
179
            "4": {
180
              "name": "punctuation.definition.string.end.ril"
181
            }
182
          },
183
          "match": "(\\$)(\")([^\"]*)(\")"
184
        },
185
        {
186
          "match": "\\$[A-Za-z_][$A-Za-z0-9_]*",
187
          "name": "variable.other.symbol.ril"
188
        }
189
      ]
190
    }
191
  },
192
  "scopeName": "source.ril"
193
}