@univerjs/uniscript 0.4.0-alpha.0 → 0.4.0-alpha.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) 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 +10 -17
@@ -0,0 +1,582 @@
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: ["/*", "*/"]
11
+ },
12
+ brackets: [
13
+ ["{", "}"],
14
+ ["[", "]"],
15
+ ["(", ")"],
16
+ ["begin", "end"],
17
+ ["case", "endcase"],
18
+ ["casex", "endcase"],
19
+ ["casez", "endcase"],
20
+ ["checker", "endchecker"],
21
+ ["class", "endclass"],
22
+ ["clocking", "endclocking"],
23
+ ["config", "endconfig"],
24
+ ["function", "endfunction"],
25
+ ["generate", "endgenerate"],
26
+ ["group", "endgroup"],
27
+ ["interface", "endinterface"],
28
+ ["module", "endmodule"],
29
+ ["package", "endpackage"],
30
+ ["primitive", "endprimitive"],
31
+ ["program", "endprogram"],
32
+ ["property", "endproperty"],
33
+ ["specify", "endspecify"],
34
+ ["sequence", "endsequence"],
35
+ ["table", "endtable"],
36
+ ["task", "endtask"]
37
+ ],
38
+ autoClosingPairs: [
39
+ { open: "[", close: "]" },
40
+ { open: "{", close: "}" },
41
+ { open: "(", close: ")" },
42
+ { open: "'", close: "'", notIn: ["string", "comment"] },
43
+ { open: '"', close: '"', notIn: ["string"] }
44
+ ],
45
+ surroundingPairs: [
46
+ { open: "{", close: "}" },
47
+ { open: "[", close: "]" },
48
+ { open: "(", close: ")" },
49
+ { open: '"', close: '"' },
50
+ { open: "'", close: "'" }
51
+ ],
52
+ folding: {
53
+ offSide: !1,
54
+ markers: {
55
+ start: new RegExp(
56
+ "^(?:\\s*|.*(?!\\/[\\/\\*])[^\\w])(?:begin|case(x|z)?|class|clocking|config|covergroup|function|generate|interface|module|package|primitive|property|program|sequence|specify|table|task)\\b"
57
+ ),
58
+ end: new RegExp(
59
+ "^(?:\\s*|.*(?!\\/[\\/\\*])[^\\w])(?:end|endcase|endclass|endclocking|endconfig|endgroup|endfunction|endgenerate|endinterface|endmodule|endpackage|endprimitive|endproperty|endprogram|endsequence|endspecify|endtable|endtask)\\b"
60
+ )
61
+ }
62
+ }
63
+ }, language = {
64
+ defaultToken: "",
65
+ tokenPostfix: ".sv",
66
+ brackets: [
67
+ { token: "delimiter.curly", open: "{", close: "}" },
68
+ { token: "delimiter.parenthesis", open: "(", close: ")" },
69
+ { token: "delimiter.square", open: "[", close: "]" },
70
+ { token: "delimiter.angle", open: "<", close: ">" }
71
+ ],
72
+ keywords: [
73
+ "accept_on",
74
+ "alias",
75
+ "always",
76
+ "always_comb",
77
+ "always_ff",
78
+ "always_latch",
79
+ "and",
80
+ "assert",
81
+ "assign",
82
+ "assume",
83
+ "automatic",
84
+ "before",
85
+ "begin",
86
+ "bind",
87
+ "bins",
88
+ "binsof",
89
+ "bit",
90
+ "break",
91
+ "buf",
92
+ "bufif0",
93
+ "bufif1",
94
+ "byte",
95
+ "case",
96
+ "casex",
97
+ "casez",
98
+ "cell",
99
+ "chandle",
100
+ "checker",
101
+ "class",
102
+ "clocking",
103
+ "cmos",
104
+ "config",
105
+ "const",
106
+ "constraint",
107
+ "context",
108
+ "continue",
109
+ "cover",
110
+ "covergroup",
111
+ "coverpoint",
112
+ "cross",
113
+ "deassign",
114
+ "default",
115
+ "defparam",
116
+ "design",
117
+ "disable",
118
+ "dist",
119
+ "do",
120
+ "edge",
121
+ "else",
122
+ "end",
123
+ "endcase",
124
+ "endchecker",
125
+ "endclass",
126
+ "endclocking",
127
+ "endconfig",
128
+ "endfunction",
129
+ "endgenerate",
130
+ "endgroup",
131
+ "endinterface",
132
+ "endmodule",
133
+ "endpackage",
134
+ "endprimitive",
135
+ "endprogram",
136
+ "endproperty",
137
+ "endspecify",
138
+ "endsequence",
139
+ "endtable",
140
+ "endtask",
141
+ "enum",
142
+ "event",
143
+ "eventually",
144
+ "expect",
145
+ "export",
146
+ "extends",
147
+ "extern",
148
+ "final",
149
+ "first_match",
150
+ "for",
151
+ "force",
152
+ "foreach",
153
+ "forever",
154
+ "fork",
155
+ "forkjoin",
156
+ "function",
157
+ "generate",
158
+ "genvar",
159
+ "global",
160
+ "highz0",
161
+ "highz1",
162
+ "if",
163
+ "iff",
164
+ "ifnone",
165
+ "ignore_bins",
166
+ "illegal_bins",
167
+ "implements",
168
+ "implies",
169
+ "import",
170
+ "incdir",
171
+ "include",
172
+ "initial",
173
+ "inout",
174
+ "input",
175
+ "inside",
176
+ "instance",
177
+ "int",
178
+ "integer",
179
+ "interconnect",
180
+ "interface",
181
+ "intersect",
182
+ "join",
183
+ "join_any",
184
+ "join_none",
185
+ "large",
186
+ "let",
187
+ "liblist",
188
+ "library",
189
+ "local",
190
+ "localparam",
191
+ "logic",
192
+ "longint",
193
+ "macromodule",
194
+ "matches",
195
+ "medium",
196
+ "modport",
197
+ "module",
198
+ "nand",
199
+ "negedge",
200
+ "nettype",
201
+ "new",
202
+ "nexttime",
203
+ "nmos",
204
+ "nor",
205
+ "noshowcancelled",
206
+ "not",
207
+ "notif0",
208
+ "notif1",
209
+ "null",
210
+ "or",
211
+ "output",
212
+ "package",
213
+ "packed",
214
+ "parameter",
215
+ "pmos",
216
+ "posedge",
217
+ "primitive",
218
+ "priority",
219
+ "program",
220
+ "property",
221
+ "protected",
222
+ "pull0",
223
+ "pull1",
224
+ "pulldown",
225
+ "pullup",
226
+ "pulsestyle_ondetect",
227
+ "pulsestyle_onevent",
228
+ "pure",
229
+ "rand",
230
+ "randc",
231
+ "randcase",
232
+ "randsequence",
233
+ "rcmos",
234
+ "real",
235
+ "realtime",
236
+ "ref",
237
+ "reg",
238
+ "reject_on",
239
+ "release",
240
+ "repeat",
241
+ "restrict",
242
+ "return",
243
+ "rnmos",
244
+ "rpmos",
245
+ "rtran",
246
+ "rtranif0",
247
+ "rtranif1",
248
+ "s_always",
249
+ "s_eventually",
250
+ "s_nexttime",
251
+ "s_until",
252
+ "s_until_with",
253
+ "scalared",
254
+ "sequence",
255
+ "shortint",
256
+ "shortreal",
257
+ "showcancelled",
258
+ "signed",
259
+ "small",
260
+ "soft",
261
+ "solve",
262
+ "specify",
263
+ "specparam",
264
+ "static",
265
+ "string",
266
+ "strong",
267
+ "strong0",
268
+ "strong1",
269
+ "struct",
270
+ "super",
271
+ "supply0",
272
+ "supply1",
273
+ "sync_accept_on",
274
+ "sync_reject_on",
275
+ "table",
276
+ "tagged",
277
+ "task",
278
+ "this",
279
+ "throughout",
280
+ "time",
281
+ "timeprecision",
282
+ "timeunit",
283
+ "tran",
284
+ "tranif0",
285
+ "tranif1",
286
+ "tri",
287
+ "tri0",
288
+ "tri1",
289
+ "triand",
290
+ "trior",
291
+ "trireg",
292
+ "type",
293
+ "typedef",
294
+ "union",
295
+ "unique",
296
+ "unique0",
297
+ "unsigned",
298
+ "until",
299
+ "until_with",
300
+ "untyped",
301
+ "use",
302
+ "uwire",
303
+ "var",
304
+ "vectored",
305
+ "virtual",
306
+ "void",
307
+ "wait",
308
+ "wait_order",
309
+ "wand",
310
+ "weak",
311
+ "weak0",
312
+ "weak1",
313
+ "while",
314
+ "wildcard",
315
+ "wire",
316
+ "with",
317
+ "within",
318
+ "wor",
319
+ "xnor",
320
+ "xor"
321
+ ],
322
+ builtin_gates: [
323
+ "and",
324
+ "nand",
325
+ "nor",
326
+ "or",
327
+ "xor",
328
+ "xnor",
329
+ "buf",
330
+ "not",
331
+ "bufif0",
332
+ "bufif1",
333
+ "notif1",
334
+ "notif0",
335
+ "cmos",
336
+ "nmos",
337
+ "pmos",
338
+ "rcmos",
339
+ "rnmos",
340
+ "rpmos",
341
+ "tran",
342
+ "tranif1",
343
+ "tranif0",
344
+ "rtran",
345
+ "rtranif1",
346
+ "rtranif0"
347
+ ],
348
+ operators: [
349
+ // assignment operators
350
+ "=",
351
+ "+=",
352
+ "-=",
353
+ "*=",
354
+ "/=",
355
+ "%=",
356
+ "&=",
357
+ "|=",
358
+ "^=",
359
+ "<<=",
360
+ ">>+",
361
+ "<<<=",
362
+ ">>>=",
363
+ // conditional expression
364
+ "?",
365
+ ":",
366
+ // Unary operators
367
+ "+",
368
+ "-",
369
+ "!",
370
+ "~",
371
+ "&",
372
+ "~&",
373
+ "|",
374
+ "~|",
375
+ "^",
376
+ "~^",
377
+ "^~",
378
+ //binary operators
379
+ "+",
380
+ "-",
381
+ "*",
382
+ "/",
383
+ "%",
384
+ "==",
385
+ "!=",
386
+ "===",
387
+ "!==",
388
+ "==?",
389
+ "!=?",
390
+ "&&",
391
+ "||",
392
+ "**",
393
+ "<",
394
+ "<=",
395
+ ">",
396
+ ">=",
397
+ "&",
398
+ "|",
399
+ "^",
400
+ ">>",
401
+ "<<",
402
+ ">>>",
403
+ "<<<",
404
+ // increment or decrement operator
405
+ "++",
406
+ "--",
407
+ //binary logical operator
408
+ "->",
409
+ "<->",
410
+ // binary set membership operator
411
+ "inside",
412
+ // binary distrubution operator
413
+ "dist",
414
+ "::",
415
+ "+:",
416
+ "-:",
417
+ "*>",
418
+ "&&&",
419
+ "|->",
420
+ "|=>",
421
+ "#=#"
422
+ ],
423
+ // we include these common regular expressions
424
+ symbols: /[=><!~?:&|+\-*\/\^%#]+/,
425
+ escapes: /%%|\\(?:[antvf\\"']|x[0-9A-Fa-f]{1,2}|[0-7]{1,3})/,
426
+ identifier: /(?:[a-zA-Z_][a-zA-Z0-9_$\.]*|\\\S+ )/,
427
+ systemcall: /[$][a-zA-Z0-9_]+/,
428
+ timeunits: /s|ms|us|ns|ps|fs/,
429
+ // The main tokenizer for our languages
430
+ tokenizer: {
431
+ root: [
432
+ // module instances
433
+ [
434
+ /^(\s*)(@identifier)/,
435
+ [
436
+ "",
437
+ {
438
+ cases: {
439
+ "@builtin_gates": {
440
+ token: "keyword.$2",
441
+ next: "@module_instance"
442
+ },
443
+ table: {
444
+ token: "keyword.$2",
445
+ next: "@table"
446
+ },
447
+ "@keywords": { token: "keyword.$2" },
448
+ "@default": {
449
+ token: "identifier",
450
+ next: "@module_instance"
451
+ }
452
+ }
453
+ }
454
+ ]
455
+ ],
456
+ // include statements
457
+ [/^\s*`include/, { token: "keyword.directive.include", next: "@include" }],
458
+ // Preprocessor directives
459
+ [/^\s*`\s*\w+/, "keyword"],
460
+ // identifiers and keywords
461
+ { include: "@identifier_or_keyword" },
462
+ // whitespace and comments
463
+ { include: "@whitespace" },
464
+ // (* attributes *).
465
+ [/\(\*.*\*\)/, "annotation"],
466
+ // Systemcall
467
+ [/@systemcall/, "variable.predefined"],
468
+ // delimiters and operators
469
+ [/[{}()\[\]]/, "@brackets"],
470
+ [/[<>](?!@symbols)/, "@brackets"],
471
+ [
472
+ /@symbols/,
473
+ {
474
+ cases: {
475
+ "@operators": "delimiter",
476
+ "@default": ""
477
+ }
478
+ }
479
+ ],
480
+ // numbers
481
+ { include: "@numbers" },
482
+ // delimiter: after number because of .\d floats
483
+ [/[;,.]/, "delimiter"],
484
+ // strings
485
+ { include: "@strings" }
486
+ ],
487
+ identifier_or_keyword: [
488
+ [
489
+ /@identifier/,
490
+ {
491
+ cases: {
492
+ "@keywords": { token: "keyword.$0" },
493
+ "@default": "identifier"
494
+ }
495
+ }
496
+ ]
497
+ ],
498
+ numbers: [
499
+ [/\d+?[\d_]*(?:\.[\d_]+)?[eE][\-+]?\d+/, "number.float"],
500
+ [/\d+?[\d_]*\.[\d_]+(?:\s*@timeunits)?/, "number.float"],
501
+ [/(?:\d+?[\d_]*\s*)?'[sS]?[dD]\s*[0-9xXzZ?]+?[0-9xXzZ?_]*/, "number"],
502
+ [/(?:\d+?[\d_]*\s*)?'[sS]?[bB]\s*[0-1xXzZ?]+?[0-1xXzZ?_]*/, "number.binary"],
503
+ [/(?:\d+?[\d_]*\s*)?'[sS]?[oO]\s*[0-7xXzZ?]+?[0-7xXzZ?_]*/, "number.octal"],
504
+ [/(?:\d+?[\d_]*\s*)?'[sS]?[hH]\s*[0-9a-fA-FxXzZ?]+?[0-9a-fA-FxXzZ?_]*/, "number.hex"],
505
+ [/1step/, "number"],
506
+ [/[\dxXzZ]+?[\dxXzZ_]*(?:\s*@timeunits)?/, "number"],
507
+ [/'[01xXzZ]+/, "number"]
508
+ ],
509
+ module_instance: [
510
+ { include: "@whitespace" },
511
+ [/(#?)(\()/, ["", { token: "@brackets", next: "@port_connection" }]],
512
+ [/@identifier\s*[;={}\[\],]/, { token: "@rematch", next: "@pop" }],
513
+ [/@symbols|[;={}\[\],]/, { token: "@rematch", next: "@pop" }],
514
+ [/@identifier/, "type"],
515
+ [/;/, "delimiter", "@pop"]
516
+ ],
517
+ port_connection: [
518
+ { include: "@identifier_or_keyword" },
519
+ { include: "@whitespace" },
520
+ [/@systemcall/, "variable.predefined"],
521
+ { include: "@numbers" },
522
+ { include: "@strings" },
523
+ [/[,]/, "delimiter"],
524
+ [/\(/, "@brackets", "@port_connection"],
525
+ [/\)/, "@brackets", "@pop"]
526
+ ],
527
+ whitespace: [
528
+ [/[ \t\r\n]+/, ""],
529
+ [/\/\*/, "comment", "@comment"],
530
+ [/\/\/.*$/, "comment"]
531
+ ],
532
+ comment: [
533
+ [/[^\/*]+/, "comment"],
534
+ [/\*\//, "comment", "@pop"],
535
+ [/[\/*]/, "comment"]
536
+ ],
537
+ strings: [
538
+ [/"([^"\\]|\\.)*$/, "string.invalid"],
539
+ // non-teminated string
540
+ [/"/, "string", "@string"]
541
+ ],
542
+ string: [
543
+ [/[^\\"]+/, "string"],
544
+ [/@escapes/, "string.escape"],
545
+ [/\\./, "string.escape.invalid"],
546
+ [/"/, "string", "@pop"]
547
+ ],
548
+ include: [
549
+ [
550
+ /(\s*)(")([\w*\/*]*)(.\w*)(")/,
551
+ [
552
+ "",
553
+ "string.include.identifier",
554
+ "string.include.identifier",
555
+ "string.include.identifier",
556
+ { token: "string.include.identifier", next: "@pop" }
557
+ ]
558
+ ],
559
+ [
560
+ /(\s*)(<)([\w*\/*]*)(.\w*)(>)/,
561
+ [
562
+ "",
563
+ "string.include.identifier",
564
+ "string.include.identifier",
565
+ "string.include.identifier",
566
+ { token: "string.include.identifier", next: "@pop" }
567
+ ]
568
+ ]
569
+ ],
570
+ table: [
571
+ { include: "@whitespace" },
572
+ [/[()]/, "@brackets"],
573
+ [/[:;]/, "delimiter"],
574
+ [/[01\-*?xXbBrRfFpPnN]/, "variable.predefined"],
575
+ ["endtable", "keyword.endtable", "@pop"]
576
+ ]
577
+ }
578
+ };
579
+ export {
580
+ conf,
581
+ language
582
+ };