@codingame/monaco-vscode-standalone-languages 23.2.0 → 23.2.2

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 (165) hide show
  1. package/_.contribution.js +48 -0
  2. package/abap/abap.contribution.js +8 -0
  3. package/abap/abap.js +1397 -0
  4. package/apex/apex.contribution.js +9 -0
  5. package/apex/apex.js +329 -0
  6. package/azcli/azcli.contribution.js +8 -0
  7. package/azcli/azcli.js +67 -0
  8. package/bat/bat.contribution.js +8 -0
  9. package/bat/bat.js +99 -0
  10. package/bicep/bicep.contribution.js +8 -0
  11. package/bicep/bicep.js +108 -0
  12. package/cameligo/cameligo.contribution.js +8 -0
  13. package/cameligo/cameligo.js +173 -0
  14. package/clojure/clojure.contribution.js +8 -0
  15. package/clojure/clojure.js +760 -0
  16. package/coffee/coffee.contribution.js +9 -0
  17. package/coffee/coffee.js +231 -0
  18. package/cpp/cpp.contribution.js +14 -0
  19. package/cpp/cpp.js +388 -0
  20. package/csharp/csharp.contribution.js +8 -0
  21. package/csharp/csharp.js +325 -0
  22. package/csp/csp.contribution.js +8 -0
  23. package/csp/csp.js +52 -0
  24. package/css/css.contribution.js +9 -0
  25. package/css/css.js +184 -0
  26. package/cypher/cypher.contribution.js +8 -0
  27. package/cypher/cypher.js +262 -0
  28. package/dart/dart.contribution.js +9 -0
  29. package/dart/dart.js +280 -0
  30. package/dockerfile/dockerfile.contribution.js +9 -0
  31. package/dockerfile/dockerfile.js +129 -0
  32. package/ecl/ecl.contribution.js +8 -0
  33. package/ecl/ecl.js +455 -0
  34. package/elixir/elixir.contribution.js +8 -0
  35. package/elixir/elixir.js +568 -0
  36. package/flow9/flow9.contribution.js +8 -0
  37. package/flow9/flow9.js +141 -0
  38. package/freemarker2/freemarker2.contribution.js +52 -0
  39. package/freemarker2/freemarker2.js +990 -0
  40. package/fsharp/fsharp.contribution.js +8 -0
  41. package/fsharp/fsharp.js +216 -0
  42. package/go/go.contribution.js +8 -0
  43. package/go/go.js +217 -0
  44. package/graphql/graphql.contribution.js +9 -0
  45. package/graphql/graphql.js +150 -0
  46. package/handlebars/handlebars.contribution.js +9 -0
  47. package/handlebars/handlebars.js +413 -0
  48. package/hcl/hcl.contribution.js +8 -0
  49. package/hcl/hcl.js +182 -0
  50. package/html/html.contribution.js +9 -0
  51. package/html/html.js +302 -0
  52. package/index.js +81 -48
  53. package/ini/ini.contribution.js +9 -0
  54. package/ini/ini.js +70 -0
  55. package/java/java.contribution.js +9 -0
  56. package/java/java.js +231 -0
  57. package/javascript/javascript.contribution.js +11 -0
  58. package/javascript/javascript.js +70 -0
  59. package/julia/julia.contribution.js +8 -0
  60. package/julia/julia.js +510 -0
  61. package/kotlin/kotlin.contribution.js +9 -0
  62. package/kotlin/kotlin.js +251 -0
  63. package/less/less.contribution.js +9 -0
  64. package/less/less.js +160 -0
  65. package/lexon/lexon.contribution.js +8 -0
  66. package/lexon/lexon.js +156 -0
  67. package/liquid/liquid.contribution.js +9 -0
  68. package/liquid/liquid.js +234 -0
  69. package/lua/lua.contribution.js +8 -0
  70. package/lua/lua.js +161 -0
  71. package/m3/m3.contribution.js +8 -0
  72. package/m3/m3.js +209 -0
  73. package/markdown/markdown.contribution.js +8 -0
  74. package/markdown/markdown.js +228 -0
  75. package/mdx/mdx.contribution.js +8 -0
  76. package/mdx/mdx.js +158 -0
  77. package/mips/mips.contribution.js +9 -0
  78. package/mips/mips.js +197 -0
  79. package/msdax/msdax.contribution.js +8 -0
  80. package/msdax/msdax.js +374 -0
  81. package/mysql/mysql.contribution.js +8 -0
  82. package/mysql/mysql.js +877 -0
  83. package/objective-c/objective-c.contribution.js +8 -0
  84. package/objective-c/objective-c.js +182 -0
  85. package/package.json +2 -2
  86. package/pascal/pascal.contribution.js +9 -0
  87. package/pascal/pascal.js +250 -0
  88. package/pascaligo/pascaligo.contribution.js +8 -0
  89. package/pascaligo/pascaligo.js +163 -0
  90. package/perl/perl.contribution.js +8 -0
  91. package/perl/perl.js +625 -0
  92. package/pgsql/pgsql.contribution.js +8 -0
  93. package/pgsql/pgsql.js +850 -0
  94. package/php/php.contribution.js +9 -0
  95. package/php/php.js +499 -0
  96. package/pla/pla.contribution.js +7 -0
  97. package/pla/pla.js +136 -0
  98. package/postiats/postiats.contribution.js +8 -0
  99. package/postiats/postiats.js +906 -0
  100. package/powerquery/powerquery.contribution.js +8 -0
  101. package/powerquery/powerquery.js +889 -0
  102. package/powershell/powershell.contribution.js +8 -0
  103. package/powershell/powershell.js +238 -0
  104. package/protobuf/protobuf.contribution.js +8 -0
  105. package/protobuf/protobuf.js +419 -0
  106. package/pug/pug.contribution.js +8 -0
  107. package/pug/pug.js +401 -0
  108. package/python/python.contribution.js +9 -0
  109. package/python/python.js +294 -0
  110. package/qsharp/qsharp.contribution.js +8 -0
  111. package/qsharp/qsharp.js +300 -0
  112. package/r/r.contribution.js +8 -0
  113. package/r/r.js +242 -0
  114. package/razor/razor.contribution.js +9 -0
  115. package/razor/razor.js +544 -0
  116. package/redis/redis.contribution.js +8 -0
  117. package/redis/redis.js +301 -0
  118. package/redshift/redshift.contribution.js +8 -0
  119. package/redshift/redshift.js +808 -0
  120. package/restructuredtext/restructuredtext.contribution.js +8 -0
  121. package/restructuredtext/restructuredtext.js +173 -0
  122. package/ruby/ruby.contribution.js +9 -0
  123. package/ruby/ruby.js +510 -0
  124. package/rust/rust.contribution.js +8 -0
  125. package/rust/rust.js +342 -0
  126. package/sb/sb.contribution.js +8 -0
  127. package/sb/sb.js +114 -0
  128. package/scala/scala.contribution.js +9 -0
  129. package/scala/scala.js +369 -0
  130. package/scheme/scheme.contribution.js +8 -0
  131. package/scheme/scheme.js +107 -0
  132. package/scss/scss.contribution.js +9 -0
  133. package/scss/scss.js +259 -0
  134. package/shell/shell.contribution.js +8 -0
  135. package/shell/shell.js +220 -0
  136. package/solidity/solidity.contribution.js +8 -0
  137. package/solidity/solidity.js +1366 -0
  138. package/sophia/sophia.contribution.js +8 -0
  139. package/sophia/sophia.js +198 -0
  140. package/sparql/sparql.contribution.js +8 -0
  141. package/sparql/sparql.js +200 -0
  142. package/sql/sql.contribution.js +8 -0
  143. package/sql/sql.js +852 -0
  144. package/st/st.contribution.js +8 -0
  145. package/st/st.js +415 -0
  146. package/swift/swift.contribution.js +9 -0
  147. package/swift/swift.js +311 -0
  148. package/systemverilog/systemverilog.contribution.js +14 -0
  149. package/systemverilog/systemverilog.js +575 -0
  150. package/tcl/tcl.contribution.js +8 -0
  151. package/tcl/tcl.js +231 -0
  152. package/twig/twig.contribution.js +9 -0
  153. package/twig/twig.js +391 -0
  154. package/typescript/typescript.contribution.js +11 -0
  155. package/typescript/typescript.js +336 -0
  156. package/typespec/typespec.contribution.js +8 -0
  157. package/typespec/typespec.js +126 -0
  158. package/vb/vb.contribution.js +8 -0
  159. package/vb/vb.js +371 -0
  160. package/wgsl/wgsl.contribution.js +8 -0
  161. package/wgsl/wgsl.js +452 -0
  162. package/xml/xml.contribution.js +28 -0
  163. package/xml/xml.js +88 -0
  164. package/yaml/yaml.contribution.js +9 -0
  165. package/yaml/yaml.js +199 -0
@@ -0,0 +1,9 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "apex",
5
+ extensions: [".cls"],
6
+ aliases: ["Apex", "apex"],
7
+ mimetypes: ["text/x-apex-source", "text/x-apex"],
8
+ loader: () => import('./apex.js')
9
+ });
package/apex/apex.js ADDED
@@ -0,0 +1,329 @@
1
+ const conf = {
2
+ // the default separators except `@$`
3
+ wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
4
+ comments: {
5
+ lineComment: "//",
6
+ blockComment: ["/*", "*/"]
7
+ },
8
+ brackets: [
9
+ ["{", "}"],
10
+ ["[", "]"],
11
+ ["(", ")"]
12
+ ],
13
+ autoClosingPairs: [
14
+ { open: "{", close: "}" },
15
+ { open: "[", close: "]" },
16
+ { open: "(", close: ")" },
17
+ { open: '"', close: '"' },
18
+ { open: "'", close: "'" }
19
+ ],
20
+ surroundingPairs: [
21
+ { open: "{", close: "}" },
22
+ { open: "[", close: "]" },
23
+ { open: "(", close: ")" },
24
+ { open: '"', close: '"' },
25
+ { open: "'", close: "'" },
26
+ { open: "<", close: ">" }
27
+ ],
28
+ folding: {
29
+ markers: {
30
+ start: new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),
31
+ end: new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")
32
+ }
33
+ }
34
+ };
35
+ const keywords = [
36
+ "abstract",
37
+ "activate",
38
+ "and",
39
+ "any",
40
+ "array",
41
+ "as",
42
+ "asc",
43
+ "assert",
44
+ "autonomous",
45
+ "begin",
46
+ "bigdecimal",
47
+ "blob",
48
+ "boolean",
49
+ "break",
50
+ "bulk",
51
+ "by",
52
+ "case",
53
+ "cast",
54
+ "catch",
55
+ "char",
56
+ "class",
57
+ "collect",
58
+ "commit",
59
+ "const",
60
+ "continue",
61
+ "convertcurrency",
62
+ "decimal",
63
+ "default",
64
+ "delete",
65
+ "desc",
66
+ "do",
67
+ "double",
68
+ "else",
69
+ "end",
70
+ "enum",
71
+ "exception",
72
+ "exit",
73
+ "export",
74
+ "extends",
75
+ "false",
76
+ "final",
77
+ "finally",
78
+ "float",
79
+ "for",
80
+ "from",
81
+ "future",
82
+ "get",
83
+ "global",
84
+ "goto",
85
+ "group",
86
+ "having",
87
+ "hint",
88
+ "if",
89
+ "implements",
90
+ "import",
91
+ "in",
92
+ "inner",
93
+ "insert",
94
+ "instanceof",
95
+ "int",
96
+ "interface",
97
+ "into",
98
+ "join",
99
+ "last_90_days",
100
+ "last_month",
101
+ "last_n_days",
102
+ "last_week",
103
+ "like",
104
+ "limit",
105
+ "list",
106
+ "long",
107
+ "loop",
108
+ "map",
109
+ "merge",
110
+ "native",
111
+ "new",
112
+ "next_90_days",
113
+ "next_month",
114
+ "next_n_days",
115
+ "next_week",
116
+ "not",
117
+ "null",
118
+ "nulls",
119
+ "number",
120
+ "object",
121
+ "of",
122
+ "on",
123
+ "or",
124
+ "outer",
125
+ "override",
126
+ "package",
127
+ "parallel",
128
+ "pragma",
129
+ "private",
130
+ "protected",
131
+ "public",
132
+ "retrieve",
133
+ "return",
134
+ "returning",
135
+ "rollback",
136
+ "savepoint",
137
+ "search",
138
+ "select",
139
+ "set",
140
+ "short",
141
+ "sort",
142
+ "stat",
143
+ "static",
144
+ "strictfp",
145
+ "super",
146
+ "switch",
147
+ "synchronized",
148
+ "system",
149
+ "testmethod",
150
+ "then",
151
+ "this",
152
+ "this_month",
153
+ "this_week",
154
+ "throw",
155
+ "throws",
156
+ "today",
157
+ "tolabel",
158
+ "tomorrow",
159
+ "transaction",
160
+ "transient",
161
+ "trigger",
162
+ "true",
163
+ "try",
164
+ "type",
165
+ "undelete",
166
+ "update",
167
+ "upsert",
168
+ "using",
169
+ "virtual",
170
+ "void",
171
+ "volatile",
172
+ "webservice",
173
+ "when",
174
+ "where",
175
+ "while",
176
+ "yesterday"
177
+ ];
178
+ const uppercaseFirstLetter = (lowercase) => lowercase.charAt(0).toUpperCase() + lowercase.substr(1);
179
+ let keywordsWithCaseVariations = [];
180
+ keywords.forEach((lowercase) => {
181
+ keywordsWithCaseVariations.push(lowercase);
182
+ keywordsWithCaseVariations.push(lowercase.toUpperCase());
183
+ keywordsWithCaseVariations.push(uppercaseFirstLetter(lowercase));
184
+ });
185
+ const language = {
186
+ defaultToken: "",
187
+ tokenPostfix: ".apex",
188
+ keywords: keywordsWithCaseVariations,
189
+ operators: [
190
+ "=",
191
+ ">",
192
+ "<",
193
+ "!",
194
+ "~",
195
+ "?",
196
+ ":",
197
+ "==",
198
+ "<=",
199
+ ">=",
200
+ "!=",
201
+ "&&",
202
+ "||",
203
+ "++",
204
+ "--",
205
+ "+",
206
+ "-",
207
+ "*",
208
+ "/",
209
+ "&",
210
+ "|",
211
+ "^",
212
+ "%",
213
+ "<<",
214
+ ">>",
215
+ ">>>",
216
+ "+=",
217
+ "-=",
218
+ "*=",
219
+ "/=",
220
+ "&=",
221
+ "|=",
222
+ "^=",
223
+ "%=",
224
+ "<<=",
225
+ ">>=",
226
+ ">>>="
227
+ ],
228
+ // we include these common regular expressions
229
+ symbols: /[=><!~?:&|+\-*\/\^%]+/,
230
+ escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
231
+ digits: /\d+(_+\d+)*/,
232
+ octaldigits: /[0-7]+(_+[0-7]+)*/,
233
+ binarydigits: /[0-1]+(_+[0-1]+)*/,
234
+ hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,
235
+ // The main tokenizer for our languages
236
+ tokenizer: {
237
+ root: [
238
+ // identifiers and keywords
239
+ [
240
+ /[a-z_$][\w$]*/,
241
+ {
242
+ cases: {
243
+ "@keywords": { token: "keyword.$0" },
244
+ "@default": "identifier"
245
+ }
246
+ }
247
+ ],
248
+ // assume that identifiers starting with an uppercase letter are types
249
+ [
250
+ /[A-Z][\w\$]*/,
251
+ {
252
+ cases: {
253
+ "@keywords": { token: "keyword.$0" },
254
+ "@default": "type.identifier"
255
+ }
256
+ }
257
+ ],
258
+ // whitespace
259
+ { include: "@whitespace" },
260
+ // delimiters and operators
261
+ [/[{}()\[\]]/, "@brackets"],
262
+ [/[<>](?!@symbols)/, "@brackets"],
263
+ [
264
+ /@symbols/,
265
+ {
266
+ cases: {
267
+ "@operators": "delimiter",
268
+ "@default": ""
269
+ }
270
+ }
271
+ ],
272
+ // @ annotations.
273
+ [/@\s*[a-zA-Z_\$][\w\$]*/, "annotation"],
274
+ // numbers
275
+ [/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, "number.float"],
276
+ [/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, "number.float"],
277
+ [/(@digits)[fFdD]/, "number.float"],
278
+ [/(@digits)[lL]?/, "number"],
279
+ // delimiter: after number because of .\d floats
280
+ [/[;,.]/, "delimiter"],
281
+ // strings
282
+ [/"([^"\\]|\\.)*$/, "string.invalid"],
283
+ // non-teminated string
284
+ [/'([^'\\]|\\.)*$/, "string.invalid"],
285
+ // non-teminated string
286
+ [/"/, "string", '@string."'],
287
+ [/'/, "string", "@string.'"],
288
+ // characters
289
+ [/'[^\\']'/, "string"],
290
+ [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
291
+ [/'/, "string.invalid"]
292
+ ],
293
+ whitespace: [
294
+ [/[ \t\r\n]+/, ""],
295
+ [/\/\*\*(?!\/)/, "comment.doc", "@apexdoc"],
296
+ [/\/\*/, "comment", "@comment"],
297
+ [/\/\/.*$/, "comment"]
298
+ ],
299
+ comment: [
300
+ [/[^\/*]+/, "comment"],
301
+ // [/\/\*/, 'comment', '@push' ], // nested comment not allowed :-(
302
+ // [/\/\*/, 'comment.invalid' ], // this breaks block comments in the shape of /* //*/
303
+ [/\*\//, "comment", "@pop"],
304
+ [/[\/*]/, "comment"]
305
+ ],
306
+ //Identical copy of comment above, except for the addition of .doc
307
+ apexdoc: [
308
+ [/[^\/*]+/, "comment.doc"],
309
+ [/\*\//, "comment.doc", "@pop"],
310
+ [/[\/*]/, "comment.doc"]
311
+ ],
312
+ string: [
313
+ [/[^\\"']+/, "string"],
314
+ [/@escapes/, "string.escape"],
315
+ [/\\./, "string.escape.invalid"],
316
+ [
317
+ /["']/,
318
+ {
319
+ cases: {
320
+ "$#==$S2": { token: "string", next: "@pop" },
321
+ "@default": "string"
322
+ }
323
+ }
324
+ ]
325
+ ]
326
+ }
327
+ };
328
+
329
+ export { conf, language };
@@ -0,0 +1,8 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "azcli",
5
+ extensions: [".azcli"],
6
+ aliases: ["Azure CLI", "azcli"],
7
+ loader: () => import('./azcli.js')
8
+ });
package/azcli/azcli.js ADDED
@@ -0,0 +1,67 @@
1
+ const conf = {
2
+ comments: {
3
+ lineComment: "#"
4
+ }
5
+ };
6
+ const language = {
7
+ defaultToken: "keyword",
8
+ ignoreCase: true,
9
+ tokenPostfix: ".azcli",
10
+ str: /[^#\s]/,
11
+ tokenizer: {
12
+ root: [
13
+ { include: "@comment" },
14
+ [
15
+ /\s-+@str*\s*/,
16
+ {
17
+ cases: {
18
+ "@eos": { token: "key.identifier", next: "@popall" },
19
+ "@default": { token: "key.identifier", next: "@type" }
20
+ }
21
+ }
22
+ ],
23
+ [
24
+ /^-+@str*\s*/,
25
+ {
26
+ cases: {
27
+ "@eos": { token: "key.identifier", next: "@popall" },
28
+ "@default": { token: "key.identifier", next: "@type" }
29
+ }
30
+ }
31
+ ]
32
+ ],
33
+ type: [
34
+ { include: "@comment" },
35
+ [
36
+ /-+@str*\s*/,
37
+ {
38
+ cases: {
39
+ "@eos": { token: "key.identifier", next: "@popall" },
40
+ "@default": "key.identifier"
41
+ }
42
+ }
43
+ ],
44
+ [
45
+ /@str+\s*/,
46
+ {
47
+ cases: {
48
+ "@eos": { token: "string", next: "@popall" },
49
+ "@default": "string"
50
+ }
51
+ }
52
+ ]
53
+ ],
54
+ comment: [
55
+ [
56
+ /#.*$/,
57
+ {
58
+ cases: {
59
+ "@eos": { token: "comment", next: "@popall" }
60
+ }
61
+ }
62
+ ]
63
+ ]
64
+ }
65
+ };
66
+
67
+ export { conf, language };
@@ -0,0 +1,8 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "bat",
5
+ extensions: [".bat", ".cmd"],
6
+ aliases: ["Batch", "bat"],
7
+ loader: () => import('./bat.js')
8
+ });
package/bat/bat.js ADDED
@@ -0,0 +1,99 @@
1
+ const conf = {
2
+ comments: {
3
+ lineComment: "REM"
4
+ },
5
+ brackets: [
6
+ ["{", "}"],
7
+ ["[", "]"],
8
+ ["(", ")"]
9
+ ],
10
+ autoClosingPairs: [
11
+ { open: "{", close: "}" },
12
+ { open: "[", close: "]" },
13
+ { open: "(", close: ")" },
14
+ { open: '"', close: '"' }
15
+ ],
16
+ surroundingPairs: [
17
+ { open: "[", close: "]" },
18
+ { open: "(", close: ")" },
19
+ { open: '"', close: '"' }
20
+ ],
21
+ folding: {
22
+ markers: {
23
+ start: new RegExp("^\\s*(::\\s*|REM\\s+)#region"),
24
+ end: new RegExp("^\\s*(::\\s*|REM\\s+)#endregion")
25
+ }
26
+ }
27
+ };
28
+ const language = {
29
+ defaultToken: "",
30
+ ignoreCase: true,
31
+ tokenPostfix: ".bat",
32
+ brackets: [
33
+ { token: "delimiter.bracket", open: "{", close: "}" },
34
+ { token: "delimiter.parenthesis", open: "(", close: ")" },
35
+ { token: "delimiter.square", open: "[", close: "]" }
36
+ ],
37
+ keywords: /call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,
38
+ // we include these common regular expressions
39
+ symbols: /[=><!~?&|+\-*\/\^;\.,]+/,
40
+ escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
41
+ // The main tokenizer for our languages
42
+ tokenizer: {
43
+ root: [
44
+ [/^(\s*)(rem(?:\s.*|))$/, ["", "comment"]],
45
+ [/(\@?)(@keywords)(?!\w)/, [{ token: "keyword" }, { token: "keyword.$2" }]],
46
+ // whitespace
47
+ [/[ \t\r\n]+/, ""],
48
+ // blocks
49
+ [/setlocal(?!\w)/, "keyword.tag-setlocal"],
50
+ [/endlocal(?!\w)/, "keyword.tag-setlocal"],
51
+ // words
52
+ [/[a-zA-Z_]\w*/, ""],
53
+ // labels
54
+ [/:\w*/, "metatag"],
55
+ // variables
56
+ [/%[^%]+%/, "variable"],
57
+ [/%%[\w]+(?!\w)/, "variable"],
58
+ // punctuations
59
+ [/[{}()\[\]]/, "@brackets"],
60
+ [/@symbols/, "delimiter"],
61
+ // numbers
62
+ [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
63
+ [/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/, "number.hex"],
64
+ [/\d+/, "number"],
65
+ // punctuation: after number because of .\d floats
66
+ [/[;,.]/, "delimiter"],
67
+ // strings:
68
+ [/"/, "string", '@string."'],
69
+ [/'/, "string", "@string.'"]
70
+ ],
71
+ string: [
72
+ [
73
+ /[^\\"'%]+/,
74
+ {
75
+ cases: {
76
+ "@eos": { token: "string", next: "@popall" },
77
+ "@default": "string"
78
+ }
79
+ }
80
+ ],
81
+ [/@escapes/, "string.escape"],
82
+ [/\\./, "string.escape.invalid"],
83
+ [/%[\w ]+%/, "variable"],
84
+ [/%%[\w]+(?!\w)/, "variable"],
85
+ [
86
+ /["']/,
87
+ {
88
+ cases: {
89
+ "$#==$S2": { token: "string", next: "@pop" },
90
+ "@default": "string"
91
+ }
92
+ }
93
+ ],
94
+ [/$/, "string", "@popall"]
95
+ ]
96
+ }
97
+ };
98
+
99
+ export { conf, language };
@@ -0,0 +1,8 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "bicep",
5
+ extensions: [".bicep"],
6
+ aliases: ["Bicep"],
7
+ loader: () => import('./bicep.js')
8
+ });
package/bicep/bicep.js ADDED
@@ -0,0 +1,108 @@
1
+ const bounded = (text) => `\\b${text}\\b`;
2
+ const identifierStart = "[_a-zA-Z]";
3
+ const identifierContinue = "[_a-zA-Z0-9]";
4
+ const identifier = bounded(`${identifierStart}${identifierContinue}*`);
5
+ const keywords = [
6
+ "targetScope",
7
+ "resource",
8
+ "module",
9
+ "param",
10
+ "var",
11
+ "output",
12
+ "for",
13
+ "in",
14
+ "if",
15
+ "existing"
16
+ ];
17
+ const namedLiterals = ["true", "false", "null"];
18
+ const nonCommentWs = `[ \\t\\r\\n]`;
19
+ const numericLiteral = `[0-9]+`;
20
+ const conf = {
21
+ comments: {
22
+ lineComment: "//",
23
+ blockComment: ["/*", "*/"]
24
+ },
25
+ brackets: [
26
+ ["{", "}"],
27
+ ["[", "]"],
28
+ ["(", ")"]
29
+ ],
30
+ surroundingPairs: [
31
+ { open: "{", close: "}" },
32
+ { open: "[", close: "]" },
33
+ { open: "(", close: ")" },
34
+ { open: "'", close: "'" },
35
+ { open: "'''", close: "'''" }
36
+ ],
37
+ autoClosingPairs: [
38
+ { open: "{", close: "}" },
39
+ { open: "[", close: "]" },
40
+ { open: "(", close: ")" },
41
+ { open: "'", close: "'", notIn: ["string", "comment"] },
42
+ { open: "'''", close: "'''", notIn: ["string", "comment"] }
43
+ ],
44
+ autoCloseBefore: ":.,=}])' \n ",
45
+ indentationRules: {
46
+ increaseIndentPattern: new RegExp("^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"),
47
+ decreaseIndentPattern: new RegExp("^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$")
48
+ }
49
+ };
50
+ const language = {
51
+ defaultToken: "",
52
+ tokenPostfix: ".bicep",
53
+ brackets: [
54
+ { open: "{", close: "}", token: "delimiter.curly" },
55
+ { open: "[", close: "]", token: "delimiter.square" },
56
+ { open: "(", close: ")", token: "delimiter.parenthesis" }
57
+ ],
58
+ symbols: /[=><!~?:&|+\-*/^%]+/,
59
+ keywords,
60
+ namedLiterals,
61
+ escapes: `\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\\${)`,
62
+ tokenizer: {
63
+ root: [{ include: "@expression" }, { include: "@whitespace" }],
64
+ stringVerbatim: [
65
+ { regex: `(|'|'')[^']`, action: { token: "string" } },
66
+ { regex: `'''`, action: { token: "string.quote", next: "@pop" } }
67
+ ],
68
+ stringLiteral: [
69
+ { regex: `\\\${`, action: { token: "delimiter.bracket", next: "@bracketCounting" } },
70
+ { regex: `[^\\\\'$]+`, action: { token: "string" } },
71
+ { regex: "@escapes", action: { token: "string.escape" } },
72
+ { regex: `\\\\.`, action: { token: "string.escape.invalid" } },
73
+ { regex: `'`, action: { token: "string", next: "@pop" } }
74
+ ],
75
+ bracketCounting: [
76
+ { regex: `{`, action: { token: "delimiter.bracket", next: "@bracketCounting" } },
77
+ { regex: `}`, action: { token: "delimiter.bracket", next: "@pop" } },
78
+ { include: "expression" }
79
+ ],
80
+ comment: [
81
+ { regex: `[^\\*]+`, action: { token: "comment" } },
82
+ { regex: `\\*\\/`, action: { token: "comment", next: "@pop" } },
83
+ { regex: `[\\/*]`, action: { token: "comment" } }
84
+ ],
85
+ whitespace: [
86
+ { regex: nonCommentWs },
87
+ { regex: `\\/\\*`, action: { token: "comment", next: "@comment" } },
88
+ { regex: `\\/\\/.*$`, action: { token: "comment" } }
89
+ ],
90
+ expression: [
91
+ { regex: `'''`, action: { token: "string.quote", next: "@stringVerbatim" } },
92
+ { regex: `'`, action: { token: "string.quote", next: "@stringLiteral" } },
93
+ { regex: numericLiteral, action: { token: "number" } },
94
+ {
95
+ regex: identifier,
96
+ action: {
97
+ cases: {
98
+ "@keywords": { token: "keyword" },
99
+ "@namedLiterals": { token: "keyword" },
100
+ "@default": { token: "identifier" }
101
+ }
102
+ }
103
+ }
104
+ ]
105
+ }
106
+ };
107
+
108
+ export { conf, language };
@@ -0,0 +1,8 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "cameligo",
5
+ extensions: [".mligo"],
6
+ aliases: ["Cameligo"],
7
+ loader: () => import('./cameligo.js')
8
+ });