@univerjs/uniscript 0.4.0-alpha.0 → 0.4.0-nightly.202410121605

Sign up to get free protection for your applications and to get access to all the features.
Files changed (178) hide show
  1. package/lib/abap-BZS-1p12.js +6 -0
  2. package/lib/abap-D8H3nII2.mjs +1404 -0
  3. package/lib/apex-B2xdRF0k.js +6 -0
  4. package/lib/apex-BVHYDV51.mjs +334 -0
  5. package/lib/azcli-BwJ4gbR1.mjs +74 -0
  6. package/lib/azcli-CKk2q0zF.js +6 -0
  7. package/lib/bat-BDmMqWXx.mjs +106 -0
  8. package/lib/bat-Ehz5Z_mk.js +6 -0
  9. package/lib/bicep-B5L2IbSj.mjs +110 -0
  10. package/lib/bicep-WbLMPUMj.js +7 -0
  11. package/lib/cameligo-B_ldnAvM.js +6 -0
  12. package/lib/cameligo-CmyOPZUd.mjs +180 -0
  13. package/lib/cjs/index.js +1 -9
  14. package/lib/clojure-Dg-qgg-1.js +6 -0
  15. package/lib/clojure-iSXHsTlR.mjs +767 -0
  16. package/lib/coffee-BCg0pb49.js +6 -0
  17. package/lib/coffee-BUCk2FHC.mjs +238 -0
  18. package/lib/cpp-CJWZ7Zo7.js +6 -0
  19. package/lib/cpp-MUyeqRt5.mjs +395 -0
  20. package/lib/csharp-B9vyMfVU.mjs +332 -0
  21. package/lib/csharp-BZypj8XG.js +6 -0
  22. package/lib/csp-BfXxGnNN.js +6 -0
  23. package/lib/csp-CbylPXe5.mjs +59 -0
  24. package/lib/css-BPDnvT2s.js +8 -0
  25. package/lib/css-BQSMT8k7.mjs +193 -0
  26. package/lib/cssMode-B_of5tVd.js +9 -0
  27. package/lib/cssMode-BuX-eUHc.mjs +1604 -0
  28. package/lib/cypher-3bNWMNCJ.js +6 -0
  29. package/lib/cypher-D7IWy_82.mjs +269 -0
  30. package/lib/dart-BCVbUKaH.mjs +287 -0
  31. package/lib/dart-C9Glm5m-.js +6 -0
  32. package/lib/dockerfile-CjnlcV5o.js +6 -0
  33. package/lib/dockerfile-D2-hSnDX.mjs +136 -0
  34. package/lib/ecl-DRJlPmOb.mjs +462 -0
  35. package/lib/ecl-UyoSfv7F.js +6 -0
  36. package/lib/elixir-Bol0p0Ia.js +6 -0
  37. package/lib/elixir-D8NBXKCb.mjs +575 -0
  38. package/lib/es/index.js +5 -262
  39. package/lib/flow9-Be1OUdJl.js +6 -0
  40. package/lib/flow9-Dp7h8rKW.mjs +148 -0
  41. package/lib/freemarker2-D8-fH4uC.mjs +1001 -0
  42. package/lib/freemarker2-S5ay_GEf.js +8 -0
  43. package/lib/fsharp-CJxdVP7r.mjs +223 -0
  44. package/lib/fsharp-CKIYWNYJ.js +6 -0
  45. package/lib/go-DWj6zslQ.js +6 -0
  46. package/lib/go-IPaMO3Uz.mjs +224 -0
  47. package/lib/graphql-BzJpwfxN.js +6 -0
  48. package/lib/graphql-CMoDK5uf.mjs +157 -0
  49. package/lib/handlebars-CEMNnGaU.mjs +427 -0
  50. package/lib/handlebars-CM3PRDRO.js +6 -0
  51. package/lib/hcl-BCY6T0iq.js +6 -0
  52. package/lib/hcl-BTAYK4pT.mjs +189 -0
  53. package/lib/html-BSUn7oJR.mjs +316 -0
  54. package/lib/html-Df-Osxjs.js +6 -0
  55. package/lib/htmlMode-Bj4CfAzA.js +9 -0
  56. package/lib/htmlMode-xJPwX0cD.mjs +1615 -0
  57. package/lib/index-D6nY5NdF.mjs +116821 -0
  58. package/lib/index-rYV4VmC2.js +1163 -0
  59. package/lib/index.css +1 -1
  60. package/lib/ini-CC3_THb4.js +6 -0
  61. package/lib/ini-CiaphB6F.mjs +77 -0
  62. package/lib/java-CwRV8Dsg.js +6 -0
  63. package/lib/java-DxksziCw.mjs +238 -0
  64. package/lib/javascript-D1eKEotE.js +6 -0
  65. package/lib/javascript-c8D1_K05.mjs +76 -0
  66. package/lib/jsonMode-8-L3-E9k.mjs +2042 -0
  67. package/lib/jsonMode-BdBVsN9_.js +15 -0
  68. package/lib/julia-7Z1jwT4W.js +6 -0
  69. package/lib/julia-TTty8och.mjs +517 -0
  70. package/lib/kotlin-BAXgl2QX.js +6 -0
  71. package/lib/kotlin-Dzand-bM.mjs +259 -0
  72. package/lib/less-CSG9Zdoy.js +7 -0
  73. package/lib/less-CWDFQI_i.mjs +168 -0
  74. package/lib/lexon-BiTtMD9F.js +6 -0
  75. package/lib/lexon-bZpjZioh.mjs +163 -0
  76. package/lib/liquid-BmlJOXgY.js +6 -0
  77. package/lib/liquid-Bs7DM5cg.mjs +248 -0
  78. package/lib/lua-CoWYKXUu.mjs +168 -0
  79. package/lib/lua-o7UTFJ05.js +6 -0
  80. package/lib/m3-DIJY3uEe.mjs +216 -0
  81. package/lib/m3-DOYTRLxi.js +6 -0
  82. package/lib/markdown-CDlkMTMZ.mjs +235 -0
  83. package/lib/markdown-Di5faXtP.js +6 -0
  84. package/lib/mdx-BEI71kqO.mjs +173 -0
  85. package/lib/mdx-DJV2KJ98.js +6 -0
  86. package/lib/mips-CIiuS33B.mjs +204 -0
  87. package/lib/mips-CjGjcf9D.js +6 -0
  88. package/lib/msdax-4_jBeazN.mjs +381 -0
  89. package/lib/msdax-DZFpIwAH.js +6 -0
  90. package/lib/mysql-6Y0DL_eO.js +6 -0
  91. package/lib/mysql-D_KZRjSR.mjs +884 -0
  92. package/lib/objective-c-7nsY1fc1.mjs +189 -0
  93. package/lib/objective-c-BtrzMwBz.js +6 -0
  94. package/lib/pascal-BF06Dt9I.js +6 -0
  95. package/lib/pascal-BHpF9PW1.mjs +257 -0
  96. package/lib/pascaligo-BDrxVOcH.js +6 -0
  97. package/lib/pascaligo-C3mRbxmU.mjs +170 -0
  98. package/lib/perl-BMlqAyyD.js +6 -0
  99. package/lib/perl-F3tWDMLI.mjs +632 -0
  100. package/lib/pgsql-D62t1RD_.mjs +857 -0
  101. package/lib/pgsql-DXYBcnYD.js +6 -0
  102. package/lib/php-C8GGPjjI.mjs +506 -0
  103. package/lib/php-DmDmMNs3.js +6 -0
  104. package/lib/pla-2A6q3K8_.js +6 -0
  105. package/lib/pla-C_W_x2fV.mjs +143 -0
  106. package/lib/postiats-CMS8WwLg.mjs +913 -0
  107. package/lib/postiats-DQ-6iLGI.js +6 -0
  108. package/lib/powerquery-CuZPk7NC.js +6 -0
  109. package/lib/powerquery-Dcs0XplE.mjs +896 -0
  110. package/lib/powershell-Brx1N_3T.mjs +245 -0
  111. package/lib/powershell-D7BqJxnS.js +6 -0
  112. package/lib/protobuf-CkqkhuUG.js +7 -0
  113. package/lib/protobuf-UEJDuX6l.mjs +426 -0
  114. package/lib/pug-65DF18O8.js +6 -0
  115. package/lib/pug-LDwDmrMc.mjs +408 -0
  116. package/lib/python-BOeTitp9.mjs +309 -0
  117. package/lib/python-DRyE-VQQ.js +6 -0
  118. package/lib/qsharp-Cb7hPwnM.mjs +307 -0
  119. package/lib/qsharp-Dw07PXbd.js +6 -0
  120. package/lib/r-BHuY0po5.js +6 -0
  121. package/lib/r-BiFgSgcs.mjs +249 -0
  122. package/lib/razor-D0RPXCAO.mjs +558 -0
  123. package/lib/razor-DtDOotKq.js +6 -0
  124. package/lib/redis-BdzqoKC2.mjs +308 -0
  125. package/lib/redis-_Q4kv9ug.js +6 -0
  126. package/lib/redshift-DNNCHCLR.js +6 -0
  127. package/lib/redshift-Df6PoiEL.mjs +815 -0
  128. package/lib/restructuredtext-C9FM3r80.js +6 -0
  129. package/lib/restructuredtext-CW0ZtQ2l.mjs +180 -0
  130. package/lib/ruby-DyIFepcy.mjs +517 -0
  131. package/lib/ruby-DyJmXCYh.js +6 -0
  132. package/lib/rust-BiRHKB0S.mjs +349 -0
  133. package/lib/rust-DVvzZ_uH.js +6 -0
  134. package/lib/sb-CFwmZh3c.js +6 -0
  135. package/lib/sb-CahkGwPC.mjs +121 -0
  136. package/lib/scala-Cg9Wfw6B.mjs +376 -0
  137. package/lib/scala-DjaRe0PR.js +6 -0
  138. package/lib/scheme-Bqb0wlMX.mjs +114 -0
  139. package/lib/scheme-ZdeLzG0d.js +6 -0
  140. package/lib/scss-3qd2syug.mjs +268 -0
  141. package/lib/scss-Dqv1RljX.js +8 -0
  142. package/lib/shell-B5iW6U-v.mjs +227 -0
  143. package/lib/shell-BJ5zD_-e.js +6 -0
  144. package/lib/solidity-8Ys0iSgd.mjs +1373 -0
  145. package/lib/solidity-CagYWQAe.js +6 -0
  146. package/lib/sophia-PnZfErC3.mjs +205 -0
  147. package/lib/sophia-szuux90p.js +6 -0
  148. package/lib/sparql-CXz1-gkd.js +6 -0
  149. package/lib/sparql-CgWX-KRM.mjs +207 -0
  150. package/lib/sql-CN3Vg4Sm.mjs +859 -0
  151. package/lib/sql-CWZ5x4mg.js +6 -0
  152. package/lib/st-CcWMPoh3.js +6 -0
  153. package/lib/st-DKDuarOh.mjs +422 -0
  154. package/lib/swift-DUBoAkDR.js +8 -0
  155. package/lib/swift-DnXH6Con.mjs +318 -0
  156. package/lib/systemverilog-5hQzl-99.js +6 -0
  157. package/lib/systemverilog-pJOgZU46.mjs +582 -0
  158. package/lib/tcl-Bls9iNXn.mjs +238 -0
  159. package/lib/tcl-CiK0GhJi.js +6 -0
  160. package/lib/tsMode-BB2mDc5d.mjs +906 -0
  161. package/lib/tsMode-N-LS5RKx.js +16 -0
  162. package/lib/twig-B14HEeE0.mjs +398 -0
  163. package/lib/twig-Cbq-Ua-E.js +6 -0
  164. package/lib/typescript-CZplv8KD.js +6 -0
  165. package/lib/typescript-f9PHTVoW.mjs +351 -0
  166. package/lib/typespec-Br_LC070.js +6 -0
  167. package/lib/typespec-dAaIdBal.mjs +125 -0
  168. package/lib/umd/index.js +1914 -2
  169. package/lib/vb-B1HzwoGL.js +6 -0
  170. package/lib/vb-CPBujGrP.mjs +378 -0
  171. package/lib/wgsl-BNAUPMiJ.js +303 -0
  172. package/lib/wgsl-CqCqdnZC.mjs +448 -0
  173. package/lib/xml-BSe-ETnG.js +6 -0
  174. package/lib/xml-Dv0cmUxw.mjs +103 -0
  175. package/lib/yaml-O_DoXtBP.js +6 -0
  176. package/lib/yaml-eXS7QSgG.mjs +214 -0
  177. package/package.json +9 -16
  178. package/LICENSE +0 -176
@@ -0,0 +1,517 @@
1
+ /*!-----------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Version: 0.52.0(f6dc0eb8fce67e57f6036f4769d92c1666cdf546)
4
+ * Released under the MIT license
5
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
6
+ *-----------------------------------------------------------------------------*/
7
+ var conf = {
8
+ comments: {
9
+ lineComment: "#",
10
+ blockComment: ["=begin", "=end"]
11
+ },
12
+ brackets: [
13
+ ["(", ")"],
14
+ ["{", "}"],
15
+ ["[", "]"]
16
+ ],
17
+ autoClosingPairs: [
18
+ { open: "{", close: "}" },
19
+ { open: "[", close: "]" },
20
+ { open: "(", close: ")" },
21
+ { open: '"', close: '"' },
22
+ { open: "'", close: "'" }
23
+ ],
24
+ surroundingPairs: [
25
+ { open: "{", close: "}" },
26
+ { open: "[", close: "]" },
27
+ { open: "(", close: ")" },
28
+ { open: '"', close: '"' },
29
+ { open: "'", close: "'" }
30
+ ],
31
+ indentationRules: {
32
+ increaseIndentPattern: new RegExp(
33
+ `^\\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)*(#.*)?$`
34
+ ),
35
+ decreaseIndentPattern: new RegExp(
36
+ "^\\s*([}\\]]([,)]?\\s*(#|$)|\\.[a-zA-Z_]\\w*\\b)|(end|rescue|ensure|else|elsif|when)\\b)"
37
+ )
38
+ }
39
+ }, language = {
40
+ tokenPostfix: ".ruby",
41
+ keywords: [
42
+ "__LINE__",
43
+ "__ENCODING__",
44
+ "__FILE__",
45
+ "BEGIN",
46
+ "END",
47
+ "alias",
48
+ "and",
49
+ "begin",
50
+ "break",
51
+ "case",
52
+ "class",
53
+ "def",
54
+ "defined?",
55
+ "do",
56
+ "else",
57
+ "elsif",
58
+ "end",
59
+ "ensure",
60
+ "for",
61
+ "false",
62
+ "if",
63
+ "in",
64
+ "module",
65
+ "next",
66
+ "nil",
67
+ "not",
68
+ "or",
69
+ "redo",
70
+ "rescue",
71
+ "retry",
72
+ "return",
73
+ "self",
74
+ "super",
75
+ "then",
76
+ "true",
77
+ "undef",
78
+ "unless",
79
+ "until",
80
+ "when",
81
+ "while",
82
+ "yield"
83
+ ],
84
+ keywordops: ["::", "..", "...", "?", ":", "=>"],
85
+ builtins: [
86
+ "require",
87
+ "public",
88
+ "private",
89
+ "include",
90
+ "extend",
91
+ "attr_reader",
92
+ "protected",
93
+ "private_class_method",
94
+ "protected_class_method",
95
+ "new"
96
+ ],
97
+ // these are closed by 'end' (if, while and until are handled separately)
98
+ declarations: [
99
+ "module",
100
+ "class",
101
+ "def",
102
+ "case",
103
+ "do",
104
+ "begin",
105
+ "for",
106
+ "if",
107
+ "while",
108
+ "until",
109
+ "unless"
110
+ ],
111
+ linedecls: ["def", "case", "do", "begin", "for", "if", "while", "until", "unless"],
112
+ operators: [
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
+ brackets: [
154
+ { open: "(", close: ")", token: "delimiter.parenthesis" },
155
+ { open: "{", close: "}", token: "delimiter.curly" },
156
+ { open: "[", close: "]", token: "delimiter.square" }
157
+ ],
158
+ // we include these common regular expressions
159
+ symbols: /[=><!~?:&|+\-*\/\^%\.]+/,
160
+ // escape sequences
161
+ escape: /(?:[abefnrstv\\"'\n\r]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4})/,
162
+ escapes: /\\(?:C\-(@escape|.)|c(@escape|.)|@escape)/,
163
+ decpart: /\d(_?\d)*/,
164
+ decimal: /0|@decpart/,
165
+ delim: /[^a-zA-Z0-9\s\n\r]/,
166
+ heredelim: /(?:\w+|'[^']*'|"[^"]*"|`[^`]*`)/,
167
+ regexpctl: /[(){}\[\]\$\^|\-*+?\.]/,
168
+ regexpesc: /\\(?:[AzZbBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})?/,
169
+ // The main tokenizer for our languages
170
+ tokenizer: {
171
+ // Main entry.
172
+ // root.<decl> where decl is the current opening declaration (like 'class')
173
+ root: [
174
+ // identifiers and keywords
175
+ // most complexity here is due to matching 'end' correctly with declarations.
176
+ // We distinguish a declaration that comes first on a line, versus declarations further on a line (which are most likey modifiers)
177
+ [
178
+ /^(\s*)([a-z_]\w*[!?=]?)/,
179
+ [
180
+ "white",
181
+ {
182
+ cases: {
183
+ "for|until|while": {
184
+ token: "keyword.$2",
185
+ next: "@dodecl.$2"
186
+ },
187
+ "@declarations": {
188
+ token: "keyword.$2",
189
+ next: "@root.$2"
190
+ },
191
+ end: { token: "keyword.$S2", next: "@pop" },
192
+ "@keywords": "keyword",
193
+ "@builtins": "predefined",
194
+ "@default": "identifier"
195
+ }
196
+ }
197
+ ]
198
+ ],
199
+ [
200
+ /[a-z_]\w*[!?=]?/,
201
+ {
202
+ cases: {
203
+ "if|unless|while|until": {
204
+ token: "keyword.$0x",
205
+ next: "@modifier.$0x"
206
+ },
207
+ for: { token: "keyword.$2", next: "@dodecl.$2" },
208
+ "@linedecls": { token: "keyword.$0", next: "@root.$0" },
209
+ end: { token: "keyword.$S2", next: "@pop" },
210
+ "@keywords": "keyword",
211
+ "@builtins": "predefined",
212
+ "@default": "identifier"
213
+ }
214
+ }
215
+ ],
216
+ [/[A-Z][\w]*[!?=]?/, "constructor.identifier"],
217
+ // constant
218
+ [/\$[\w]*/, "global.constant"],
219
+ // global
220
+ [/@[\w]*/, "namespace.instance.identifier"],
221
+ // instance
222
+ [/@@@[\w]*/, "namespace.class.identifier"],
223
+ // class
224
+ // here document
225
+ [/<<[-~](@heredelim).*/, { token: "string.heredoc.delimiter", next: "@heredoc.$1" }],
226
+ [/[ \t\r\n]+<<(@heredelim).*/, { token: "string.heredoc.delimiter", next: "@heredoc.$1" }],
227
+ [/^<<(@heredelim).*/, { token: "string.heredoc.delimiter", next: "@heredoc.$1" }],
228
+ // whitespace
229
+ { include: "@whitespace" },
230
+ // strings
231
+ [/"/, { token: "string.d.delim", next: '@dstring.d."' }],
232
+ [/'/, { token: "string.sq.delim", next: "@sstring.sq" }],
233
+ // % literals. For efficiency, rematch in the 'pstring' state
234
+ [/%([rsqxwW]|Q?)/, { token: "@rematch", next: "pstring" }],
235
+ // commands and symbols
236
+ [/`/, { token: "string.x.delim", next: "@dstring.x.`" }],
237
+ [/:(\w|[$@])\w*[!?=]?/, "string.s"],
238
+ [/:"/, { token: "string.s.delim", next: '@dstring.s."' }],
239
+ [/:'/, { token: "string.s.delim", next: "@sstring.s" }],
240
+ // regular expressions. Lookahead for a (not escaped) closing forwardslash on the same line
241
+ [/\/(?=(\\\/|[^\/\n])+\/)/, { token: "regexp.delim", next: "@regexp" }],
242
+ // delimiters and operators
243
+ [/[{}()\[\]]/, "@brackets"],
244
+ [
245
+ /@symbols/,
246
+ {
247
+ cases: {
248
+ "@keywordops": "keyword",
249
+ "@operators": "operator",
250
+ "@default": ""
251
+ }
252
+ }
253
+ ],
254
+ [/[;,]/, "delimiter"],
255
+ // numbers
256
+ [/0[xX][0-9a-fA-F](_?[0-9a-fA-F])*/, "number.hex"],
257
+ [/0[_oO][0-7](_?[0-7])*/, "number.octal"],
258
+ [/0[bB][01](_?[01])*/, "number.binary"],
259
+ [/0[dD]@decpart/, "number"],
260
+ [
261
+ /@decimal((\.@decpart)?([eE][\-+]?@decpart)?)/,
262
+ {
263
+ cases: {
264
+ $1: "number.float",
265
+ "@default": "number"
266
+ }
267
+ }
268
+ ]
269
+ ],
270
+ // used to not treat a 'do' as a block opener if it occurs on the same
271
+ // line as a 'do' statement: 'while|until|for'
272
+ // dodecl.<decl> where decl is the declarations started, like 'while'
273
+ dodecl: [
274
+ [/^/, { token: "", switchTo: "@root.$S2" }],
275
+ // get out of do-skipping mode on a new line
276
+ [
277
+ /[a-z_]\w*[!?=]?/,
278
+ {
279
+ cases: {
280
+ end: { token: "keyword.$S2", next: "@pop" },
281
+ // end on same line
282
+ do: { token: "keyword", switchTo: "@root.$S2" },
283
+ // do on same line: not an open bracket here
284
+ "@linedecls": {
285
+ token: "@rematch",
286
+ switchTo: "@root.$S2"
287
+ },
288
+ // other declaration on same line: rematch
289
+ "@keywords": "keyword",
290
+ "@builtins": "predefined",
291
+ "@default": "identifier"
292
+ }
293
+ }
294
+ ],
295
+ { include: "@root" }
296
+ ],
297
+ // used to prevent potential modifiers ('if|until|while|unless') to match
298
+ // with 'end' keywords.
299
+ // modifier.<decl>x where decl is the declaration starter, like 'if'
300
+ modifier: [
301
+ [/^/, "", "@pop"],
302
+ // it was a modifier: get out of modifier mode on a new line
303
+ [
304
+ /[a-z_]\w*[!?=]?/,
305
+ {
306
+ cases: {
307
+ end: { token: "keyword.$S2", next: "@pop" },
308
+ // end on same line
309
+ "then|else|elsif|do": {
310
+ token: "keyword",
311
+ switchTo: "@root.$S2"
312
+ },
313
+ // real declaration and not a modifier
314
+ "@linedecls": {
315
+ token: "@rematch",
316
+ switchTo: "@root.$S2"
317
+ },
318
+ // other declaration => not a modifier
319
+ "@keywords": "keyword",
320
+ "@builtins": "predefined",
321
+ "@default": "identifier"
322
+ }
323
+ }
324
+ ],
325
+ { include: "@root" }
326
+ ],
327
+ // single quote strings (also used for symbols)
328
+ // sstring.<kind> where kind is 'sq' (single quote) or 's' (symbol)
329
+ sstring: [
330
+ [/[^\\']+/, "string.$S2"],
331
+ [/\\\\|\\'|\\$/, "string.$S2.escape"],
332
+ [/\\./, "string.$S2.invalid"],
333
+ [/'/, { token: "string.$S2.delim", next: "@pop" }]
334
+ ],
335
+ // double quoted "string".
336
+ // dstring.<kind>.<delim> where kind is 'd' (double quoted), 'x' (command), or 's' (symbol)
337
+ // and delim is the ending delimiter (" or `)
338
+ dstring: [
339
+ [/[^\\`"#]+/, "string.$S2"],
340
+ [/#/, "string.$S2.escape", "@interpolated"],
341
+ [/\\$/, "string.$S2.escape"],
342
+ [/@escapes/, "string.$S2.escape"],
343
+ [/\\./, "string.$S2.escape.invalid"],
344
+ [
345
+ /[`"]/,
346
+ {
347
+ cases: {
348
+ "$#==$S3": { token: "string.$S2.delim", next: "@pop" },
349
+ "@default": "string.$S2"
350
+ }
351
+ }
352
+ ]
353
+ ],
354
+ // literal documents
355
+ // heredoc.<close> where close is the closing delimiter
356
+ heredoc: [
357
+ [
358
+ /^(\s*)(@heredelim)$/,
359
+ {
360
+ cases: {
361
+ "$2==$S2": ["string.heredoc", { token: "string.heredoc.delimiter", next: "@pop" }],
362
+ "@default": ["string.heredoc", "string.heredoc"]
363
+ }
364
+ }
365
+ ],
366
+ [/.*/, "string.heredoc"]
367
+ ],
368
+ // interpolated sequence
369
+ interpolated: [
370
+ [/\$\w*/, "global.constant", "@pop"],
371
+ [/@\w*/, "namespace.class.identifier", "@pop"],
372
+ [/@@@\w*/, "namespace.instance.identifier", "@pop"],
373
+ [
374
+ /[{]/,
375
+ {
376
+ token: "string.escape.curly",
377
+ switchTo: "@interpolated_compound"
378
+ }
379
+ ],
380
+ ["", "", "@pop"]
381
+ // just a # is interpreted as a #
382
+ ],
383
+ // any code
384
+ interpolated_compound: [
385
+ [/[}]/, { token: "string.escape.curly", next: "@pop" }],
386
+ { include: "@root" }
387
+ ],
388
+ // %r quoted regexp
389
+ // pregexp.<open>.<close> where open/close are the open/close delimiter
390
+ pregexp: [
391
+ { include: "@whitespace" },
392
+ // turns out that you can quote using regex control characters, aargh!
393
+ // for example; %r|kgjgaj| is ok (even though | is used for alternation)
394
+ // so, we need to match those first
395
+ [
396
+ /[^\(\{\[\\]/,
397
+ {
398
+ cases: {
399
+ "$#==$S3": { token: "regexp.delim", next: "@pop" },
400
+ "$#==$S2": { token: "regexp.delim", next: "@push" },
401
+ // nested delimiters are allowed..
402
+ "~[)}\\]]": "@brackets.regexp.escape.control",
403
+ "~@regexpctl": "regexp.escape.control",
404
+ "@default": "regexp"
405
+ }
406
+ }
407
+ ],
408
+ { include: "@regexcontrol" }
409
+ ],
410
+ // We match regular expression quite precisely
411
+ regexp: [
412
+ { include: "@regexcontrol" },
413
+ [/[^\\\/]/, "regexp"],
414
+ ["/[ixmp]*", { token: "regexp.delim" }, "@pop"]
415
+ ],
416
+ regexcontrol: [
417
+ [
418
+ /(\{)(\d+(?:,\d*)?)(\})/,
419
+ [
420
+ "@brackets.regexp.escape.control",
421
+ "regexp.escape.control",
422
+ "@brackets.regexp.escape.control"
423
+ ]
424
+ ],
425
+ [
426
+ /(\[)(\^?)/,
427
+ ["@brackets.regexp.escape.control", { token: "regexp.escape.control", next: "@regexrange" }]
428
+ ],
429
+ [/(\()(\?[:=!])/, ["@brackets.regexp.escape.control", "regexp.escape.control"]],
430
+ [/\(\?#/, { token: "regexp.escape.control", next: "@regexpcomment" }],
431
+ [/[()]/, "@brackets.regexp.escape.control"],
432
+ [/@regexpctl/, "regexp.escape.control"],
433
+ [/\\$/, "regexp.escape"],
434
+ [/@regexpesc/, "regexp.escape"],
435
+ [/\\\./, "regexp.invalid"],
436
+ [/#/, "regexp.escape", "@interpolated"]
437
+ ],
438
+ regexrange: [
439
+ [/-/, "regexp.escape.control"],
440
+ [/\^/, "regexp.invalid"],
441
+ [/\\$/, "regexp.escape"],
442
+ [/@regexpesc/, "regexp.escape"],
443
+ [/[^\]]/, "regexp"],
444
+ [/\]/, "@brackets.regexp.escape.control", "@pop"]
445
+ ],
446
+ regexpcomment: [
447
+ [/[^)]+/, "comment"],
448
+ [/\)/, { token: "regexp.escape.control", next: "@pop" }]
449
+ ],
450
+ // % quoted strings
451
+ // A bit repetitive since we need to often special case the kind of ending delimiter
452
+ pstring: [
453
+ [/%([qws])\(/, { token: "string.$1.delim", switchTo: "@qstring.$1.(.)" }],
454
+ [/%([qws])\[/, { token: "string.$1.delim", switchTo: "@qstring.$1.[.]" }],
455
+ [/%([qws])\{/, { token: "string.$1.delim", switchTo: "@qstring.$1.{.}" }],
456
+ [/%([qws])</, { token: "string.$1.delim", switchTo: "@qstring.$1.<.>" }],
457
+ [/%([qws])(@delim)/, { token: "string.$1.delim", switchTo: "@qstring.$1.$2.$2" }],
458
+ [/%r\(/, { token: "regexp.delim", switchTo: "@pregexp.(.)" }],
459
+ [/%r\[/, { token: "regexp.delim", switchTo: "@pregexp.[.]" }],
460
+ [/%r\{/, { token: "regexp.delim", switchTo: "@pregexp.{.}" }],
461
+ [/%r</, { token: "regexp.delim", switchTo: "@pregexp.<.>" }],
462
+ [/%r(@delim)/, { token: "regexp.delim", switchTo: "@pregexp.$1.$1" }],
463
+ [/%(x|W|Q?)\(/, { token: "string.$1.delim", switchTo: "@qqstring.$1.(.)" }],
464
+ [/%(x|W|Q?)\[/, { token: "string.$1.delim", switchTo: "@qqstring.$1.[.]" }],
465
+ [/%(x|W|Q?)\{/, { token: "string.$1.delim", switchTo: "@qqstring.$1.{.}" }],
466
+ [/%(x|W|Q?)</, { token: "string.$1.delim", switchTo: "@qqstring.$1.<.>" }],
467
+ [/%(x|W|Q?)(@delim)/, { token: "string.$1.delim", switchTo: "@qqstring.$1.$2.$2" }],
468
+ [/%([rqwsxW]|Q?)./, { token: "invalid", next: "@pop" }],
469
+ // recover
470
+ [/./, { token: "invalid", next: "@pop" }]
471
+ // recover
472
+ ],
473
+ // non-expanded quoted string.
474
+ // qstring.<kind>.<open>.<close>
475
+ // kind = q|w|s (single quote, array, symbol)
476
+ // open = open delimiter
477
+ // close = close delimiter
478
+ qstring: [
479
+ [/\\$/, "string.$S2.escape"],
480
+ [/\\./, "string.$S2.escape"],
481
+ [
482
+ /./,
483
+ {
484
+ cases: {
485
+ "$#==$S4": { token: "string.$S2.delim", next: "@pop" },
486
+ "$#==$S3": { token: "string.$S2.delim", next: "@push" },
487
+ // nested delimiters are allowed..
488
+ "@default": "string.$S2"
489
+ }
490
+ }
491
+ ]
492
+ ],
493
+ // expanded quoted string.
494
+ // qqstring.<kind>.<open>.<close>
495
+ // kind = Q|W|x (double quote, array, command)
496
+ // open = open delimiter
497
+ // close = close delimiter
498
+ qqstring: [[/#/, "string.$S2.escape", "@interpolated"], { include: "@qstring" }],
499
+ // whitespace & comments
500
+ whitespace: [
501
+ [/[ \t\r\n]+/, ""],
502
+ [/^\s*=begin\b/, "comment", "@comment"],
503
+ [/#.*$/, "comment"]
504
+ ],
505
+ comment: [
506
+ [/[^=]+/, "comment"],
507
+ [/^\s*=begin\b/, "comment.invalid"],
508
+ // nested comment
509
+ [/^\s*=end\b.*/, "comment", "@pop"],
510
+ [/[=]/, "comment"]
511
+ ]
512
+ }
513
+ };
514
+ export {
515
+ conf,
516
+ language
517
+ };
@@ -0,0 +1,6 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/*!-----------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Version: 0.52.0(f6dc0eb8fce67e57f6036f4769d92c1666cdf546)
4
+ * Released under the MIT license
5
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
6
+ *-----------------------------------------------------------------------------*/var conf={comments:{lineComment:"#",blockComment:["=begin","=end"]},brackets:[["(",")"],["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],indentationRules:{increaseIndentPattern:new RegExp(`^\\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)*(#.*)?$`),decreaseIndentPattern:new RegExp("^\\s*([}\\]]([,)]?\\s*(#|$)|\\.[a-zA-Z_]\\w*\\b)|(end|rescue|ensure|else|elsif|when)\\b)")}},language={tokenPostfix:".ruby",keywords:["__LINE__","__ENCODING__","__FILE__","BEGIN","END","alias","and","begin","break","case","class","def","defined?","do","else","elsif","end","ensure","for","false","if","in","module","next","nil","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield"],keywordops:["::","..","...","?",":","=>"],builtins:["require","public","private","include","extend","attr_reader","protected","private_class_method","protected_class_method","new"],declarations:["module","class","def","case","do","begin","for","if","while","until","unless"],linedecls:["def","case","do","begin","for","if","while","until","unless"],operators:["^","&","|","<=>","==","===","!~","=~",">",">=","<","<=","<<",">>","+","-","*","/","%","**","~","+@","-@","[]","[]=","`","+=","-=","*=","**=","/=","^=","%=","<<=",">>=","&=","&&=","||=","|="],brackets:[{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"}],symbols:/[=><!~?:&|+\-*\/\^%\.]+/,escape:/(?:[abefnrstv\\"'\n\r]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4})/,escapes:/\\(?:C\-(@escape|.)|c(@escape|.)|@escape)/,decpart:/\d(_?\d)*/,decimal:/0|@decpart/,delim:/[^a-zA-Z0-9\s\n\r]/,heredelim:/(?:\w+|'[^']*'|"[^"]*"|`[^`]*`)/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[AzZbBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})?/,tokenizer:{root:[[/^(\s*)([a-z_]\w*[!?=]?)/,["white",{cases:{"for|until|while":{token:"keyword.$2",next:"@dodecl.$2"},"@declarations":{token:"keyword.$2",next:"@root.$2"},end:{token:"keyword.$S2",next:"@pop"},"@keywords":"keyword","@builtins":"predefined","@default":"identifier"}}]],[/[a-z_]\w*[!?=]?/,{cases:{"if|unless|while|until":{token:"keyword.$0x",next:"@modifier.$0x"},for:{token:"keyword.$2",next:"@dodecl.$2"},"@linedecls":{token:"keyword.$0",next:"@root.$0"},end:{token:"keyword.$S2",next:"@pop"},"@keywords":"keyword","@builtins":"predefined","@default":"identifier"}}],[/[A-Z][\w]*[!?=]?/,"constructor.identifier"],[/\$[\w]*/,"global.constant"],[/@[\w]*/,"namespace.instance.identifier"],[/@@@[\w]*/,"namespace.class.identifier"],[/<<[-~](@heredelim).*/,{token:"string.heredoc.delimiter",next:"@heredoc.$1"}],[/[ \t\r\n]+<<(@heredelim).*/,{token:"string.heredoc.delimiter",next:"@heredoc.$1"}],[/^<<(@heredelim).*/,{token:"string.heredoc.delimiter",next:"@heredoc.$1"}],{include:"@whitespace"},[/"/,{token:"string.d.delim",next:'@dstring.d."'}],[/'/,{token:"string.sq.delim",next:"@sstring.sq"}],[/%([rsqxwW]|Q?)/,{token:"@rematch",next:"pstring"}],[/`/,{token:"string.x.delim",next:"@dstring.x.`"}],[/:(\w|[$@])\w*[!?=]?/,"string.s"],[/:"/,{token:"string.s.delim",next:'@dstring.s."'}],[/:'/,{token:"string.s.delim",next:"@sstring.s"}],[/\/(?=(\\\/|[^\/\n])+\/)/,{token:"regexp.delim",next:"@regexp"}],[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@keywordops":"keyword","@operators":"operator","@default":""}}],[/[;,]/,"delimiter"],[/0[xX][0-9a-fA-F](_?[0-9a-fA-F])*/,"number.hex"],[/0[_oO][0-7](_?[0-7])*/,"number.octal"],[/0[bB][01](_?[01])*/,"number.binary"],[/0[dD]@decpart/,"number"],[/@decimal((\.@decpart)?([eE][\-+]?@decpart)?)/,{cases:{$1:"number.float","@default":"number"}}]],dodecl:[[/^/,{token:"",switchTo:"@root.$S2"}],[/[a-z_]\w*[!?=]?/,{cases:{end:{token:"keyword.$S2",next:"@pop"},do:{token:"keyword",switchTo:"@root.$S2"},"@linedecls":{token:"@rematch",switchTo:"@root.$S2"},"@keywords":"keyword","@builtins":"predefined","@default":"identifier"}}],{include:"@root"}],modifier:[[/^/,"","@pop"],[/[a-z_]\w*[!?=]?/,{cases:{end:{token:"keyword.$S2",next:"@pop"},"then|else|elsif|do":{token:"keyword",switchTo:"@root.$S2"},"@linedecls":{token:"@rematch",switchTo:"@root.$S2"},"@keywords":"keyword","@builtins":"predefined","@default":"identifier"}}],{include:"@root"}],sstring:[[/[^\\']+/,"string.$S2"],[/\\\\|\\'|\\$/,"string.$S2.escape"],[/\\./,"string.$S2.invalid"],[/'/,{token:"string.$S2.delim",next:"@pop"}]],dstring:[[/[^\\`"#]+/,"string.$S2"],[/#/,"string.$S2.escape","@interpolated"],[/\\$/,"string.$S2.escape"],[/@escapes/,"string.$S2.escape"],[/\\./,"string.$S2.escape.invalid"],[/[`"]/,{cases:{"$#==$S3":{token:"string.$S2.delim",next:"@pop"},"@default":"string.$S2"}}]],heredoc:[[/^(\s*)(@heredelim)$/,{cases:{"$2==$S2":["string.heredoc",{token:"string.heredoc.delimiter",next:"@pop"}],"@default":["string.heredoc","string.heredoc"]}}],[/.*/,"string.heredoc"]],interpolated:[[/\$\w*/,"global.constant","@pop"],[/@\w*/,"namespace.class.identifier","@pop"],[/@@@\w*/,"namespace.instance.identifier","@pop"],[/[{]/,{token:"string.escape.curly",switchTo:"@interpolated_compound"}],["","","@pop"]],interpolated_compound:[[/[}]/,{token:"string.escape.curly",next:"@pop"}],{include:"@root"}],pregexp:[{include:"@whitespace"},[/[^\(\{\[\\]/,{cases:{"$#==$S3":{token:"regexp.delim",next:"@pop"},"$#==$S2":{token:"regexp.delim",next:"@push"},"~[)}\\]]":"@brackets.regexp.escape.control","~@regexpctl":"regexp.escape.control","@default":"regexp"}}],{include:"@regexcontrol"}],regexp:[{include:"@regexcontrol"},[/[^\\\/]/,"regexp"],["/[ixmp]*",{token:"regexp.delim"},"@pop"]],regexcontrol:[[/(\{)(\d+(?:,\d*)?)(\})/,["@brackets.regexp.escape.control","regexp.escape.control","@brackets.regexp.escape.control"]],[/(\[)(\^?)/,["@brackets.regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?[:=!])/,["@brackets.regexp.escape.control","regexp.escape.control"]],[/\(\?#/,{token:"regexp.escape.control",next:"@regexpcomment"}],[/[()]/,"@brackets.regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/\\$/,"regexp.escape"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/#/,"regexp.escape","@interpolated"]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/\\$/,"regexp.escape"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,"@brackets.regexp.escape.control","@pop"]],regexpcomment:[[/[^)]+/,"comment"],[/\)/,{token:"regexp.escape.control",next:"@pop"}]],pstring:[[/%([qws])\(/,{token:"string.$1.delim",switchTo:"@qstring.$1.(.)"}],[/%([qws])\[/,{token:"string.$1.delim",switchTo:"@qstring.$1.[.]"}],[/%([qws])\{/,{token:"string.$1.delim",switchTo:"@qstring.$1.{.}"}],[/%([qws])</,{token:"string.$1.delim",switchTo:"@qstring.$1.<.>"}],[/%([qws])(@delim)/,{token:"string.$1.delim",switchTo:"@qstring.$1.$2.$2"}],[/%r\(/,{token:"regexp.delim",switchTo:"@pregexp.(.)"}],[/%r\[/,{token:"regexp.delim",switchTo:"@pregexp.[.]"}],[/%r\{/,{token:"regexp.delim",switchTo:"@pregexp.{.}"}],[/%r</,{token:"regexp.delim",switchTo:"@pregexp.<.>"}],[/%r(@delim)/,{token:"regexp.delim",switchTo:"@pregexp.$1.$1"}],[/%(x|W|Q?)\(/,{token:"string.$1.delim",switchTo:"@qqstring.$1.(.)"}],[/%(x|W|Q?)\[/,{token:"string.$1.delim",switchTo:"@qqstring.$1.[.]"}],[/%(x|W|Q?)\{/,{token:"string.$1.delim",switchTo:"@qqstring.$1.{.}"}],[/%(x|W|Q?)</,{token:"string.$1.delim",switchTo:"@qqstring.$1.<.>"}],[/%(x|W|Q?)(@delim)/,{token:"string.$1.delim",switchTo:"@qqstring.$1.$2.$2"}],[/%([rqwsxW]|Q?)./,{token:"invalid",next:"@pop"}],[/./,{token:"invalid",next:"@pop"}]],qstring:[[/\\$/,"string.$S2.escape"],[/\\./,"string.$S2.escape"],[/./,{cases:{"$#==$S4":{token:"string.$S2.delim",next:"@pop"},"$#==$S3":{token:"string.$S2.delim",next:"@push"},"@default":"string.$S2"}}]],qqstring:[[/#/,"string.$S2.escape","@interpolated"],{include:"@qstring"}],whitespace:[[/[ \t\r\n]+/,""],[/^\s*=begin\b/,"comment","@comment"],[/#.*$/,"comment"]],comment:[[/[^=]+/,"comment"],[/^\s*=begin\b/,"comment.invalid"],[/^\s*=end\b.*/,"comment","@pop"],[/[=]/,"comment"]]}};exports.conf=conf;exports.language=language;