tm-grammars 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/LICENSE +22 -0
  2. package/NOTICE +6565 -0
  3. package/README.md +211 -0
  4. package/grammars/abap.json +380 -0
  5. package/grammars/actionscript-3.json +951 -0
  6. package/grammars/ada.json +3874 -0
  7. package/grammars/apache.json +562 -0
  8. package/grammars/apex.json +3203 -0
  9. package/grammars/apl.json +1479 -0
  10. package/grammars/applescript.json +1406 -0
  11. package/grammars/ara.json +428 -0
  12. package/grammars/asm.json +1741 -0
  13. package/grammars/astro.json +776 -0
  14. package/grammars/awk.json +388 -0
  15. package/grammars/ballerina.json +3768 -0
  16. package/grammars/bat.json +783 -0
  17. package/grammars/beancount.json +831 -0
  18. package/grammars/berry.json +172 -0
  19. package/grammars/bibtex.json +315 -0
  20. package/grammars/bicep.json +239 -0
  21. package/grammars/blade.json +3870 -0
  22. package/grammars/c.json +3552 -0
  23. package/grammars/cadence.json +738 -0
  24. package/grammars/clarity.json +877 -0
  25. package/grammars/clojure.json +426 -0
  26. package/grammars/cmake.json +143 -0
  27. package/grammars/cobol.json +1124 -0
  28. package/grammars/codeql.json +1540 -0
  29. package/grammars/coffee.json +1311 -0
  30. package/grammars/cpp-macro.json +9498 -0
  31. package/grammars/cpp.json +16635 -0
  32. package/grammars/crystal.json +1866 -0
  33. package/grammars/csharp.json +5722 -0
  34. package/grammars/css.json +1860 -0
  35. package/grammars/csv.json +46 -0
  36. package/grammars/cue.json +1128 -0
  37. package/grammars/cypher.json +353 -0
  38. package/grammars/d.json +3185 -0
  39. package/grammars/dart.json +522 -0
  40. package/grammars/dax.json +185 -0
  41. package/grammars/diff.json +155 -0
  42. package/grammars/docker.json +97 -0
  43. package/grammars/dream-maker.json +640 -0
  44. package/grammars/elixir.json +1014 -0
  45. package/grammars/elm.json +751 -0
  46. package/grammars/erb.json +156 -0
  47. package/grammars/erlang.json +1757 -0
  48. package/grammars/fish.json +189 -0
  49. package/grammars/fsharp.json +1831 -0
  50. package/grammars/gdresource.json +290 -0
  51. package/grammars/gdscript.json +969 -0
  52. package/grammars/gdshader.json +405 -0
  53. package/grammars/gherkin.json +133 -0
  54. package/grammars/git-commit.json +85 -0
  55. package/grammars/git-rebase.json +56 -0
  56. package/grammars/glimmer-js.json +98 -0
  57. package/grammars/glimmer-ts.json +98 -0
  58. package/grammars/glsl.json +57 -0
  59. package/grammars/gnuplot.json +892 -0
  60. package/grammars/go.json +1012 -0
  61. package/grammars/graphql.json +1295 -0
  62. package/grammars/groovy.json +1378 -0
  63. package/grammars/hack.json +2650 -0
  64. package/grammars/haml.json +598 -0
  65. package/grammars/handlebars.json +848 -0
  66. package/grammars/haskell.json +2431 -0
  67. package/grammars/hcl.json +787 -0
  68. package/grammars/hjson.json +821 -0
  69. package/grammars/hlsl.json +212 -0
  70. package/grammars/html.json +93 -0
  71. package/grammars/imba.json +2696 -0
  72. package/grammars/ini.json +108 -0
  73. package/grammars/java.json +1885 -0
  74. package/grammars/javascript.json +5984 -0
  75. package/grammars/jinja-html.json +16 -0
  76. package/grammars/jinja.json +345 -0
  77. package/grammars/jison.json +715 -0
  78. package/grammars/jsdoc.json +21 -0
  79. package/grammars/json.json +208 -0
  80. package/grammars/json5.json +244 -0
  81. package/grammars/jsonc.json +208 -0
  82. package/grammars/jsonl.json +208 -0
  83. package/grammars/jsonnet.json +211 -0
  84. package/grammars/jssm.json +159 -0
  85. package/grammars/jsx.json +5984 -0
  86. package/grammars/julia.json +1061 -0
  87. package/grammars/kotlin.json +580 -0
  88. package/grammars/kusto.json +687 -0
  89. package/grammars/latex.json +2395 -0
  90. package/grammars/less.json +5012 -0
  91. package/grammars/liquid.json +990 -0
  92. package/grammars/lisp.json +121 -0
  93. package/grammars/logo.json +55 -0
  94. package/grammars/lua.json +956 -0
  95. package/grammars/make.json +629 -0
  96. package/grammars/markdown.json +3066 -0
  97. package/grammars/marko.json +1344 -0
  98. package/grammars/matlab.json +1131 -0
  99. package/grammars/mdc.json +571 -0
  100. package/grammars/mdx.json +5629 -0
  101. package/grammars/mermaid.json +1382 -0
  102. package/grammars/mojo.json +4153 -0
  103. package/grammars/narrat.json +227 -0
  104. package/grammars/nextflow.json +298 -0
  105. package/grammars/nginx.json +2121 -0
  106. package/grammars/nim.json +1522 -0
  107. package/grammars/nix.json +1200 -0
  108. package/grammars/nushell.json +1047 -0
  109. package/grammars/objective-c.json +3750 -0
  110. package/grammars/objective-cpp.json +7242 -0
  111. package/grammars/ocaml.json +2967 -0
  112. package/grammars/pascal.json +154 -0
  113. package/grammars/perl.json +2971 -0
  114. package/grammars/php.json +4024 -0
  115. package/grammars/plsql.json +241 -0
  116. package/grammars/postcss.json +377 -0
  117. package/grammars/powerquery.json +349 -0
  118. package/grammars/powershell.json +1024 -0
  119. package/grammars/prisma.json +443 -0
  120. package/grammars/prolog.json +298 -0
  121. package/grammars/proto.json +507 -0
  122. package/grammars/pug.json +1033 -0
  123. package/grammars/puppet.json +777 -0
  124. package/grammars/purescript.json +871 -0
  125. package/grammars/python.json +4208 -0
  126. package/grammars/r.json +637 -0
  127. package/grammars/raku.json +310 -0
  128. package/grammars/razor.json +1813 -0
  129. package/grammars/reg.json +136 -0
  130. package/grammars/rel.json +200 -0
  131. package/grammars/riscv.json +298 -0
  132. package/grammars/rst.json +734 -0
  133. package/grammars/ruby.json +2769 -0
  134. package/grammars/rust.json +1171 -0
  135. package/grammars/sas.json +302 -0
  136. package/grammars/sass.json +618 -0
  137. package/grammars/scala.json +1313 -0
  138. package/grammars/scheme.json +384 -0
  139. package/grammars/scss.json +1874 -0
  140. package/grammars/shaderlab.json +199 -0
  141. package/grammars/shellscript.json +2025 -0
  142. package/grammars/shellsession.json +33 -0
  143. package/grammars/smalltalk.json +235 -0
  144. package/grammars/solidity.json +1210 -0
  145. package/grammars/sparql.json +45 -0
  146. package/grammars/splunk.json +91 -0
  147. package/grammars/sql.json +631 -0
  148. package/grammars/ssh-config.json +88 -0
  149. package/grammars/stata.json +3050 -0
  150. package/grammars/stylus.json +1208 -0
  151. package/grammars/svelte.json +1171 -0
  152. package/grammars/swift.json +4203 -0
  153. package/grammars/system-verilog.json +1063 -0
  154. package/grammars/tasl.json +292 -0
  155. package/grammars/tcl.json +291 -0
  156. package/grammars/tex.json +281 -0
  157. package/grammars/toml.json +431 -0
  158. package/grammars/tsx.json +5984 -0
  159. package/grammars/turtle.json +261 -0
  160. package/grammars/twig.json +1394 -0
  161. package/grammars/typescript.json +5735 -0
  162. package/grammars/v.json +1001 -0
  163. package/grammars/vb.json +232 -0
  164. package/grammars/verilog.json +305 -0
  165. package/grammars/vhdl.json +1484 -0
  166. package/grammars/viml.json +445 -0
  167. package/grammars/vue-html.json +559 -0
  168. package/grammars/vue.json +1237 -0
  169. package/grammars/vyper.json +5415 -0
  170. package/grammars/wasm.json +831 -0
  171. package/grammars/wenyan.json +129 -0
  172. package/grammars/wgsl.json +391 -0
  173. package/grammars/wolfram.json +2370 -0
  174. package/grammars/xml.json +382 -0
  175. package/grammars/xsl.json +89 -0
  176. package/grammars/yaml.json +616 -0
  177. package/grammars/zenscript.json +257 -0
  178. package/grammars/zig.json +312 -0
  179. package/index.d.ts +18 -0
  180. package/index.js +2165 -0
  181. package/package.json +46 -0
@@ -0,0 +1,136 @@
1
+ {
2
+ "displayName": "Windows Registry Script",
3
+ "fileTypes": [
4
+ "reg",
5
+ "REG"
6
+ ],
7
+ "name": "reg",
8
+ "patterns": [
9
+ {
10
+ "match": "Windows Registry Editor Version 5\\.00|REGEDIT4",
11
+ "name": "keyword.control.import.reg"
12
+ },
13
+ {
14
+ "captures": {
15
+ "1": {
16
+ "name": "punctuation.definition.comment.reg"
17
+ }
18
+ },
19
+ "match": "(;).*$",
20
+ "name": "comment.line.semicolon.reg"
21
+ },
22
+ {
23
+ "captures": {
24
+ "1": {
25
+ "name": "punctuation.definition.section.reg"
26
+ },
27
+ "2": {
28
+ "name": "entity.section.reg"
29
+ },
30
+ "3": {
31
+ "name": "punctuation.definition.section.reg"
32
+ }
33
+ },
34
+ "match": "^\\s*(\\[(?!-))(.*?)(\\])",
35
+ "name": "entity.name.function.section.add.reg"
36
+ },
37
+ {
38
+ "captures": {
39
+ "1": {
40
+ "name": "punctuation.definition.section.reg"
41
+ },
42
+ "2": {
43
+ "name": "entity.section.reg"
44
+ },
45
+ "3": {
46
+ "name": "punctuation.definition.section.reg"
47
+ }
48
+ },
49
+ "match": "^\\s*(\\[-)(.*?)(\\])",
50
+ "name": "entity.name.function.section.delete.reg"
51
+ },
52
+ {
53
+ "captures": {
54
+ "10": {
55
+ "name": "string.name.regdata.reg"
56
+ },
57
+ "11": {
58
+ "name": "punctuation.definition.quote.reg"
59
+ },
60
+ "13": {
61
+ "name": "support.type.dword.reg"
62
+ },
63
+ "14": {
64
+ "name": "keyword.operator.arithmetic.colon.reg"
65
+ },
66
+ "15": {
67
+ "name": "constant.numeric.dword.reg"
68
+ },
69
+ "17": {
70
+ "name": "support.type.dword.reg"
71
+ },
72
+ "18": {
73
+ "name": "keyword.operator.arithmetic.parenthesis.reg"
74
+ },
75
+ "19": {
76
+ "name": "keyword.operator.arithmetic.parenthesis.reg"
77
+ },
78
+ "2": {
79
+ "name": "punctuation.definition.quote.reg"
80
+ },
81
+ "20": {
82
+ "name": "constant.numeric.hex.size.reg"
83
+ },
84
+ "21": {
85
+ "name": "keyword.operator.arithmetic.parenthesis.reg"
86
+ },
87
+ "22": {
88
+ "name": "keyword.operator.arithmetic.colon.reg"
89
+ },
90
+ "23": {
91
+ "name": "constant.numeric.hex.reg"
92
+ },
93
+ "24": {
94
+ "name": "keyword.operator.arithmetic.linecontinuation.reg"
95
+ },
96
+ "25": {
97
+ "name": "comment.declarationline.semicolon.reg"
98
+ },
99
+ "3": {
100
+ "name": "support.function.regname.ini"
101
+ },
102
+ "4": {
103
+ "name": "punctuation.definition.quote.reg"
104
+ },
105
+ "5": {
106
+ "name": "punctuation.definition.equals.reg"
107
+ },
108
+ "7": {
109
+ "name": "keyword.operator.arithmetic.minus.reg"
110
+ },
111
+ "9": {
112
+ "name": "punctuation.definition.quote.reg"
113
+ }
114
+ },
115
+ "match": "^(\\s*([\"']?)(.+?)([\"']?)\\s*(=))?\\s*((-)|(([\"'])(.*?)([\"']))|(((?i:dword))(\\:)\\s*([\\dabcdefABCDEF]{1,8}))|(((?i:hex))((\\()([\\d]*)(\\)))?(\\:)(.*?)(\\\\?)))\\s*(;.*)?$",
116
+ "name": "meta.declaration.reg"
117
+ },
118
+ {
119
+ "match": "[0-9]+",
120
+ "name": "constant.numeric.reg"
121
+ },
122
+ {
123
+ "match": "[a-fA-F]+",
124
+ "name": "constant.numeric.hex.reg"
125
+ },
126
+ {
127
+ "match": ",+",
128
+ "name": "constant.numeric.hex.comma.reg"
129
+ },
130
+ {
131
+ "match": "\\\\",
132
+ "name": "keyword.operator.arithmetic.linecontinuation.reg"
133
+ }
134
+ ],
135
+ "scopeName": "source.reg"
136
+ }
@@ -0,0 +1,200 @@
1
+ {
2
+ "displayName": "Rel",
3
+ "name": "rel",
4
+ "patterns": [
5
+ {
6
+ "include": "#strings"
7
+ },
8
+ {
9
+ "include": "#comment"
10
+ },
11
+ {
12
+ "include": "#single-line-comment-consuming-line-ending"
13
+ },
14
+ {
15
+ "include": "#deprecated-temporary"
16
+ },
17
+ {
18
+ "include": "#operators"
19
+ },
20
+ {
21
+ "include": "#symbols"
22
+ },
23
+ {
24
+ "include": "#keywords"
25
+ },
26
+ {
27
+ "include": "#otherkeywords"
28
+ },
29
+ {
30
+ "include": "#types"
31
+ },
32
+ {
33
+ "include": "#constants"
34
+ }
35
+ ],
36
+ "repository": {
37
+ "comment": {
38
+ "patterns": [
39
+ {
40
+ "begin": "/\\*\\*(?!/)",
41
+ "beginCaptures": {
42
+ "0": {
43
+ "name": "punctuation.definition.comment.rel"
44
+ }
45
+ },
46
+ "end": "\\*/",
47
+ "endCaptures": {
48
+ "0": {
49
+ "name": "punctuation.definition.comment.rel"
50
+ }
51
+ },
52
+ "name": "comment.block.documentation.rel",
53
+ "patterns": [
54
+ {
55
+ "include": "#docblock"
56
+ }
57
+ ]
58
+ },
59
+ {
60
+ "begin": "(/\\*)(?:\\s*((@)internal)(?=\\s|(\\*/)))?",
61
+ "beginCaptures": {
62
+ "1": {
63
+ "name": "punctuation.definition.comment.rel"
64
+ },
65
+ "2": {
66
+ "name": "storage.type.internaldeclaration.rel"
67
+ },
68
+ "3": {
69
+ "name": "punctuation.decorator.internaldeclaration.rel"
70
+ }
71
+ },
72
+ "end": "\\*/",
73
+ "endCaptures": {
74
+ "0": {
75
+ "name": "punctuation.definition.comment.rel"
76
+ }
77
+ },
78
+ "name": "comment.block.rel"
79
+ },
80
+ {
81
+ "begin": "doc\"\"\"",
82
+ "end": "\"\"\"",
83
+ "name": "comment.block.documentation.rel"
84
+ },
85
+ {
86
+ "begin": "(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)",
87
+ "beginCaptures": {
88
+ "1": {
89
+ "name": "punctuation.whitespace.comment.leading.rel"
90
+ },
91
+ "2": {
92
+ "name": "comment.line.double-slash.rel"
93
+ },
94
+ "3": {
95
+ "name": "punctuation.definition.comment.rel"
96
+ },
97
+ "4": {
98
+ "name": "storage.type.internaldeclaration.rel"
99
+ },
100
+ "5": {
101
+ "name": "punctuation.decorator.internaldeclaration.rel"
102
+ }
103
+ },
104
+ "contentName": "comment.line.double-slash.rel",
105
+ "end": "(?=$)"
106
+ }
107
+ ]
108
+ },
109
+ "constants": {
110
+ "patterns": [
111
+ {
112
+ "match": "(\\b(true|false)\\b)",
113
+ "name": "constant.language.rel"
114
+ }
115
+ ]
116
+ },
117
+ "deprecated-temporary": {
118
+ "patterns": [
119
+ {
120
+ "match": "@inspect",
121
+ "name": "keyword.other.rel"
122
+ }
123
+ ]
124
+ },
125
+ "keywords": {
126
+ "patterns": [
127
+ {
128
+ "match": "(\\b(def|entity|bound|include|ic|forall|exists|∀|∃|return|module|^end)\\b)|(((\\<)?\\|(\\>)?)|∀|∃)",
129
+ "name": "keyword.control.rel"
130
+ }
131
+ ]
132
+ },
133
+ "operators": {
134
+ "patterns": [
135
+ {
136
+ "match": "(\\b(if|then|else|and|or|not|eq|neq|lt|lt_eq|gt|gt_eq)\\b)|(\\+|\\-|\\*|\\/|÷|\\^|\\%|\\=|\\!\\=|≠|\\<|\\<\\=|≤|\\>|\\>\\=|≥|\\&)|\\s+(end)",
137
+ "name": "keyword.other.rel"
138
+ }
139
+ ]
140
+ },
141
+ "otherkeywords": {
142
+ "patterns": [
143
+ {
144
+ "match": "\\s*(@inline)\\s*|\\s*(@auto_number)\\s*|\\s*(function)\\s|(\\b(implies|select|from|∈|where|for|in)\\b)|(((\\<)?\\|(\\>)?)|∈)",
145
+ "name": "keyword.other.rel"
146
+ }
147
+ ]
148
+ },
149
+ "single-line-comment-consuming-line-ending": {
150
+ "begin": "(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)",
151
+ "beginCaptures": {
152
+ "1": {
153
+ "name": "punctuation.whitespace.comment.leading.rel"
154
+ },
155
+ "2": {
156
+ "name": "comment.line.double-slash.rel"
157
+ },
158
+ "3": {
159
+ "name": "punctuation.definition.comment.rel"
160
+ },
161
+ "4": {
162
+ "name": "storage.type.internaldeclaration.rel"
163
+ },
164
+ "5": {
165
+ "name": "punctuation.decorator.internaldeclaration.rel"
166
+ }
167
+ },
168
+ "contentName": "comment.line.double-slash.rel",
169
+ "end": "(?=^)"
170
+ },
171
+ "strings": {
172
+ "begin": "\"",
173
+ "end": "\"",
174
+ "name": "string.quoted.double.rel",
175
+ "patterns": [
176
+ {
177
+ "match": "\\\\.",
178
+ "name": "constant.character.escape.rel"
179
+ }
180
+ ]
181
+ },
182
+ "symbols": {
183
+ "patterns": [
184
+ {
185
+ "match": "(:[\\[_$[:alpha:]](\\]|[_$[:alnum:]]*))",
186
+ "name": "variable.parameter.rel"
187
+ }
188
+ ]
189
+ },
190
+ "types": {
191
+ "patterns": [
192
+ {
193
+ "match": "(\\b(Symbol|Char|Bool|Rational|FixedDecimal|Float16|Float32|Float64|Int8|Int16|Int32|Int64|Int128|UInt8|UInt16|UInt32|UInt64|UInt128|Date|DateTime|Day|Week|Month|Year|Nanosecond|Microsecond|Millisecond|Second|Minute|Hour|FilePos|HashValue|AutoNumberValue)\\b)",
194
+ "name": "entity.name.type.rel"
195
+ }
196
+ ]
197
+ }
198
+ },
199
+ "scopeName": "source.rel"
200
+ }
@@ -0,0 +1,298 @@
1
+ {
2
+ "displayName": "RISC-V",
3
+ "fileTypes": [
4
+ "S",
5
+ "s",
6
+ "riscv",
7
+ "asm"
8
+ ],
9
+ "name": "riscv",
10
+ "patterns": [
11
+ {
12
+ "comment": "ok actually this are instructions, but one also could call them funtions…",
13
+ "match": "\\b(la|lb|lh|lw|ld|nop|li|mv|not|neg|negw|sext\\.w|seqz|snez|sltz|sgtz|beqz|bnez|blez|bgez|bltz|bgtz|bgt|ble|bgtu|bleu|j|jal|jr|ret|call|tail|fence|csr[r|w|s|c]|csr[w|s|c]i)\\b",
14
+ "name": "support.function.pseudo.riscv"
15
+ },
16
+ {
17
+ "match": "\\b(add|addw|auipc|lui|jalr|beq|bne|blt|bge|bltu|bgeu|lb|lh|lw|ld|lbu|lhu|sb|sh|sw|sd|addi|addiw|slti|sltiu|xori|ori|andi|slli|slliw|srli|srliw|srai|sraiw|sub|subw|sll|sllw|slt|sltu|xor|srl|srlw|sra|sraw|or|and|fence|fence\\.i|csrrw|csrrs|csrrc|csrrwi|csrrsi|csrrci)\\b",
18
+ "name": "support.function.riscv"
19
+ },
20
+ {
21
+ "comment": "priviledged instructions",
22
+ "match": "\\b(ecall|ebreak|sfence\\.vma|mret|sret|uret|wfi)\\b",
23
+ "name": "support.function.riscv.privileged"
24
+ },
25
+ {
26
+ "comment": "M extension (multiplication and division)",
27
+ "match": "\\b(mul|mulh|mulhsu|mulhu|div|divu|rem|remu|mulw|divw|divuw|remw|remuw)\\b",
28
+ "name": "support.function.riscv.m"
29
+ },
30
+ {
31
+ "comment": "C extension (compressed instructions)",
32
+ "match": "\\b(c\\.addi4spn|c\\.fld|c\\.lq|c\\.lw|c\\.flw|c\\.ld|c\\.fsd|c\\.sq|c\\.sw|c\\.fsw|c\\.sd|c\\.nop|c\\.addi|c\\.jal|c\\.addiw|c\\.li|c\\.addi16sp|c\\.lui|c\\.srli|c\\.srli64|c\\.srai|c\\.srai64|c\\.andi|c\\.sub|c\\.xor|c\\.or|c\\.and|c\\.subw|c\\.addw|c\\.j|c\\.beqz|c\\.bnez)\\b",
33
+ "name": "support.function.riscv.c"
34
+ },
35
+ {
36
+ "comment": "A extension (atomic instructions)",
37
+ "match": "\\b(lr\\.[w|d]|sc\\.[w|d]|amoswap\\.[w|d]|amoadd\\.[w|d]|amoxor\\.[w|d]|amoand\\.[w|d]|amoor\\.[w|d]|amomin\\.[w|d]|amomax\\.[w|d]|amominu\\.[w|d]|amomaxu\\.[w|d])\\b",
38
+ "name": "support.function.riscv.a"
39
+ },
40
+ {
41
+ "comment": "F extension (single precision floating point)",
42
+ "match": "\\b(flw|fsw|fmadd\\.s|fmsub\\.s|fnmsub\\.s|fnmadd\\.s|fadd\\.s|fsub\\.s|fmul\\.s|fdiv\\.s|fsqrt\\.s|fsgnj\\.s|fsgnjn\\.s|fsgnjx\\.s|fmin\\.s|fmax\\.s|fcvt\\.w\\.s|fcvt\\.wu\\.s|fmv\\.x\\.w|feq\\.s|flt\\.s|fle\\.s|fclass\\.s|fcvt\\.s\\.w|fcvt\\.s\\.wu|fmv\\.w\\.x|fcvt\\.l\\.s|fcvt\\.lu\\.s|fcvt\\.s\\.l|fcvt\\.s\\.lu)\\b",
43
+ "name": "support.function.riscv.f"
44
+ },
45
+ {
46
+ "comment": "D extension (double precision floating point)",
47
+ "match": "\\b(fld|fsd|fmadd\\.d|fmsub\\.d|fnmsub\\.d|fnmadd\\.d|fadd\\.d|fsub\\.d|fmul\\.d|fdiv\\.d|fsqrt\\.d|fsgnj\\.d|fsgnjn\\.d|fsgnjx\\.d|fmin\\.d|fmax\\.d|fcvt\\.s\\.d|fcvt\\.d\\.s|feq\\.d|flt\\.d|fle\\.d|fclass\\.d|fcvt\\.w\\.d|fcvt\\.wu\\.d|fcvt\\.d\\.w|fcvt\\.d\\.wu|fcvt\\.l\\.d|fcvt\\.lu\\.d|fmv\\.x\\.d|fcvt\\.d\\.l|fcvt\\.d\\.lu|fmv\\.d\\.x)\\b",
48
+ "name": "support.function.riscv.d"
49
+ },
50
+ {
51
+ "match": "\\.(skip|ascii|asciiz|byte|[2|4|8]byte|data|double|float|half|kdata|ktext|space|text|word|dword|dtprelword|dtpreldword|set\\s*(noat|at)|[s|u]leb128|string|incbin|zero|rodata|comm|common)\\b",
52
+ "name": "storage.type.riscv"
53
+ },
54
+ {
55
+ "match": "\\.(balign|align|p2align|extern|globl|global|local|pushsection|section|bss|insn|option|type|equ|macro|endm|file|ident)\\b",
56
+ "name": "storage.modifier.riscv"
57
+ },
58
+ {
59
+ "captures": {
60
+ "1": {
61
+ "name": "entity.name.function.label.riscv"
62
+ }
63
+ },
64
+ "match": "\\b([A-Za-z0-9_]+):",
65
+ "name": "meta.function.label.riscv"
66
+ },
67
+ {
68
+ "captures": {
69
+ "1": {
70
+ "name": "punctuation.definition.variable.riscv"
71
+ }
72
+ },
73
+ "match": "\\b(x([0-9]|1[0-9]|2[0-9]|3[0-1]))\\b",
74
+ "name": "variable.other.register.usable.by-number.riscv"
75
+ },
76
+ {
77
+ "captures": {
78
+ "1": {
79
+ "name": "punctuation.definition.variable.riscv"
80
+ }
81
+ },
82
+ "match": "\\b(zero|ra|sp|gp|tp|t[0-6]|a[0-7]|s[0-9]|fp|s1[0-1])\\b",
83
+ "name": "variable.other.register.usable.by-name.riscv"
84
+ },
85
+ {
86
+ "captures": {
87
+ "1": {
88
+ "name": "punctuation.definition.variable.riscv"
89
+ }
90
+ },
91
+ "match": "\\b(([umsh]|vs)status|([umsh]|vs)ie|([ums]|vs)tvec|([ums]|vs)scratch|([ums]|vs)epc|([ums]|vs)cause|([umsh]|vs)tval|([umsh]|vs)ip|fflags|frm|fcsr|m?cycleh?|timeh?|m?instreth?|m?hpmcounter([3-9]|[12][0-9]|3[01])h?|[msh][ei]deleg|[msh]counteren|v?satp|hgeie|hgeip|[hm]tinst|hvip|hgatp|htimedeltah?|mvendorid|marchid|mimpid|mhartid|misa|mstatush|mtval2|pmpcfg[0-3]|pmpaddr([0-9]|1[0-5])|mcountinhibit|mhpmevent([3-9]|[12][0-9]|3[01])|tselect|tdata[1-3]|dcsr|dpc|dscratch[0-1])\\b",
92
+ "name": "variable.other.csr.names.riscv"
93
+ },
94
+ {
95
+ "captures": {
96
+ "1": {
97
+ "name": "punctuation.definition.variable.riscv"
98
+ }
99
+ },
100
+ "match": "\\bf([0-9]|1[0-9]|2[0-9]|3[0-1])\\b",
101
+ "name": "variable.other.register.usable.floating-point.riscv"
102
+ },
103
+ {
104
+ "match": "\\b\\d+\\.\\d+\\b",
105
+ "name": "constant.numeric.float.riscv"
106
+ },
107
+ {
108
+ "match": "\\b(\\d+|0(x|X)[a-fA-F0-9]+)\\b",
109
+ "name": "constant.numeric.integer.riscv"
110
+ },
111
+ {
112
+ "begin": "\"",
113
+ "beginCaptures": {
114
+ "0": {
115
+ "name": "punctuation.definition.string.begin.riscv"
116
+ }
117
+ },
118
+ "end": "\"",
119
+ "endCaptures": {
120
+ "0": {
121
+ "name": "punctuation.definition.string.end.riscv"
122
+ }
123
+ },
124
+ "name": "string.quoted.double.riscv",
125
+ "patterns": [
126
+ {
127
+ "match": "\\\\[rnt\\\\\"]",
128
+ "name": "constant.character.escape.riscv"
129
+ }
130
+ ]
131
+ },
132
+ {
133
+ "begin": "'",
134
+ "beginCaptures": {
135
+ "0": {
136
+ "name": "punctuation.definition.string.begin.riscv"
137
+ }
138
+ },
139
+ "end": "'",
140
+ "endCaptures": {
141
+ "0": {
142
+ "name": "punctuation.definition.string.end.riscv"
143
+ }
144
+ },
145
+ "name": "string.quoted.single.riscv",
146
+ "patterns": [
147
+ {
148
+ "match": "\\\\[rnt\\\\\"]",
149
+ "name": "constant.character.escape.riscv"
150
+ }
151
+ ]
152
+ },
153
+ {
154
+ "begin": "\\/\\*",
155
+ "end": "\\*\\/",
156
+ "name": "comment.block"
157
+ },
158
+ {
159
+ "begin": "\\/\\/",
160
+ "end": "\\n",
161
+ "name": "comment.line.double-slash"
162
+ },
163
+ {
164
+ "begin": "(?x)\n ^\\s*\\#\\s*(define)\\s+ # define\n ((?<id>[a-zA-Z_][a-zA-Z0-9_]*)) # macro name\n (?: # and optionally:\n (\\() # an open parenthesis\n (\n \\s* \\g<id> \\s* # first argument\n ((,) \\s* \\g<id> \\s*)* # additional arguments\n (?:\\.\\.\\.)? # varargs ellipsis?\n )\n (\\)) # a close parenthesis\n )?\n ",
165
+ "beginCaptures": {
166
+ "1": {
167
+ "name": "keyword.control.import.define.c"
168
+ },
169
+ "2": {
170
+ "name": "entity.name.function.preprocessor.c"
171
+ },
172
+ "4": {
173
+ "name": "punctuation.definition.parameters.c"
174
+ },
175
+ "5": {
176
+ "name": "variable.parameter.preprocessor.c"
177
+ },
178
+ "7": {
179
+ "name": "punctuation.separator.parameters.c"
180
+ },
181
+ "8": {
182
+ "name": "punctuation.definition.parameters.c"
183
+ }
184
+ },
185
+ "end": "(?=(?://|/\\*))|$",
186
+ "name": "meta.preprocessor.macro.c",
187
+ "patterns": [
188
+ {
189
+ "match": "(?>\\\\\\s*\\n)",
190
+ "name": "punctuation.separator.continuation.c"
191
+ },
192
+ {
193
+ "include": "$base"
194
+ }
195
+ ]
196
+ },
197
+ {
198
+ "begin": "^\\s*#\\s*(error|warning)\\b",
199
+ "captures": {
200
+ "1": {
201
+ "name": "keyword.control.import.error.c"
202
+ }
203
+ },
204
+ "end": "$",
205
+ "name": "meta.preprocessor.diagnostic.c",
206
+ "patterns": [
207
+ {
208
+ "match": "(?>\\\\\\s*\\n)",
209
+ "name": "punctuation.separator.continuation.c"
210
+ }
211
+ ]
212
+ },
213
+ {
214
+ "begin": "^\\s*#\\s*(include|import)\\b\\s+",
215
+ "captures": {
216
+ "1": {
217
+ "name": "keyword.control.import.include.c"
218
+ }
219
+ },
220
+ "end": "(?=(?://|/\\*))|$",
221
+ "name": "meta.preprocessor.c.include",
222
+ "patterns": [
223
+ {
224
+ "match": "(?>\\\\\\s*\\n)",
225
+ "name": "punctuation.separator.continuation.c"
226
+ },
227
+ {
228
+ "begin": "\"",
229
+ "beginCaptures": {
230
+ "0": {
231
+ "name": "punctuation.definition.string.begin.c"
232
+ }
233
+ },
234
+ "end": "\"",
235
+ "endCaptures": {
236
+ "0": {
237
+ "name": "punctuation.definition.string.end.c"
238
+ }
239
+ },
240
+ "name": "string.quoted.double.include.c"
241
+ },
242
+ {
243
+ "begin": "<",
244
+ "beginCaptures": {
245
+ "0": {
246
+ "name": "punctuation.definition.string.begin.c"
247
+ }
248
+ },
249
+ "end": ">",
250
+ "endCaptures": {
251
+ "0": {
252
+ "name": "punctuation.definition.string.end.c"
253
+ }
254
+ },
255
+ "name": "string.quoted.other.lt-gt.include.c"
256
+ }
257
+ ]
258
+ },
259
+ {
260
+ "begin": "^\\s*#\\s*(define|defined|elif|else|if|ifdef|ifndef|line|pragma|undef|endif)\\b",
261
+ "captures": {
262
+ "1": {
263
+ "name": "keyword.control.import.c"
264
+ }
265
+ },
266
+ "end": "(?=(?://|/\\*))|$",
267
+ "name": "meta.preprocessor.c",
268
+ "patterns": [
269
+ {
270
+ "match": "(?>\\\\\\s*\\n)",
271
+ "name": "punctuation.separator.continuation.c"
272
+ }
273
+ ]
274
+ },
275
+ {
276
+ "begin": "(^[ \\t]+)?(?=#)",
277
+ "beginCaptures": {
278
+ "1": {
279
+ "name": "punctuation.whitespace.comment.leading.riscv"
280
+ }
281
+ },
282
+ "end": "(?!\\G)",
283
+ "patterns": [
284
+ {
285
+ "begin": "#|(\\/\\/)",
286
+ "beginCaptures": {
287
+ "0": {
288
+ "name": "punctuation.definition.comment.riscv"
289
+ }
290
+ },
291
+ "end": "\\n",
292
+ "name": "comment.line.number-sign.riscv"
293
+ }
294
+ ]
295
+ }
296
+ ],
297
+ "scopeName": "source.riscv"
298
+ }