forked from colejcummins/llvm-syntax-highlighting
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathllvm.tmLanguage.json
More file actions
199 lines (199 loc) · 8.83 KB
/
Copy pathllvm.tmLanguage.json
File metadata and controls
199 lines (199 loc) · 8.83 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "LLVM IR",
"scopeName": "source.ll",
"patterns": [
{ "include": "#comments" },
{ "include": "#strings" },
{ "include": "#labels" },
{ "include": "#symbols" },
{ "include": "#types" },
{ "include": "#instructions" },
{ "include": "#modifiers" },
{ "include": "#constants" },
{ "include": "#numbers" },
{ "include": "#punctuation" }
],
"repository": {
"comments": {
"patterns": [
{
"name": "comment.line.semicolon.llvm",
"match": ";.*$"
}
]
},
"strings": {
"patterns": [
{
"name": "string.quoted.double.llvm",
"begin": "(?:c)?\"",
"beginCaptures": {
"0": { "name": "punctuation.definition.string.begin.llvm" }
},
"end": "\"",
"endCaptures": {
"0": { "name": "punctuation.definition.string.end.llvm" }
},
"patterns": [
{
"name": "constant.character.escape.llvm",
"match": "\\\\(?:[0-9A-Fa-f]{2}|[\\\\\"])"
}
]
}
]
},
"labels": {
"patterns": [
{
"match": "^\\s*([-a-zA-Z$._][-a-zA-Z$._0-9]*|[0-9]+|\"(?:[^\"\\\\]|\\\\.)+\")(:)",
"captures": {
"1": { "name": "entity.name.label.llvm" },
"2": { "name": "punctuation.separator.colon.llvm" }
}
},
{
"match": "\\b(label)\\s+(%[-a-zA-Z$._0-9]+|%\"(?:[^\"\\\\]|\\\\.)+\")",
"captures": {
"1": { "name": "storage.type.llvm" },
"2": { "name": "variable.other.label.llvm" }
}
}
]
},
"symbols": {
"patterns": [
{
"name": "entity.name.function.llvm",
"match": "@(?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|[0-9]+|\"(?:[^\"\\\\]|\\\\.)+\")(?=\\s*\\()"
},
{
"name": "entity.name.type.llvm",
"match": "%(?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|[0-9]+|\"(?:[^\"\\\\]|\\\\.)+\")(?=\\s*=\\s*type\\b)"
},
{
"name": "entity.name.type.llvm",
"match": "%\"?(?:struct|class|union)\\.[-a-zA-Z$._0-9]+\"?"
},
{
"name": "variable.other.global.llvm",
"match": "@(?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|[0-9]+|\"(?:[^\"\\\\]|\\\\.)+\")"
},
{
"name": "variable.other.local.llvm",
"match": "%(?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|[0-9]+|\"(?:[^\"\\\\]|\\\\.)+\")"
},
{
"name": "variable.other.attribute-group.llvm",
"match": "#[0-9]+\\b"
},
{
"name": "variable.other.comdat.llvm",
"match": "\\$(?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|\"(?:[^\"\\\\]|\\\\.)+\")"
},
{
"match": "(!)([A-Za-z][A-Za-z0-9_]*)(?=\\s*\\()",
"captures": {
"1": { "name": "punctuation.definition.metadata.llvm" },
"2": { "name": "entity.name.type.metadata.llvm" }
}
},
{
"name": "variable.other.metadata.llvm",
"match": "!(?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|[0-9]+)\\b"
}
]
},
"types": {
"patterns": [
{
"name": "entity.name.type.llvm",
"match": "\\b(?:void|half|bfloat|float|double|x86_fp80|fp128|ppc_fp128|label|metadata|x86_mmx|x86_amx|token|ptr|opaque|i[0-9]+)\\b"
},
{
"name": "storage.type.aggregate.llvm",
"match": "\\btype\\b"
},
{
"match": "\\b(addrspace)(\\()([0-9]+)(\\))",
"captures": {
"1": { "name": "storage.modifier.llvm" },
"2": { "name": "punctuation.section.group.begin.llvm" },
"3": { "name": "constant.numeric.integer.llvm" },
"4": { "name": "punctuation.section.group.end.llvm" }
}
}
]
},
"instructions": {
"patterns": [
{
"name": "keyword.control.llvm",
"match": "\\b(?:br|callbr|catchret|catchswitch|cleanupret|indirectbr|invoke|resume|ret|switch|unreachable)\\b"
},
{
"name": "keyword.operator.comparison.llvm",
"match": "\\b(?:eq|ne|ugt|uge|ult|ule|sgt|sge|slt|sle|oeq|ogt|oge|olt|ole|one|ord|ueq|une|uno)\\b"
},
{
"name": "keyword.instruction.llvm",
"match": "(?<![-a-zA-Z$._0-9])(?:#dbg_(?:assign|declare|label|value)|add|addrspacecast|alloca|and|ashr|atomicrmw|bitcast|br|call|callbr|catchpad|catchswitch|catchret|cleanuppad|cleanupret|cmpxchg|extractelement|extractvalue|fadd|fcmp|fdiv|fence|fmax|fmin|fmul|fneg|fpext|fptosi|fptoui|fptrunc|freeze|frem|fsub|getelementptr|icmp|indirectbr|insertelement|insertvalue|inttoptr|invoke|landingpad|load|lshr|max|min|mul|nand|or|phi|ptrtoint|resume|ret|sdiv|select|sext|shl|shufflevector|sitofp|srem|store|sub|switch|trunc|udec_wrap|udiv|uinc_wrap|uitofp|umax|umin|unreachable|urem|usub_cond|usub_sat|va_arg|xchg|xor|zext)(?![-a-zA-Z$._0-9])"
}
]
},
"modifiers": {
"patterns": [
{
"name": "storage.modifier.llvm",
"match": "\\b(?:acq_rel|acquire|afn|align|alignstack|allocsize|alwaysinline|amdgpu_cs|amdgpu_es|amdgpu_gfx|amdgpu_gs|amdgpu_kernel|amdgpu_ls|amdgpu_ps|amdgpu_vs|anyregcc|appending|argmem|argmemonly|arm_aapcs_vfpcc|arm_aapcscc|arm_apcscc|atomic|available_externally|builtin|byref|byval|c|caller|cc|ccc|cfguard_checkcc|cold|coldcc|common|constant|contract|convergent|declare|define|dereferenceable|dereferenceable_or_null|disjoint|distinct|dllexport|dllimport|dso_local|dso_preemptable|errnomem|exact|extern_weak|external|externally_initialized|fast|fastcc|from|gc|global|hidden|hot|immarg|inaccessiblemem|inaccessiblemem_or_argmemonly|inaccessiblememonly|inalloca|inbounds|initialexec|inlinehint|inreg|intel_ocl_bicc|inteldialect|internal|jumptable|linkonce|linkonce_odr|local_unnamed_addr|localdynamic|localexec|minsize|module|monotonic|mustprogress|musttail|naked|ninf|nnan|no_cfi|noalias|nobuiltin|nocallback|nocapture|nocf_check|noduplicate|nofree|noimplicitfloat|noinline|noipa|nomerge|nneg|nooutline|nonlazybind|nonnull|noprofile|norecurse|noredzone|noreturn|nosanitize_bounds|nosanitize_coverage|nosync|noundef|nounwind|nsw|nsz|null_pointer_is_valid|nuw|optdebug|optforfuzzing|optnone|optsize|other|personality|preallocated|private|protected|ptrauth|ptx_device|ptx_kernel|read|readnone|readonly|readwrite|reassoc|release|returned|returns_twice|safestack|sanitize_address|sanitize_alloc_token|sanitize_hwaddress|sanitize_memory|sanitize_memtag|sanitize_thread|section|seq_cst|shadowcallstack|sideeffect|signext|speculatable|speculative_load_hardening|spir_func|spir_kernel|splat|sret|ssp|sspreq|sspstrong|strictfp|swiftcc|swifterror|swiftself|swifttailcc|syncscope|tail|tailcc|thread_local|to|unordered|unnamed_addr|uselistorder|uwtable|volatile|weak|weak_odr|willreturn|win64cc|within|write|writeonly|x86_64_sysvcc|x86_fastcallcc|x86_stdcallcc|x86_thiscallcc|zeroext)\\b"
},
{
"name": "storage.modifier.llvm",
"match": "\\b(?:alias|asm|attributes|blockaddress|comdat|datalayout|deplibs|ifunc|memory|prefix|prologue|source_filename|target|triple)\\b"
},
{
"name": "keyword.operator.assignment.llvm",
"match": "="
}
]
},
"constants": {
"patterns": [
{
"name": "constant.language.llvm",
"match": "\\b(?:false|true|null|none|poison|undef|vscale|zeroinitializer)\\b"
},
{
"name": "constant.other.debug.llvm",
"match": "\\b(?:DW_TAG_[A-Za-z0-9_]+|DW_ATE_[A-Za-z0-9_]+|DW_OP_[A-Za-z0-9_]+|DW_LANG_[A-Za-z0-9_]+|DW_VIRTUALITY_[A-Za-z0-9_]+|DIFlag[A-Za-z0-9_]+|DISPFlag[A-Za-z0-9_]+)\\b"
}
]
},
"numbers": {
"patterns": [
{
"name": "constant.numeric.float.llvm",
"match": "(?<![-a-zA-Z$._0-9])[-+]?(?:[0-9]+\\.[0-9]*(?:[eE][-+]?[0-9]+)?|0x[HKLMR]?[0-9A-Fa-f]+)(?![-a-zA-Z$._0-9])"
},
{
"name": "constant.numeric.integer.llvm",
"match": "(?<![-a-zA-Z$._0-9])[-+]?[0-9]+(?![-a-zA-Z$._0-9])"
}
]
},
"punctuation": {
"patterns": [
{ "name": "punctuation.separator.comma.llvm", "match": "," },
{ "name": "punctuation.section.group.begin.llvm", "match": "\\(" },
{ "name": "punctuation.section.group.end.llvm", "match": "\\)" },
{ "name": "punctuation.section.block.begin.llvm", "match": "[\\[{]" },
{ "name": "punctuation.section.block.end.llvm", "match": "[\\]}]" },
{ "name": "punctuation.definition.type.begin.llvm", "match": "<" },
{ "name": "punctuation.definition.type.end.llvm", "match": ">" },
{ "name": "punctuation.definition.variable.llvm", "match": "[*]" },
{ "name": "punctuation.definition.parameters.llvm", "match": "\\.\\.\\." }
]
}
}
}