@codingame/monaco-vscode-standalone-languages 3.2.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 (163) hide show
  1. package/_.contribution.js +74 -0
  2. package/abap/abap.contribution.js +19 -0
  3. package/abap/abap.js +1406 -0
  4. package/apex/apex.contribution.js +20 -0
  5. package/apex/apex.js +338 -0
  6. package/azcli/azcli.contribution.js +19 -0
  7. package/azcli/azcli.js +76 -0
  8. package/bat/bat.contribution.js +19 -0
  9. package/bat/bat.js +108 -0
  10. package/bicep/bicep.contribution.js +19 -0
  11. package/bicep/bicep.js +117 -0
  12. package/cameligo/cameligo.contribution.js +19 -0
  13. package/cameligo/cameligo.js +182 -0
  14. package/clojure/clojure.contribution.js +19 -0
  15. package/clojure/clojure.js +769 -0
  16. package/coffee/coffee.contribution.js +20 -0
  17. package/coffee/coffee.js +240 -0
  18. package/cpp/cpp.contribution.js +29 -0
  19. package/cpp/cpp.js +409 -0
  20. package/csharp/csharp.contribution.js +19 -0
  21. package/csharp/csharp.js +334 -0
  22. package/csp/csp.contribution.js +19 -0
  23. package/csp/csp.js +61 -0
  24. package/css/css.contribution.js +20 -0
  25. package/css/css.js +193 -0
  26. package/cypher/cypher.contribution.js +19 -0
  27. package/cypher/cypher.js +271 -0
  28. package/dart/dart.contribution.js +20 -0
  29. package/dart/dart.js +289 -0
  30. package/dockerfile/dockerfile.contribution.js +20 -0
  31. package/dockerfile/dockerfile.js +138 -0
  32. package/ecl/ecl.contribution.js +19 -0
  33. package/ecl/ecl.js +464 -0
  34. package/elixir/elixir.contribution.js +19 -0
  35. package/elixir/elixir.js +577 -0
  36. package/flow9/flow9.contribution.js +19 -0
  37. package/flow9/flow9.js +150 -0
  38. package/freemarker2/freemarker2.contribution.js +73 -0
  39. package/freemarker2/freemarker2.js +1016 -0
  40. package/fsharp/fsharp.contribution.js +19 -0
  41. package/fsharp/fsharp.js +225 -0
  42. package/go/go.contribution.js +19 -0
  43. package/go/go.js +226 -0
  44. package/graphql/graphql.contribution.js +20 -0
  45. package/graphql/graphql.js +159 -0
  46. package/handlebars/handlebars.contribution.js +20 -0
  47. package/handlebars/handlebars.js +439 -0
  48. package/hcl/hcl.contribution.js +19 -0
  49. package/hcl/hcl.js +191 -0
  50. package/html/html.contribution.js +20 -0
  51. package/html/html.js +328 -0
  52. package/index.js +81 -0
  53. package/ini/ini.contribution.js +20 -0
  54. package/ini/ini.js +79 -0
  55. package/java/java.contribution.js +20 -0
  56. package/java/java.js +240 -0
  57. package/javascript/javascript.contribution.js +22 -0
  58. package/javascript/javascript.js +77 -0
  59. package/julia/julia.contribution.js +19 -0
  60. package/julia/julia.js +519 -0
  61. package/kotlin/kotlin.contribution.js +20 -0
  62. package/kotlin/kotlin.js +261 -0
  63. package/less/less.contribution.js +20 -0
  64. package/less/less.js +169 -0
  65. package/lexon/lexon.contribution.js +19 -0
  66. package/lexon/lexon.js +165 -0
  67. package/liquid/liquid.contribution.js +20 -0
  68. package/liquid/liquid.js +260 -0
  69. package/lua/lua.contribution.js +19 -0
  70. package/lua/lua.js +170 -0
  71. package/m3/m3.contribution.js +19 -0
  72. package/m3/m3.js +218 -0
  73. package/markdown/markdown.contribution.js +19 -0
  74. package/markdown/markdown.js +237 -0
  75. package/mdx/mdx.contribution.js +19 -0
  76. package/mdx/mdx.js +184 -0
  77. package/mips/mips.contribution.js +20 -0
  78. package/mips/mips.js +206 -0
  79. package/msdax/msdax.contribution.js +19 -0
  80. package/msdax/msdax.js +383 -0
  81. package/mysql/mysql.contribution.js +19 -0
  82. package/mysql/mysql.js +886 -0
  83. package/objective-c/objective-c.contribution.js +19 -0
  84. package/objective-c/objective-c.js +191 -0
  85. package/package.json +23 -0
  86. package/pascal/pascal.contribution.js +20 -0
  87. package/pascal/pascal.js +259 -0
  88. package/pascaligo/pascaligo.contribution.js +19 -0
  89. package/pascaligo/pascaligo.js +172 -0
  90. package/perl/perl.contribution.js +19 -0
  91. package/perl/perl.js +634 -0
  92. package/pgsql/pgsql.contribution.js +19 -0
  93. package/pgsql/pgsql.js +859 -0
  94. package/php/php.contribution.js +20 -0
  95. package/php/php.js +508 -0
  96. package/pla/pla.contribution.js +18 -0
  97. package/pla/pla.js +145 -0
  98. package/postiats/postiats.contribution.js +19 -0
  99. package/postiats/postiats.js +915 -0
  100. package/powerquery/powerquery.contribution.js +19 -0
  101. package/powerquery/powerquery.js +898 -0
  102. package/powershell/powershell.contribution.js +19 -0
  103. package/powershell/powershell.js +247 -0
  104. package/protobuf/protobuf.contribution.js +19 -0
  105. package/protobuf/protobuf.js +428 -0
  106. package/pug/pug.contribution.js +19 -0
  107. package/pug/pug.js +410 -0
  108. package/python/python.contribution.js +20 -0
  109. package/python/python.js +295 -0
  110. package/qsharp/qsharp.contribution.js +19 -0
  111. package/qsharp/qsharp.js +293 -0
  112. package/r/r.contribution.js +19 -0
  113. package/r/r.js +251 -0
  114. package/razor/razor.contribution.js +20 -0
  115. package/razor/razor.js +570 -0
  116. package/redis/redis.contribution.js +19 -0
  117. package/redis/redis.js +310 -0
  118. package/redshift/redshift.contribution.js +19 -0
  119. package/redshift/redshift.js +817 -0
  120. package/restructuredtext/restructuredtext.contribution.js +19 -0
  121. package/restructuredtext/restructuredtext.js +182 -0
  122. package/ruby/ruby.contribution.js +20 -0
  123. package/ruby/ruby.js +519 -0
  124. package/rust/rust.contribution.js +19 -0
  125. package/rust/rust.js +351 -0
  126. package/sb/sb.contribution.js +19 -0
  127. package/sb/sb.js +123 -0
  128. package/scala/scala.contribution.js +20 -0
  129. package/scala/scala.js +378 -0
  130. package/scheme/scheme.contribution.js +19 -0
  131. package/scheme/scheme.js +116 -0
  132. package/scss/scss.contribution.js +20 -0
  133. package/scss/scss.js +268 -0
  134. package/shell/shell.contribution.js +19 -0
  135. package/shell/shell.js +229 -0
  136. package/solidity/solidity.contribution.js +19 -0
  137. package/solidity/solidity.js +1375 -0
  138. package/sophia/sophia.contribution.js +19 -0
  139. package/sophia/sophia.js +207 -0
  140. package/sparql/sparql.contribution.js +19 -0
  141. package/sparql/sparql.js +209 -0
  142. package/sql/sql.contribution.js +19 -0
  143. package/sql/sql.js +861 -0
  144. package/st/st.contribution.js +19 -0
  145. package/st/st.js +424 -0
  146. package/swift/swift.contribution.js +20 -0
  147. package/swift/swift.js +320 -0
  148. package/systemverilog/systemverilog.contribution.js +29 -0
  149. package/systemverilog/systemverilog.js +584 -0
  150. package/tcl/tcl.contribution.js +19 -0
  151. package/tcl/tcl.js +240 -0
  152. package/twig/twig.contribution.js +20 -0
  153. package/twig/twig.js +400 -0
  154. package/typescript/typescript.contribution.js +20 -0
  155. package/typescript/typescript.js +362 -0
  156. package/vb/vb.contribution.js +19 -0
  157. package/vb/vb.js +380 -0
  158. package/wgsl/wgsl.contribution.js +19 -0
  159. package/wgsl/wgsl.js +461 -0
  160. package/xml/xml.contribution.js +39 -0
  161. package/xml/xml.js +114 -0
  162. package/yaml/yaml.contribution.js +20 -0
  163. package/yaml/yaml.js +225 -0
package/ruby/ruby.js ADDED
@@ -0,0 +1,519 @@
1
+ /*!-----------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Version: 0.47.0(undefined)
4
+ * Released under the MIT license
5
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
6
+ *-----------------------------------------------------------------------------*/
7
+
8
+
9
+ // src/basic-languages/ruby/ruby.ts
10
+ var conf = {
11
+ comments: {
12
+ lineComment: "#",
13
+ blockComment: ["=begin", "=end"]
14
+ },
15
+ brackets: [
16
+ ["(", ")"],
17
+ ["{", "}"],
18
+ ["[", "]"]
19
+ ],
20
+ autoClosingPairs: [
21
+ { open: "{", close: "}" },
22
+ { open: "[", close: "]" },
23
+ { open: "(", close: ")" },
24
+ { open: '"', close: '"' },
25
+ { open: "'", close: "'" }
26
+ ],
27
+ surroundingPairs: [
28
+ { open: "{", close: "}" },
29
+ { open: "[", close: "]" },
30
+ { open: "(", close: ")" },
31
+ { open: '"', close: '"' },
32
+ { open: "'", close: "'" }
33
+ ],
34
+ indentationRules: {
35
+ increaseIndentPattern: new RegExp(
36
+ `^\\s*((begin|class|(private|protected)\\s+def|def|else|elsif|ensure|for|if|module|rescue|unless|until|when|while|case)|([^#]*\\sdo\\b)|([^#]*=\\s*(case|if|unless)))\\b([^#\\{;]|("|'|/).*\\4)*(#.*)?$`
37
+ ),
38
+ decreaseIndentPattern: new RegExp(
39
+ "^\\s*([}\\]]([,)]?\\s*(#|$)|\\.[a-zA-Z_]\\w*\\b)|(end|rescue|ensure|else|elsif|when)\\b)"
40
+ )
41
+ }
42
+ };
43
+ var language = {
44
+ tokenPostfix: ".ruby",
45
+ keywords: [
46
+ "__LINE__",
47
+ "__ENCODING__",
48
+ "__FILE__",
49
+ "BEGIN",
50
+ "END",
51
+ "alias",
52
+ "and",
53
+ "begin",
54
+ "break",
55
+ "case",
56
+ "class",
57
+ "def",
58
+ "defined?",
59
+ "do",
60
+ "else",
61
+ "elsif",
62
+ "end",
63
+ "ensure",
64
+ "for",
65
+ "false",
66
+ "if",
67
+ "in",
68
+ "module",
69
+ "next",
70
+ "nil",
71
+ "not",
72
+ "or",
73
+ "redo",
74
+ "rescue",
75
+ "retry",
76
+ "return",
77
+ "self",
78
+ "super",
79
+ "then",
80
+ "true",
81
+ "undef",
82
+ "unless",
83
+ "until",
84
+ "when",
85
+ "while",
86
+ "yield"
87
+ ],
88
+ keywordops: ["::", "..", "...", "?", ":", "=>"],
89
+ builtins: [
90
+ "require",
91
+ "public",
92
+ "private",
93
+ "include",
94
+ "extend",
95
+ "attr_reader",
96
+ "protected",
97
+ "private_class_method",
98
+ "protected_class_method",
99
+ "new"
100
+ ],
101
+ // these are closed by 'end' (if, while and until are handled separately)
102
+ declarations: [
103
+ "module",
104
+ "class",
105
+ "def",
106
+ "case",
107
+ "do",
108
+ "begin",
109
+ "for",
110
+ "if",
111
+ "while",
112
+ "until",
113
+ "unless"
114
+ ],
115
+ linedecls: ["def", "case", "do", "begin", "for", "if", "while", "until", "unless"],
116
+ operators: [
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
+ brackets: [
158
+ { open: "(", close: ")", token: "delimiter.parenthesis" },
159
+ { open: "{", close: "}", token: "delimiter.curly" },
160
+ { open: "[", close: "]", token: "delimiter.square" }
161
+ ],
162
+ // we include these common regular expressions
163
+ symbols: /[=><!~?:&|+\-*\/\^%\.]+/,
164
+ // escape sequences
165
+ escape: /(?:[abefnrstv\\"'\n\r]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4})/,
166
+ escapes: /\\(?:C\-(@escape|.)|c(@escape|.)|@escape)/,
167
+ decpart: /\d(_?\d)*/,
168
+ decimal: /0|@decpart/,
169
+ delim: /[^a-zA-Z0-9\s\n\r]/,
170
+ heredelim: /(?:\w+|'[^']*'|"[^"]*"|`[^`]*`)/,
171
+ regexpctl: /[(){}\[\]\$\^|\-*+?\.]/,
172
+ regexpesc: /\\(?:[AzZbBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})?/,
173
+ // The main tokenizer for our languages
174
+ tokenizer: {
175
+ // Main entry.
176
+ // root.<decl> where decl is the current opening declaration (like 'class')
177
+ root: [
178
+ // identifiers and keywords
179
+ // most complexity here is due to matching 'end' correctly with declarations.
180
+ // We distinguish a declaration that comes first on a line, versus declarations further on a line (which are most likey modifiers)
181
+ [
182
+ /^(\s*)([a-z_]\w*[!?=]?)/,
183
+ [
184
+ "white",
185
+ {
186
+ cases: {
187
+ "for|until|while": {
188
+ token: "keyword.$2",
189
+ next: "@dodecl.$2"
190
+ },
191
+ "@declarations": {
192
+ token: "keyword.$2",
193
+ next: "@root.$2"
194
+ },
195
+ end: { token: "keyword.$S2", next: "@pop" },
196
+ "@keywords": "keyword",
197
+ "@builtins": "predefined",
198
+ "@default": "identifier"
199
+ }
200
+ }
201
+ ]
202
+ ],
203
+ [
204
+ /[a-z_]\w*[!?=]?/,
205
+ {
206
+ cases: {
207
+ "if|unless|while|until": {
208
+ token: "keyword.$0x",
209
+ next: "@modifier.$0x"
210
+ },
211
+ for: { token: "keyword.$2", next: "@dodecl.$2" },
212
+ "@linedecls": { token: "keyword.$0", next: "@root.$0" },
213
+ end: { token: "keyword.$S2", next: "@pop" },
214
+ "@keywords": "keyword",
215
+ "@builtins": "predefined",
216
+ "@default": "identifier"
217
+ }
218
+ }
219
+ ],
220
+ [/[A-Z][\w]*[!?=]?/, "constructor.identifier"],
221
+ // constant
222
+ [/\$[\w]*/, "global.constant"],
223
+ // global
224
+ [/@[\w]*/, "namespace.instance.identifier"],
225
+ // instance
226
+ [/@@@[\w]*/, "namespace.class.identifier"],
227
+ // class
228
+ // here document
229
+ [/<<[-~](@heredelim).*/, { token: "string.heredoc.delimiter", next: "@heredoc.$1" }],
230
+ [/[ \t\r\n]+<<(@heredelim).*/, { token: "string.heredoc.delimiter", next: "@heredoc.$1" }],
231
+ [/^<<(@heredelim).*/, { token: "string.heredoc.delimiter", next: "@heredoc.$1" }],
232
+ // whitespace
233
+ { include: "@whitespace" },
234
+ // strings
235
+ [/"/, { token: "string.d.delim", next: '@dstring.d."' }],
236
+ [/'/, { token: "string.sq.delim", next: "@sstring.sq" }],
237
+ // % literals. For efficiency, rematch in the 'pstring' state
238
+ [/%([rsqxwW]|Q?)/, { token: "@rematch", next: "pstring" }],
239
+ // commands and symbols
240
+ [/`/, { token: "string.x.delim", next: "@dstring.x.`" }],
241
+ [/:(\w|[$@])\w*[!?=]?/, "string.s"],
242
+ [/:"/, { token: "string.s.delim", next: '@dstring.s."' }],
243
+ [/:'/, { token: "string.s.delim", next: "@sstring.s" }],
244
+ // regular expressions. Lookahead for a (not escaped) closing forwardslash on the same line
245
+ [/\/(?=(\\\/|[^\/\n])+\/)/, { token: "regexp.delim", next: "@regexp" }],
246
+ // delimiters and operators
247
+ [/[{}()\[\]]/, "@brackets"],
248
+ [
249
+ /@symbols/,
250
+ {
251
+ cases: {
252
+ "@keywordops": "keyword",
253
+ "@operators": "operator",
254
+ "@default": ""
255
+ }
256
+ }
257
+ ],
258
+ [/[;,]/, "delimiter"],
259
+ // numbers
260
+ [/0[xX][0-9a-fA-F](_?[0-9a-fA-F])*/, "number.hex"],
261
+ [/0[_oO][0-7](_?[0-7])*/, "number.octal"],
262
+ [/0[bB][01](_?[01])*/, "number.binary"],
263
+ [/0[dD]@decpart/, "number"],
264
+ [
265
+ /@decimal((\.@decpart)?([eE][\-+]?@decpart)?)/,
266
+ {
267
+ cases: {
268
+ $1: "number.float",
269
+ "@default": "number"
270
+ }
271
+ }
272
+ ]
273
+ ],
274
+ // used to not treat a 'do' as a block opener if it occurs on the same
275
+ // line as a 'do' statement: 'while|until|for'
276
+ // dodecl.<decl> where decl is the declarations started, like 'while'
277
+ dodecl: [
278
+ [/^/, { token: "", switchTo: "@root.$S2" }],
279
+ // get out of do-skipping mode on a new line
280
+ [
281
+ /[a-z_]\w*[!?=]?/,
282
+ {
283
+ cases: {
284
+ end: { token: "keyword.$S2", next: "@pop" },
285
+ // end on same line
286
+ do: { token: "keyword", switchTo: "@root.$S2" },
287
+ // do on same line: not an open bracket here
288
+ "@linedecls": {
289
+ token: "@rematch",
290
+ switchTo: "@root.$S2"
291
+ },
292
+ // other declaration on same line: rematch
293
+ "@keywords": "keyword",
294
+ "@builtins": "predefined",
295
+ "@default": "identifier"
296
+ }
297
+ }
298
+ ],
299
+ { include: "@root" }
300
+ ],
301
+ // used to prevent potential modifiers ('if|until|while|unless') to match
302
+ // with 'end' keywords.
303
+ // modifier.<decl>x where decl is the declaration starter, like 'if'
304
+ modifier: [
305
+ [/^/, "", "@pop"],
306
+ // it was a modifier: get out of modifier mode on a new line
307
+ [
308
+ /[a-z_]\w*[!?=]?/,
309
+ {
310
+ cases: {
311
+ end: { token: "keyword.$S2", next: "@pop" },
312
+ // end on same line
313
+ "then|else|elsif|do": {
314
+ token: "keyword",
315
+ switchTo: "@root.$S2"
316
+ },
317
+ // real declaration and not a modifier
318
+ "@linedecls": {
319
+ token: "@rematch",
320
+ switchTo: "@root.$S2"
321
+ },
322
+ // other declaration => not a modifier
323
+ "@keywords": "keyword",
324
+ "@builtins": "predefined",
325
+ "@default": "identifier"
326
+ }
327
+ }
328
+ ],
329
+ { include: "@root" }
330
+ ],
331
+ // single quote strings (also used for symbols)
332
+ // sstring.<kind> where kind is 'sq' (single quote) or 's' (symbol)
333
+ sstring: [
334
+ [/[^\\']+/, "string.$S2"],
335
+ [/\\\\|\\'|\\$/, "string.$S2.escape"],
336
+ [/\\./, "string.$S2.invalid"],
337
+ [/'/, { token: "string.$S2.delim", next: "@pop" }]
338
+ ],
339
+ // double quoted "string".
340
+ // dstring.<kind>.<delim> where kind is 'd' (double quoted), 'x' (command), or 's' (symbol)
341
+ // and delim is the ending delimiter (" or `)
342
+ dstring: [
343
+ [/[^\\`"#]+/, "string.$S2"],
344
+ [/#/, "string.$S2.escape", "@interpolated"],
345
+ [/\\$/, "string.$S2.escape"],
346
+ [/@escapes/, "string.$S2.escape"],
347
+ [/\\./, "string.$S2.escape.invalid"],
348
+ [
349
+ /[`"]/,
350
+ {
351
+ cases: {
352
+ "$#==$S3": { token: "string.$S2.delim", next: "@pop" },
353
+ "@default": "string.$S2"
354
+ }
355
+ }
356
+ ]
357
+ ],
358
+ // literal documents
359
+ // heredoc.<close> where close is the closing delimiter
360
+ heredoc: [
361
+ [
362
+ /^(\s*)(@heredelim)$/,
363
+ {
364
+ cases: {
365
+ "$2==$S2": ["string.heredoc", { token: "string.heredoc.delimiter", next: "@pop" }],
366
+ "@default": ["string.heredoc", "string.heredoc"]
367
+ }
368
+ }
369
+ ],
370
+ [/.*/, "string.heredoc"]
371
+ ],
372
+ // interpolated sequence
373
+ interpolated: [
374
+ [/\$\w*/, "global.constant", "@pop"],
375
+ [/@\w*/, "namespace.class.identifier", "@pop"],
376
+ [/@@@\w*/, "namespace.instance.identifier", "@pop"],
377
+ [
378
+ /[{]/,
379
+ {
380
+ token: "string.escape.curly",
381
+ switchTo: "@interpolated_compound"
382
+ }
383
+ ],
384
+ ["", "", "@pop"]
385
+ // just a # is interpreted as a #
386
+ ],
387
+ // any code
388
+ interpolated_compound: [
389
+ [/[}]/, { token: "string.escape.curly", next: "@pop" }],
390
+ { include: "@root" }
391
+ ],
392
+ // %r quoted regexp
393
+ // pregexp.<open>.<close> where open/close are the open/close delimiter
394
+ pregexp: [
395
+ { include: "@whitespace" },
396
+ // turns out that you can quote using regex control characters, aargh!
397
+ // for example; %r|kgjgaj| is ok (even though | is used for alternation)
398
+ // so, we need to match those first
399
+ [
400
+ /[^\(\{\[\\]/,
401
+ {
402
+ cases: {
403
+ "$#==$S3": { token: "regexp.delim", next: "@pop" },
404
+ "$#==$S2": { token: "regexp.delim", next: "@push" },
405
+ // nested delimiters are allowed..
406
+ "~[)}\\]]": "@brackets.regexp.escape.control",
407
+ "~@regexpctl": "regexp.escape.control",
408
+ "@default": "regexp"
409
+ }
410
+ }
411
+ ],
412
+ { include: "@regexcontrol" }
413
+ ],
414
+ // We match regular expression quite precisely
415
+ regexp: [
416
+ { include: "@regexcontrol" },
417
+ [/[^\\\/]/, "regexp"],
418
+ ["/[ixmp]*", { token: "regexp.delim" }, "@pop"]
419
+ ],
420
+ regexcontrol: [
421
+ [
422
+ /(\{)(\d+(?:,\d*)?)(\})/,
423
+ [
424
+ "@brackets.regexp.escape.control",
425
+ "regexp.escape.control",
426
+ "@brackets.regexp.escape.control"
427
+ ]
428
+ ],
429
+ [
430
+ /(\[)(\^?)/,
431
+ ["@brackets.regexp.escape.control", { token: "regexp.escape.control", next: "@regexrange" }]
432
+ ],
433
+ [/(\()(\?[:=!])/, ["@brackets.regexp.escape.control", "regexp.escape.control"]],
434
+ [/\(\?#/, { token: "regexp.escape.control", next: "@regexpcomment" }],
435
+ [/[()]/, "@brackets.regexp.escape.control"],
436
+ [/@regexpctl/, "regexp.escape.control"],
437
+ [/\\$/, "regexp.escape"],
438
+ [/@regexpesc/, "regexp.escape"],
439
+ [/\\\./, "regexp.invalid"],
440
+ [/#/, "regexp.escape", "@interpolated"]
441
+ ],
442
+ regexrange: [
443
+ [/-/, "regexp.escape.control"],
444
+ [/\^/, "regexp.invalid"],
445
+ [/\\$/, "regexp.escape"],
446
+ [/@regexpesc/, "regexp.escape"],
447
+ [/[^\]]/, "regexp"],
448
+ [/\]/, "@brackets.regexp.escape.control", "@pop"]
449
+ ],
450
+ regexpcomment: [
451
+ [/[^)]+/, "comment"],
452
+ [/\)/, { token: "regexp.escape.control", next: "@pop" }]
453
+ ],
454
+ // % quoted strings
455
+ // A bit repetitive since we need to often special case the kind of ending delimiter
456
+ pstring: [
457
+ [/%([qws])\(/, { token: "string.$1.delim", switchTo: "@qstring.$1.(.)" }],
458
+ [/%([qws])\[/, { token: "string.$1.delim", switchTo: "@qstring.$1.[.]" }],
459
+ [/%([qws])\{/, { token: "string.$1.delim", switchTo: "@qstring.$1.{.}" }],
460
+ [/%([qws])</, { token: "string.$1.delim", switchTo: "@qstring.$1.<.>" }],
461
+ [/%([qws])(@delim)/, { token: "string.$1.delim", switchTo: "@qstring.$1.$2.$2" }],
462
+ [/%r\(/, { token: "regexp.delim", switchTo: "@pregexp.(.)" }],
463
+ [/%r\[/, { token: "regexp.delim", switchTo: "@pregexp.[.]" }],
464
+ [/%r\{/, { token: "regexp.delim", switchTo: "@pregexp.{.}" }],
465
+ [/%r</, { token: "regexp.delim", switchTo: "@pregexp.<.>" }],
466
+ [/%r(@delim)/, { token: "regexp.delim", switchTo: "@pregexp.$1.$1" }],
467
+ [/%(x|W|Q?)\(/, { token: "string.$1.delim", switchTo: "@qqstring.$1.(.)" }],
468
+ [/%(x|W|Q?)\[/, { token: "string.$1.delim", switchTo: "@qqstring.$1.[.]" }],
469
+ [/%(x|W|Q?)\{/, { token: "string.$1.delim", switchTo: "@qqstring.$1.{.}" }],
470
+ [/%(x|W|Q?)</, { token: "string.$1.delim", switchTo: "@qqstring.$1.<.>" }],
471
+ [/%(x|W|Q?)(@delim)/, { token: "string.$1.delim", switchTo: "@qqstring.$1.$2.$2" }],
472
+ [/%([rqwsxW]|Q?)./, { token: "invalid", next: "@pop" }],
473
+ // recover
474
+ [/./, { token: "invalid", next: "@pop" }]
475
+ // recover
476
+ ],
477
+ // non-expanded quoted string.
478
+ // qstring.<kind>.<open>.<close>
479
+ // kind = q|w|s (single quote, array, symbol)
480
+ // open = open delimiter
481
+ // close = close delimiter
482
+ qstring: [
483
+ [/\\$/, "string.$S2.escape"],
484
+ [/\\./, "string.$S2.escape"],
485
+ [
486
+ /./,
487
+ {
488
+ cases: {
489
+ "$#==$S4": { token: "string.$S2.delim", next: "@pop" },
490
+ "$#==$S3": { token: "string.$S2.delim", next: "@push" },
491
+ // nested delimiters are allowed..
492
+ "@default": "string.$S2"
493
+ }
494
+ }
495
+ ]
496
+ ],
497
+ // expanded quoted string.
498
+ // qqstring.<kind>.<open>.<close>
499
+ // kind = Q|W|x (double quote, array, command)
500
+ // open = open delimiter
501
+ // close = close delimiter
502
+ qqstring: [[/#/, "string.$S2.escape", "@interpolated"], { include: "@qstring" }],
503
+ // whitespace & comments
504
+ whitespace: [
505
+ [/[ \t\r\n]+/, ""],
506
+ [/^\s*=begin\b/, "comment", "@comment"],
507
+ [/#.*$/, "comment"]
508
+ ],
509
+ comment: [
510
+ [/[^=]+/, "comment"],
511
+ [/^\s*=begin\b/, "comment.invalid"],
512
+ // nested comment
513
+ [/^\s*=end\b.*/, "comment", "@pop"],
514
+ [/[=]/, "comment"]
515
+ ]
516
+ }
517
+ };
518
+
519
+ export { conf, language };
@@ -0,0 +1,19 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ /*!-----------------------------------------------------------------------------
4
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5
+ * Version: 0.47.0(undefined)
6
+ * Released under the MIT license
7
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
8
+ *-----------------------------------------------------------------------------*/
9
+
10
+ registerLanguage({
11
+ id: "rust",
12
+ extensions: [".rs", ".rlib"],
13
+ aliases: ["Rust", "rust"],
14
+ loader: () => {
15
+ {
16
+ return import('./rust.js');
17
+ }
18
+ }
19
+ });