@codingame/monaco-vscode-standalone-languages 23.1.1 → 23.2.1

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/index.js +48 -82
  2. package/package.json +2 -2
  3. package/_.contribution.js +0 -74
  4. package/abap/abap.contribution.js +0 -19
  5. package/abap/abap.js +0 -1406
  6. package/apex/apex.contribution.js +0 -20
  7. package/apex/apex.js +0 -338
  8. package/azcli/azcli.contribution.js +0 -19
  9. package/azcli/azcli.js +0 -76
  10. package/bat/bat.contribution.js +0 -19
  11. package/bat/bat.js +0 -108
  12. package/bicep/bicep.contribution.js +0 -19
  13. package/bicep/bicep.js +0 -117
  14. package/cameligo/cameligo.contribution.js +0 -19
  15. package/cameligo/cameligo.js +0 -182
  16. package/clojure/clojure.contribution.js +0 -19
  17. package/clojure/clojure.js +0 -769
  18. package/coffee/coffee.contribution.js +0 -20
  19. package/coffee/coffee.js +0 -240
  20. package/cpp/cpp.contribution.js +0 -29
  21. package/cpp/cpp.js +0 -397
  22. package/csharp/csharp.contribution.js +0 -19
  23. package/csharp/csharp.js +0 -334
  24. package/csp/csp.contribution.js +0 -19
  25. package/csp/csp.js +0 -61
  26. package/css/css.contribution.js +0 -20
  27. package/css/css.js +0 -193
  28. package/cypher/cypher.contribution.js +0 -19
  29. package/cypher/cypher.js +0 -271
  30. package/dart/dart.contribution.js +0 -20
  31. package/dart/dart.js +0 -289
  32. package/dockerfile/dockerfile.contribution.js +0 -20
  33. package/dockerfile/dockerfile.js +0 -138
  34. package/ecl/ecl.contribution.js +0 -19
  35. package/ecl/ecl.js +0 -464
  36. package/elixir/elixir.contribution.js +0 -19
  37. package/elixir/elixir.js +0 -577
  38. package/flow9/flow9.contribution.js +0 -19
  39. package/flow9/flow9.js +0 -150
  40. package/freemarker2/freemarker2.contribution.js +0 -73
  41. package/freemarker2/freemarker2.js +0 -1016
  42. package/fsharp/fsharp.contribution.js +0 -19
  43. package/fsharp/fsharp.js +0 -225
  44. package/go/go.contribution.js +0 -19
  45. package/go/go.js +0 -226
  46. package/graphql/graphql.contribution.js +0 -20
  47. package/graphql/graphql.js +0 -159
  48. package/handlebars/handlebars.contribution.js +0 -20
  49. package/handlebars/handlebars.js +0 -439
  50. package/hcl/hcl.contribution.js +0 -19
  51. package/hcl/hcl.js +0 -191
  52. package/html/html.contribution.js +0 -20
  53. package/html/html.js +0 -328
  54. package/ini/ini.contribution.js +0 -20
  55. package/ini/ini.js +0 -79
  56. package/java/java.contribution.js +0 -20
  57. package/java/java.js +0 -240
  58. package/javascript/javascript.contribution.js +0 -22
  59. package/javascript/javascript.js +0 -77
  60. package/julia/julia.contribution.js +0 -19
  61. package/julia/julia.js +0 -519
  62. package/kotlin/kotlin.contribution.js +0 -20
  63. package/kotlin/kotlin.js +0 -261
  64. package/less/less.contribution.js +0 -20
  65. package/less/less.js +0 -169
  66. package/lexon/lexon.contribution.js +0 -19
  67. package/lexon/lexon.js +0 -165
  68. package/liquid/liquid.contribution.js +0 -20
  69. package/liquid/liquid.js +0 -260
  70. package/lua/lua.contribution.js +0 -19
  71. package/lua/lua.js +0 -170
  72. package/m3/m3.contribution.js +0 -19
  73. package/m3/m3.js +0 -218
  74. package/markdown/markdown.contribution.js +0 -19
  75. package/markdown/markdown.js +0 -237
  76. package/mdx/mdx.contribution.js +0 -19
  77. package/mdx/mdx.js +0 -184
  78. package/mips/mips.contribution.js +0 -20
  79. package/mips/mips.js +0 -206
  80. package/msdax/msdax.contribution.js +0 -19
  81. package/msdax/msdax.js +0 -383
  82. package/mysql/mysql.contribution.js +0 -19
  83. package/mysql/mysql.js +0 -886
  84. package/objective-c/objective-c.contribution.js +0 -19
  85. package/objective-c/objective-c.js +0 -191
  86. package/pascal/pascal.contribution.js +0 -20
  87. package/pascal/pascal.js +0 -259
  88. package/pascaligo/pascaligo.contribution.js +0 -19
  89. package/pascaligo/pascaligo.js +0 -172
  90. package/perl/perl.contribution.js +0 -19
  91. package/perl/perl.js +0 -634
  92. package/pgsql/pgsql.contribution.js +0 -19
  93. package/pgsql/pgsql.js +0 -859
  94. package/php/php.contribution.js +0 -20
  95. package/php/php.js +0 -508
  96. package/pla/pla.contribution.js +0 -18
  97. package/pla/pla.js +0 -145
  98. package/postiats/postiats.contribution.js +0 -19
  99. package/postiats/postiats.js +0 -915
  100. package/powerquery/powerquery.contribution.js +0 -19
  101. package/powerquery/powerquery.js +0 -898
  102. package/powershell/powershell.contribution.js +0 -19
  103. package/powershell/powershell.js +0 -247
  104. package/protobuf/protobuf.contribution.js +0 -19
  105. package/protobuf/protobuf.js +0 -428
  106. package/pug/pug.contribution.js +0 -19
  107. package/pug/pug.js +0 -410
  108. package/python/python.contribution.js +0 -20
  109. package/python/python.js +0 -320
  110. package/qsharp/qsharp.contribution.js +0 -19
  111. package/qsharp/qsharp.js +0 -309
  112. package/r/r.contribution.js +0 -19
  113. package/r/r.js +0 -251
  114. package/razor/razor.contribution.js +0 -20
  115. package/razor/razor.js +0 -570
  116. package/redis/redis.contribution.js +0 -19
  117. package/redis/redis.js +0 -310
  118. package/redshift/redshift.contribution.js +0 -19
  119. package/redshift/redshift.js +0 -817
  120. package/restructuredtext/restructuredtext.contribution.js +0 -19
  121. package/restructuredtext/restructuredtext.js +0 -182
  122. package/ruby/ruby.contribution.js +0 -20
  123. package/ruby/ruby.js +0 -519
  124. package/rust/rust.contribution.js +0 -19
  125. package/rust/rust.js +0 -351
  126. package/sb/sb.contribution.js +0 -19
  127. package/sb/sb.js +0 -123
  128. package/scala/scala.contribution.js +0 -20
  129. package/scala/scala.js +0 -378
  130. package/scheme/scheme.contribution.js +0 -19
  131. package/scheme/scheme.js +0 -116
  132. package/scss/scss.contribution.js +0 -20
  133. package/scss/scss.js +0 -268
  134. package/shell/shell.contribution.js +0 -19
  135. package/shell/shell.js +0 -229
  136. package/solidity/solidity.contribution.js +0 -19
  137. package/solidity/solidity.js +0 -1375
  138. package/sophia/sophia.contribution.js +0 -19
  139. package/sophia/sophia.js +0 -207
  140. package/sparql/sparql.contribution.js +0 -19
  141. package/sparql/sparql.js +0 -209
  142. package/sql/sql.contribution.js +0 -19
  143. package/sql/sql.js +0 -861
  144. package/st/st.contribution.js +0 -19
  145. package/st/st.js +0 -424
  146. package/swift/swift.contribution.js +0 -20
  147. package/swift/swift.js +0 -320
  148. package/systemverilog/systemverilog.contribution.js +0 -29
  149. package/systemverilog/systemverilog.js +0 -584
  150. package/tcl/tcl.contribution.js +0 -19
  151. package/tcl/tcl.js +0 -240
  152. package/twig/twig.contribution.js +0 -20
  153. package/twig/twig.js +0 -400
  154. package/typescript/typescript.contribution.js +0 -20
  155. package/typescript/typescript.js +0 -362
  156. package/typespec/typespec.contribution.js +0 -19
  157. package/typespec/typespec.js +0 -135
  158. package/vb/vb.contribution.js +0 -19
  159. package/vb/vb.js +0 -380
  160. package/wgsl/wgsl.contribution.js +0 -19
  161. package/wgsl/wgsl.js +0 -461
  162. package/xml/xml.contribution.js +0 -39
  163. package/xml/xml.js +0 -114
  164. package/yaml/yaml.contribution.js +0 -20
  165. package/yaml/yaml.js +0 -225
@@ -1,915 +0,0 @@
1
- /*!-----------------------------------------------------------------------------
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.54.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/postiats/postiats.ts
10
- var conf = {
11
- comments: {
12
- lineComment: "//",
13
- blockComment: ["(*", "*)"]
14
- },
15
- brackets: [
16
- ["{", "}"],
17
- ["[", "]"],
18
- ["(", ")"],
19
- ["<", ">"]
20
- ],
21
- autoClosingPairs: [
22
- { open: '"', close: '"', notIn: ["string", "comment"] },
23
- { open: "{", close: "}", notIn: ["string", "comment"] },
24
- { open: "[", close: "]", notIn: ["string", "comment"] },
25
- { open: "(", close: ")", notIn: ["string", "comment"] }
26
- ]
27
- };
28
- var language = {
29
- tokenPostfix: ".pats",
30
- // TODO: staload and dynload are followed by a special kind of string literals
31
- // with {$IDENTIFER} variables, and it also may make sense to highlight
32
- // the punctuation (. and / and \) differently.
33
- // Set defaultToken to invalid to see what you do not tokenize yet
34
- defaultToken: "invalid",
35
- // keyword reference: https://github.com/githwxi/ATS-Postiats/blob/master/src/pats_lexing_token.dats
36
- keywords: [
37
- //
38
- "abstype",
39
- // ABSTYPE
40
- "abst0ype",
41
- // ABST0YPE
42
- "absprop",
43
- // ABSPROP
44
- "absview",
45
- // ABSVIEW
46
- "absvtype",
47
- // ABSVIEWTYPE
48
- "absviewtype",
49
- // ABSVIEWTYPE
50
- "absvt0ype",
51
- // ABSVIEWT0YPE
52
- "absviewt0ype",
53
- // ABSVIEWT0YPE
54
- //
55
- "as",
56
- // T_AS
57
- //
58
- "and",
59
- // T_AND
60
- //
61
- "assume",
62
- // T_ASSUME
63
- //
64
- "begin",
65
- // T_BEGIN
66
- //
67
- /*
68
- "case", // CASE
69
- */
70
- //
71
- "classdec",
72
- // T_CLASSDEC
73
- //
74
- "datasort",
75
- // T_DATASORT
76
- //
77
- "datatype",
78
- // DATATYPE
79
- "dataprop",
80
- // DATAPROP
81
- "dataview",
82
- // DATAVIEW
83
- "datavtype",
84
- // DATAVIEWTYPE
85
- "dataviewtype",
86
- // DATAVIEWTYPE
87
- //
88
- "do",
89
- // T_DO
90
- //
91
- "end",
92
- // T_END
93
- //
94
- "extern",
95
- // T_EXTERN
96
- "extype",
97
- // T_EXTYPE
98
- "extvar",
99
- // T_EXTVAR
100
- //
101
- "exception",
102
- // T_EXCEPTION
103
- //
104
- "fn",
105
- // FN // non-recursive
106
- "fnx",
107
- // FNX // mutual tail-rec.
108
- "fun",
109
- // FUN // general-recursive
110
- //
111
- "prfn",
112
- // PRFN
113
- "prfun",
114
- // PRFUN
115
- //
116
- "praxi",
117
- // PRAXI
118
- "castfn",
119
- // CASTFN
120
- //
121
- "if",
122
- // T_IF
123
- "then",
124
- // T_THEN
125
- "else",
126
- // T_ELSE
127
- //
128
- "ifcase",
129
- // T_IFCASE
130
- //
131
- "in",
132
- // T_IN
133
- //
134
- "infix",
135
- // INFIX
136
- "infixl",
137
- // INFIXL
138
- "infixr",
139
- // INFIXR
140
- "prefix",
141
- // PREFIX
142
- "postfix",
143
- // POSTFIX
144
- //
145
- "implmnt",
146
- // IMPLMNT // 0
147
- "implement",
148
- // IMPLEMENT // 1
149
- //
150
- "primplmnt",
151
- // PRIMPLMNT // ~1
152
- "primplement",
153
- // PRIMPLMNT // ~1
154
- //
155
- "import",
156
- // T_IMPORT // for importing packages
157
- //
158
- /*
159
- "lam", // LAM
160
- "llam", // LLAM
161
- "fix", // FIX
162
- */
163
- //
164
- "let",
165
- // T_LET
166
- //
167
- "local",
168
- // T_LOCAL
169
- //
170
- "macdef",
171
- // MACDEF
172
- "macrodef",
173
- // MACRODEF
174
- //
175
- "nonfix",
176
- // T_NONFIX
177
- //
178
- "symelim",
179
- // T_SYMELIM
180
- "symintr",
181
- // T_SYMINTR
182
- "overload",
183
- // T_OVERLOAD
184
- //
185
- "of",
186
- // T_OF
187
- "op",
188
- // T_OP
189
- //
190
- "rec",
191
- // T_REC
192
- //
193
- "sif",
194
- // T_SIF
195
- "scase",
196
- // T_SCASE
197
- //
198
- "sortdef",
199
- // T_SORTDEF
200
- /*
201
- // HX: [sta] is now deprecated
202
- */
203
- "sta",
204
- // T_STACST
205
- "stacst",
206
- // T_STACST
207
- "stadef",
208
- // T_STADEF
209
- "static",
210
- // T_STATIC
211
- /*
212
- "stavar", // T_STAVAR
213
- */
214
- //
215
- "staload",
216
- // T_STALOAD
217
- "dynload",
218
- // T_DYNLOAD
219
- //
220
- "try",
221
- // T_TRY
222
- //
223
- "tkindef",
224
- // T_TKINDEF // HX-2012-05-23
225
- //
226
- /*
227
- "type", // TYPE
228
- */
229
- "typedef",
230
- // TYPEDEF
231
- "propdef",
232
- // PROPDEF
233
- "viewdef",
234
- // VIEWDEF
235
- "vtypedef",
236
- // VIEWTYPEDEF
237
- "viewtypedef",
238
- // VIEWTYPEDEF
239
- //
240
- /*
241
- "val", // VAL
242
- */
243
- "prval",
244
- // PRVAL
245
- //
246
- "var",
247
- // VAR
248
- "prvar",
249
- // PRVAR
250
- //
251
- "when",
252
- // T_WHEN
253
- "where",
254
- // T_WHERE
255
- //
256
- /*
257
- "for", // T_FOR
258
- "while", // T_WHILE
259
- */
260
- //
261
- "with",
262
- // T_WITH
263
- //
264
- "withtype",
265
- // WITHTYPE
266
- "withprop",
267
- // WITHPROP
268
- "withview",
269
- // WITHVIEW
270
- "withvtype",
271
- // WITHVIEWTYPE
272
- "withviewtype"
273
- // WITHVIEWTYPE
274
- //
275
- ],
276
- keywords_dlr: [
277
- "$delay",
278
- // DLRDELAY
279
- "$ldelay",
280
- // DLRLDELAY
281
- //
282
- "$arrpsz",
283
- // T_DLRARRPSZ
284
- "$arrptrsize",
285
- // T_DLRARRPSZ
286
- //
287
- "$d2ctype",
288
- // T_DLRD2CTYPE
289
- //
290
- "$effmask",
291
- // DLREFFMASK
292
- "$effmask_ntm",
293
- // DLREFFMASK_NTM
294
- "$effmask_exn",
295
- // DLREFFMASK_EXN
296
- "$effmask_ref",
297
- // DLREFFMASK_REF
298
- "$effmask_wrt",
299
- // DLREFFMASK_WRT
300
- "$effmask_all",
301
- // DLREFFMASK_ALL
302
- //
303
- "$extern",
304
- // T_DLREXTERN
305
- "$extkind",
306
- // T_DLREXTKIND
307
- "$extype",
308
- // T_DLREXTYPE
309
- "$extype_struct",
310
- // T_DLREXTYPE_STRUCT
311
- //
312
- "$extval",
313
- // T_DLREXTVAL
314
- "$extfcall",
315
- // T_DLREXTFCALL
316
- "$extmcall",
317
- // T_DLREXTMCALL
318
- //
319
- "$literal",
320
- // T_DLRLITERAL
321
- //
322
- "$myfilename",
323
- // T_DLRMYFILENAME
324
- "$mylocation",
325
- // T_DLRMYLOCATION
326
- "$myfunction",
327
- // T_DLRMYFUNCTION
328
- //
329
- "$lst",
330
- // DLRLST
331
- "$lst_t",
332
- // DLRLST_T
333
- "$lst_vt",
334
- // DLRLST_VT
335
- "$list",
336
- // DLRLST
337
- "$list_t",
338
- // DLRLST_T
339
- "$list_vt",
340
- // DLRLST_VT
341
- //
342
- "$rec",
343
- // DLRREC
344
- "$rec_t",
345
- // DLRREC_T
346
- "$rec_vt",
347
- // DLRREC_VT
348
- "$record",
349
- // DLRREC
350
- "$record_t",
351
- // DLRREC_T
352
- "$record_vt",
353
- // DLRREC_VT
354
- //
355
- "$tup",
356
- // DLRTUP
357
- "$tup_t",
358
- // DLRTUP_T
359
- "$tup_vt",
360
- // DLRTUP_VT
361
- "$tuple",
362
- // DLRTUP
363
- "$tuple_t",
364
- // DLRTUP_T
365
- "$tuple_vt",
366
- // DLRTUP_VT
367
- //
368
- "$break",
369
- // T_DLRBREAK
370
- "$continue",
371
- // T_DLRCONTINUE
372
- //
373
- "$raise",
374
- // T_DLRRAISE
375
- //
376
- "$showtype",
377
- // T_DLRSHOWTYPE
378
- //
379
- "$vcopyenv_v",
380
- // DLRVCOPYENV_V
381
- "$vcopyenv_vt",
382
- // DLRVCOPYENV_VT
383
- //
384
- "$tempenver",
385
- // T_DLRTEMPENVER
386
- //
387
- "$solver_assert",
388
- // T_DLRSOLASSERT
389
- "$solver_verify"
390
- // T_DLRSOLVERIFY
391
- ],
392
- keywords_srp: [
393
- //
394
- "#if",
395
- // T_SRPIF
396
- "#ifdef",
397
- // T_SRPIFDEF
398
- "#ifndef",
399
- // T_SRPIFNDEF
400
- //
401
- "#then",
402
- // T_SRPTHEN
403
- //
404
- "#elif",
405
- // T_SRPELIF
406
- "#elifdef",
407
- // T_SRPELIFDEF
408
- "#elifndef",
409
- // T_SRPELIFNDEF
410
- //
411
- "#else",
412
- // T_SRPELSE
413
- "#endif",
414
- // T_SRPENDIF
415
- //
416
- "#error",
417
- // T_SRPERROR
418
- //
419
- "#prerr",
420
- // T_SRPPRERR // outpui to stderr
421
- "#print",
422
- // T_SRPPRINT // output to stdout
423
- //
424
- "#assert",
425
- // T_SRPASSERT
426
- //
427
- "#undef",
428
- // T_SRPUNDEF
429
- "#define",
430
- // T_SRPDEFINE
431
- //
432
- "#include",
433
- // T_SRPINCLUDE
434
- "#require",
435
- // T_SRPREQUIRE
436
- //
437
- "#pragma",
438
- // T_SRPPRAGMA // HX: general pragma
439
- "#codegen2",
440
- // T_SRPCODEGEN2 // for level-2 codegen
441
- "#codegen3"
442
- // T_SRPCODEGEN3 // for level-3 codegen
443
- //
444
- // HX: end of special tokens
445
- //
446
- ],
447
- irregular_keyword_list: [
448
- "val+",
449
- "val-",
450
- "val",
451
- "case+",
452
- "case-",
453
- "case",
454
- "addr@",
455
- "addr",
456
- "fold@",
457
- "free@",
458
- "fix@",
459
- "fix",
460
- "lam@",
461
- "lam",
462
- "llam@",
463
- "llam",
464
- "viewt@ype+",
465
- "viewt@ype-",
466
- "viewt@ype",
467
- "viewtype+",
468
- "viewtype-",
469
- "viewtype",
470
- "view+",
471
- "view-",
472
- "view@",
473
- "view",
474
- "type+",
475
- "type-",
476
- "type",
477
- "vtype+",
478
- "vtype-",
479
- "vtype",
480
- "vt@ype+",
481
- "vt@ype-",
482
- "vt@ype",
483
- "viewt@ype+",
484
- "viewt@ype-",
485
- "viewt@ype",
486
- "viewtype+",
487
- "viewtype-",
488
- "viewtype",
489
- "prop+",
490
- "prop-",
491
- "prop",
492
- "type+",
493
- "type-",
494
- "type",
495
- "t@ype",
496
- "t@ype+",
497
- "t@ype-",
498
- "abst@ype",
499
- "abstype",
500
- "absviewt@ype",
501
- "absvt@ype",
502
- "for*",
503
- "for",
504
- "while*",
505
- "while"
506
- ],
507
- keywords_types: [
508
- "bool",
509
- "double",
510
- "byte",
511
- "int",
512
- "short",
513
- "char",
514
- "void",
515
- "unit",
516
- "long",
517
- "float",
518
- "string",
519
- "strptr"
520
- ],
521
- // TODO: reference for this?
522
- keywords_effects: [
523
- "0",
524
- // no effects
525
- "fun",
526
- "clo",
527
- "prf",
528
- "funclo",
529
- "cloptr",
530
- "cloref",
531
- "ref",
532
- "ntm",
533
- "1"
534
- // all effects
535
- ],
536
- operators: [
537
- "@",
538
- // T_AT
539
- "!",
540
- // T_BANG
541
- "|",
542
- // T_BAR
543
- "`",
544
- // T_BQUOTE
545
- ":",
546
- // T_COLON
547
- "$",
548
- // T_DOLLAR
549
- ".",
550
- // T_DOT
551
- "=",
552
- // T_EQ
553
- "#",
554
- // T_HASH
555
- "~",
556
- // T_TILDE
557
- //
558
- "..",
559
- // T_DOTDOT
560
- "...",
561
- // T_DOTDOTDOT
562
- //
563
- "=>",
564
- // T_EQGT
565
- // "=<", // T_EQLT
566
- "=<>",
567
- // T_EQLTGT
568
- "=/=>",
569
- // T_EQSLASHEQGT
570
- "=>>",
571
- // T_EQGTGT
572
- "=/=>>",
573
- // T_EQSLASHEQGTGT
574
- //
575
- "<",
576
- // T_LT // opening a tmparg
577
- ">",
578
- // T_GT // closing a tmparg
579
- //
580
- "><",
581
- // T_GTLT
582
- //
583
- ".<",
584
- // T_DOTLT
585
- ">.",
586
- // T_GTDOT
587
- //
588
- ".<>.",
589
- // T_DOTLTGTDOT
590
- //
591
- "->",
592
- // T_MINUSGT
593
- //"-<", // T_MINUSLT
594
- "-<>"
595
- // T_MINUSLTGT
596
- //
597
- /*
598
- ":<", // T_COLONLT
599
- */
600
- ],
601
- brackets: [
602
- { open: ",(", close: ")", token: "delimiter.parenthesis" },
603
- // meta-programming syntax
604
- { open: "`(", close: ")", token: "delimiter.parenthesis" },
605
- { open: "%(", close: ")", token: "delimiter.parenthesis" },
606
- { open: "'(", close: ")", token: "delimiter.parenthesis" },
607
- { open: "'{", close: "}", token: "delimiter.parenthesis" },
608
- { open: "@(", close: ")", token: "delimiter.parenthesis" },
609
- { open: "@{", close: "}", token: "delimiter.brace" },
610
- { open: "@[", close: "]", token: "delimiter.square" },
611
- { open: "#[", close: "]", token: "delimiter.square" },
612
- { open: "{", close: "}", token: "delimiter.curly" },
613
- { open: "[", close: "]", token: "delimiter.square" },
614
- { open: "(", close: ")", token: "delimiter.parenthesis" },
615
- { open: "<", close: ">", token: "delimiter.angle" }
616
- ],
617
- // we include these common regular expressions
618
- symbols: /[=><!~?:&|+\-*\/\^%]+/,
619
- IDENTFST: /[a-zA-Z_]/,
620
- IDENTRST: /[a-zA-Z0-9_'$]/,
621
- symbolic: /[%&+-./:=@~`^|*!$#?<>]/,
622
- digit: /[0-9]/,
623
- digitseq0: /@digit*/,
624
- xdigit: /[0-9A-Za-z]/,
625
- xdigitseq0: /@xdigit*/,
626
- INTSP: /[lLuU]/,
627
- FLOATSP: /[fFlL]/,
628
- fexponent: /[eE][+-]?[0-9]+/,
629
- fexponent_bin: /[pP][+-]?[0-9]+/,
630
- deciexp: /\.[0-9]*@fexponent?/,
631
- hexiexp: /\.[0-9a-zA-Z]*@fexponent_bin?/,
632
- irregular_keywords: /val[+-]?|case[+-]?|addr\@?|fold\@|free\@|fix\@?|lam\@?|llam\@?|prop[+-]?|type[+-]?|view[+-@]?|viewt@?ype[+-]?|t@?ype[+-]?|v(iew)?t@?ype[+-]?|abst@?ype|absv(iew)?t@?ype|for\*?|while\*?/,
633
- ESCHAR: /[ntvbrfa\\\?'"\(\[\{]/,
634
- start: "root",
635
- // The main tokenizer for ATS/Postiats
636
- // reference: https://github.com/githwxi/ATS-Postiats/blob/master/src/pats_lexing.dats
637
- tokenizer: {
638
- root: [
639
- // lexing_blankseq0
640
- { regex: /[ \t\r\n]+/, action: { token: "" } },
641
- // NOTE: (*) is an invalid ML-like comment!
642
- { regex: /\(\*\)/, action: { token: "invalid" } },
643
- {
644
- regex: /\(\*/,
645
- action: { token: "comment", next: "lexing_COMMENT_block_ml" }
646
- },
647
- {
648
- regex: /\(/,
649
- action: "@brackets"
650
- /*{ token: 'delimiter.parenthesis' }*/
651
- },
652
- {
653
- regex: /\)/,
654
- action: "@brackets"
655
- /*{ token: 'delimiter.parenthesis' }*/
656
- },
657
- {
658
- regex: /\[/,
659
- action: "@brackets"
660
- /*{ token: 'delimiter.bracket' }*/
661
- },
662
- {
663
- regex: /\]/,
664
- action: "@brackets"
665
- /*{ token: 'delimiter.bracket' }*/
666
- },
667
- {
668
- regex: /\{/,
669
- action: "@brackets"
670
- /*{ token: 'delimiter.brace' }*/
671
- },
672
- {
673
- regex: /\}/,
674
- action: "@brackets"
675
- /*{ token: 'delimiter.brace' }*/
676
- },
677
- // lexing_COMMA
678
- {
679
- regex: /,\(/,
680
- action: "@brackets"
681
- /*{ token: 'delimiter.parenthesis' }*/
682
- },
683
- // meta-programming syntax
684
- { regex: /,/, action: { token: "delimiter.comma" } },
685
- { regex: /;/, action: { token: "delimiter.semicolon" } },
686
- // lexing_AT
687
- {
688
- regex: /@\(/,
689
- action: "@brackets"
690
- /* { token: 'delimiter.parenthesis' }*/
691
- },
692
- {
693
- regex: /@\[/,
694
- action: "@brackets"
695
- /* { token: 'delimiter.bracket' }*/
696
- },
697
- {
698
- regex: /@\{/,
699
- action: "@brackets"
700
- /*{ token: 'delimiter.brace' }*/
701
- },
702
- // lexing_COLON
703
- {
704
- regex: /:</,
705
- action: { token: "keyword", next: "@lexing_EFFECT_commaseq0" }
706
- },
707
- // T_COLONLT
708
- /*
709
- lexing_DOT:
710
-
711
- . // SYMBOLIC => lexing_IDENT_sym
712
- . FLOATDOT => lexing_FLOAT_deciexp
713
- . DIGIT => T_DOTINT
714
- */
715
- { regex: /\.@symbolic+/, action: { token: "identifier.sym" } },
716
- // FLOATDOT case
717
- {
718
- regex: /\.@digit*@fexponent@FLOATSP*/,
719
- action: { token: "number.float" }
720
- },
721
- { regex: /\.@digit+/, action: { token: "number.float" } },
722
- // T_DOTINT
723
- // lexing_DOLLAR:
724
- // '$' IDENTFST IDENTRST* => lexing_IDENT_dlr, _ => lexing_IDENT_sym
725
- {
726
- regex: /\$@IDENTFST@IDENTRST*/,
727
- action: {
728
- cases: {
729
- "@keywords_dlr": { token: "keyword.dlr" },
730
- "@default": { token: "namespace" }
731
- // most likely a module qualifier
732
- }
733
- }
734
- },
735
- // lexing_SHARP:
736
- // '#' IDENTFST IDENTRST* => lexing_ident_srp, _ => lexing_IDENT_sym
737
- {
738
- regex: /\#@IDENTFST@IDENTRST*/,
739
- action: {
740
- cases: {
741
- "@keywords_srp": { token: "keyword.srp" },
742
- "@default": { token: "identifier" }
743
- }
744
- }
745
- },
746
- // lexing_PERCENT:
747
- { regex: /%\(/, action: { token: "delimiter.parenthesis" } },
748
- {
749
- regex: /^%{(#|\^|\$)?/,
750
- action: {
751
- token: "keyword",
752
- next: "@lexing_EXTCODE",
753
- nextEmbedded: "text/javascript"
754
- }
755
- },
756
- { regex: /^%}/, action: { token: "keyword" } },
757
- // lexing_QUOTE
758
- { regex: /'\(/, action: { token: "delimiter.parenthesis" } },
759
- { regex: /'\[/, action: { token: "delimiter.bracket" } },
760
- { regex: /'\{/, action: { token: "delimiter.brace" } },
761
- [/(')(\\@ESCHAR|\\[xX]@xdigit+|\\@digit+)(')/, ["string", "string.escape", "string"]],
762
- [/'[^\\']'/, "string"],
763
- // lexing_DQUOTE
764
- [/"/, "string.quote", "@lexing_DQUOTE"],
765
- // lexing_BQUOTE
766
- {
767
- regex: /`\(/,
768
- action: "@brackets"
769
- /* { token: 'delimiter.parenthesis' }*/
770
- },
771
- // TODO: otherwise, try lexing_IDENT_sym
772
- { regex: /\\/, action: { token: "punctuation" } },
773
- // just T_BACKSLASH
774
- // lexing_IDENT_alp:
775
- // NOTE: (?!regex) is syntax for "not-followed-by" regex
776
- // to resolve ambiguity such as foreach$fwork being incorrectly lexed as [for] [each$fwork]!
777
- {
778
- regex: /@irregular_keywords(?!@IDENTRST)/,
779
- action: { token: "keyword" }
780
- },
781
- {
782
- regex: /@IDENTFST@IDENTRST*[<!\[]?/,
783
- action: {
784
- cases: {
785
- // TODO: dynload and staload should be specially parsed
786
- // dynload whitespace+ "special_string"
787
- // this special string is really:
788
- // '/' '\\' '.' => punctuation
789
- // ({\$)([a-zA-Z_][a-zA-Z_0-9]*)(}) => punctuation,keyword,punctuation
790
- // [^"] => identifier/literal
791
- "@keywords": { token: "keyword" },
792
- "@keywords_types": { token: "type" },
793
- "@default": { token: "identifier" }
794
- }
795
- }
796
- },
797
- // lexing_IDENT_sym:
798
- {
799
- regex: /\/\/\/\//,
800
- action: { token: "comment", next: "@lexing_COMMENT_rest" }
801
- },
802
- { regex: /\/\/.*$/, action: { token: "comment" } },
803
- {
804
- regex: /\/\*/,
805
- action: { token: "comment", next: "@lexing_COMMENT_block_c" }
806
- },
807
- // AS-20160627: specifically for effect annotations
808
- {
809
- regex: /-<|=</,
810
- action: { token: "keyword", next: "@lexing_EFFECT_commaseq0" }
811
- },
812
- {
813
- regex: /@symbolic+/,
814
- action: {
815
- cases: {
816
- "@operators": "keyword",
817
- "@default": "operator"
818
- }
819
- }
820
- },
821
- // lexing_ZERO:
822
- // FIXME: this one is quite messy/unfinished yet
823
- // TODO: lexing_INT_hex
824
- // - testing_hexiexp => lexing_FLOAT_hexiexp
825
- // - testing_fexponent_bin => lexing_FLOAT_hexiexp
826
- // - testing_intspseq0 => T_INT_hex
827
- // lexing_INT_hex:
828
- {
829
- regex: /0[xX]@xdigit+(@hexiexp|@fexponent_bin)@FLOATSP*/,
830
- action: { token: "number.float" }
831
- },
832
- { regex: /0[xX]@xdigit+@INTSP*/, action: { token: "number.hex" } },
833
- {
834
- regex: /0[0-7]+(?![0-9])@INTSP*/,
835
- action: { token: "number.octal" }
836
- },
837
- // lexing_INT_oct
838
- //{regex: /0/, action: { token: 'number' } }, // INTZERO
839
- // lexing_INT_dec:
840
- // - testing_deciexp => lexing_FLOAT_deciexp
841
- // - testing_fexponent => lexing_FLOAT_deciexp
842
- // - otherwise => intspseq0 ([0-9]*[lLuU]?)
843
- {
844
- regex: /@digit+(@fexponent|@deciexp)@FLOATSP*/,
845
- action: { token: "number.float" }
846
- },
847
- {
848
- regex: /@digit@digitseq0@INTSP*/,
849
- action: { token: "number.decimal" }
850
- },
851
- // DIGIT, if followed by digitseq0, is lexing_INT_dec
852
- { regex: /@digit+@INTSP*/, action: { token: "number" } }
853
- ],
854
- lexing_COMMENT_block_ml: [
855
- [/[^\(\*]+/, "comment"],
856
- [/\(\*/, "comment", "@push"],
857
- [/\(\*/, "comment.invalid"],
858
- [/\*\)/, "comment", "@pop"],
859
- [/\*/, "comment"]
860
- ],
861
- lexing_COMMENT_block_c: [
862
- [/[^\/*]+/, "comment"],
863
- // [/\/\*/, 'comment', '@push' ], // nested C-style block comments not allowed
864
- // [/\/\*/, 'comment.invalid' ], // NOTE: this breaks block comments in the shape of /* //*/
865
- [/\*\//, "comment", "@pop"],
866
- [/[\/*]/, "comment"]
867
- ],
868
- lexing_COMMENT_rest: [
869
- [/$/, "comment", "@pop"],
870
- // FIXME: does it match? docs say 'no'
871
- [/.*/, "comment"]
872
- ],
873
- // NOTE: added by AS, specifically for highlighting
874
- lexing_EFFECT_commaseq0: [
875
- {
876
- regex: /@IDENTFST@IDENTRST+|@digit+/,
877
- action: {
878
- cases: {
879
- "@keywords_effects": { token: "type.effect" },
880
- "@default": { token: "identifier" }
881
- }
882
- }
883
- },
884
- { regex: /,/, action: { token: "punctuation" } },
885
- { regex: />/, action: { token: "@rematch", next: "@pop" } }
886
- ],
887
- lexing_EXTCODE: [
888
- {
889
- regex: /^%}/,
890
- action: {
891
- token: "@rematch",
892
- next: "@pop",
893
- nextEmbedded: "@pop"
894
- }
895
- },
896
- { regex: /[^%]+/, action: "" }
897
- ],
898
- lexing_DQUOTE: [
899
- { regex: /"/, action: { token: "string.quote", next: "@pop" } },
900
- // AS-20160628: additional hi-lighting for variables in staload/dynload strings
901
- {
902
- regex: /(\{\$)(@IDENTFST@IDENTRST*)(\})/,
903
- action: [{ token: "string.escape" }, { token: "identifier" }, { token: "string.escape" }]
904
- },
905
- { regex: /\\$/, action: { token: "string.escape" } },
906
- {
907
- regex: /\\(@ESCHAR|[xX]@xdigit+|@digit+)/,
908
- action: { token: "string.escape" }
909
- },
910
- { regex: /[^\\"]+/, action: { token: "string" } }
911
- ]
912
- }
913
- };
914
-
915
- export { conf, language };