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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/_.contribution.js +48 -0
  2. package/abap/abap.contribution.js +8 -0
  3. package/abap/abap.js +1397 -0
  4. package/apex/apex.contribution.js +9 -0
  5. package/apex/apex.js +329 -0
  6. package/azcli/azcli.contribution.js +8 -0
  7. package/azcli/azcli.js +67 -0
  8. package/bat/bat.contribution.js +8 -0
  9. package/bat/bat.js +99 -0
  10. package/bicep/bicep.contribution.js +8 -0
  11. package/bicep/bicep.js +108 -0
  12. package/cameligo/cameligo.contribution.js +8 -0
  13. package/cameligo/cameligo.js +173 -0
  14. package/clojure/clojure.contribution.js +8 -0
  15. package/clojure/clojure.js +760 -0
  16. package/coffee/coffee.contribution.js +9 -0
  17. package/coffee/coffee.js +231 -0
  18. package/cpp/cpp.contribution.js +14 -0
  19. package/cpp/cpp.js +388 -0
  20. package/csharp/csharp.contribution.js +8 -0
  21. package/csharp/csharp.js +325 -0
  22. package/csp/csp.contribution.js +8 -0
  23. package/csp/csp.js +52 -0
  24. package/css/css.contribution.js +9 -0
  25. package/css/css.js +184 -0
  26. package/cypher/cypher.contribution.js +8 -0
  27. package/cypher/cypher.js +262 -0
  28. package/dart/dart.contribution.js +9 -0
  29. package/dart/dart.js +280 -0
  30. package/dockerfile/dockerfile.contribution.js +9 -0
  31. package/dockerfile/dockerfile.js +129 -0
  32. package/ecl/ecl.contribution.js +8 -0
  33. package/ecl/ecl.js +455 -0
  34. package/elixir/elixir.contribution.js +8 -0
  35. package/elixir/elixir.js +568 -0
  36. package/flow9/flow9.contribution.js +8 -0
  37. package/flow9/flow9.js +141 -0
  38. package/freemarker2/freemarker2.contribution.js +52 -0
  39. package/freemarker2/freemarker2.js +990 -0
  40. package/fsharp/fsharp.contribution.js +8 -0
  41. package/fsharp/fsharp.js +216 -0
  42. package/go/go.contribution.js +8 -0
  43. package/go/go.js +217 -0
  44. package/graphql/graphql.contribution.js +9 -0
  45. package/graphql/graphql.js +150 -0
  46. package/handlebars/handlebars.contribution.js +9 -0
  47. package/handlebars/handlebars.js +413 -0
  48. package/hcl/hcl.contribution.js +8 -0
  49. package/hcl/hcl.js +182 -0
  50. package/html/html.contribution.js +9 -0
  51. package/html/html.js +302 -0
  52. package/index.js +81 -48
  53. package/ini/ini.contribution.js +9 -0
  54. package/ini/ini.js +70 -0
  55. package/java/java.contribution.js +9 -0
  56. package/java/java.js +231 -0
  57. package/javascript/javascript.contribution.js +11 -0
  58. package/javascript/javascript.js +70 -0
  59. package/julia/julia.contribution.js +8 -0
  60. package/julia/julia.js +510 -0
  61. package/kotlin/kotlin.contribution.js +9 -0
  62. package/kotlin/kotlin.js +251 -0
  63. package/less/less.contribution.js +9 -0
  64. package/less/less.js +160 -0
  65. package/lexon/lexon.contribution.js +8 -0
  66. package/lexon/lexon.js +156 -0
  67. package/liquid/liquid.contribution.js +9 -0
  68. package/liquid/liquid.js +234 -0
  69. package/lua/lua.contribution.js +8 -0
  70. package/lua/lua.js +161 -0
  71. package/m3/m3.contribution.js +8 -0
  72. package/m3/m3.js +209 -0
  73. package/markdown/markdown.contribution.js +8 -0
  74. package/markdown/markdown.js +228 -0
  75. package/mdx/mdx.contribution.js +8 -0
  76. package/mdx/mdx.js +158 -0
  77. package/mips/mips.contribution.js +9 -0
  78. package/mips/mips.js +197 -0
  79. package/msdax/msdax.contribution.js +8 -0
  80. package/msdax/msdax.js +374 -0
  81. package/mysql/mysql.contribution.js +8 -0
  82. package/mysql/mysql.js +877 -0
  83. package/objective-c/objective-c.contribution.js +8 -0
  84. package/objective-c/objective-c.js +182 -0
  85. package/package.json +2 -2
  86. package/pascal/pascal.contribution.js +9 -0
  87. package/pascal/pascal.js +250 -0
  88. package/pascaligo/pascaligo.contribution.js +8 -0
  89. package/pascaligo/pascaligo.js +163 -0
  90. package/perl/perl.contribution.js +8 -0
  91. package/perl/perl.js +625 -0
  92. package/pgsql/pgsql.contribution.js +8 -0
  93. package/pgsql/pgsql.js +850 -0
  94. package/php/php.contribution.js +9 -0
  95. package/php/php.js +499 -0
  96. package/pla/pla.contribution.js +7 -0
  97. package/pla/pla.js +136 -0
  98. package/postiats/postiats.contribution.js +8 -0
  99. package/postiats/postiats.js +906 -0
  100. package/powerquery/powerquery.contribution.js +8 -0
  101. package/powerquery/powerquery.js +889 -0
  102. package/powershell/powershell.contribution.js +8 -0
  103. package/powershell/powershell.js +238 -0
  104. package/protobuf/protobuf.contribution.js +8 -0
  105. package/protobuf/protobuf.js +419 -0
  106. package/pug/pug.contribution.js +8 -0
  107. package/pug/pug.js +401 -0
  108. package/python/python.contribution.js +9 -0
  109. package/python/python.js +294 -0
  110. package/qsharp/qsharp.contribution.js +8 -0
  111. package/qsharp/qsharp.js +300 -0
  112. package/r/r.contribution.js +8 -0
  113. package/r/r.js +242 -0
  114. package/razor/razor.contribution.js +9 -0
  115. package/razor/razor.js +544 -0
  116. package/redis/redis.contribution.js +8 -0
  117. package/redis/redis.js +301 -0
  118. package/redshift/redshift.contribution.js +8 -0
  119. package/redshift/redshift.js +808 -0
  120. package/restructuredtext/restructuredtext.contribution.js +8 -0
  121. package/restructuredtext/restructuredtext.js +173 -0
  122. package/ruby/ruby.contribution.js +9 -0
  123. package/ruby/ruby.js +510 -0
  124. package/rust/rust.contribution.js +8 -0
  125. package/rust/rust.js +342 -0
  126. package/sb/sb.contribution.js +8 -0
  127. package/sb/sb.js +114 -0
  128. package/scala/scala.contribution.js +9 -0
  129. package/scala/scala.js +369 -0
  130. package/scheme/scheme.contribution.js +8 -0
  131. package/scheme/scheme.js +107 -0
  132. package/scss/scss.contribution.js +9 -0
  133. package/scss/scss.js +259 -0
  134. package/shell/shell.contribution.js +8 -0
  135. package/shell/shell.js +220 -0
  136. package/solidity/solidity.contribution.js +8 -0
  137. package/solidity/solidity.js +1366 -0
  138. package/sophia/sophia.contribution.js +8 -0
  139. package/sophia/sophia.js +198 -0
  140. package/sparql/sparql.contribution.js +8 -0
  141. package/sparql/sparql.js +200 -0
  142. package/sql/sql.contribution.js +8 -0
  143. package/sql/sql.js +852 -0
  144. package/st/st.contribution.js +8 -0
  145. package/st/st.js +415 -0
  146. package/swift/swift.contribution.js +9 -0
  147. package/swift/swift.js +311 -0
  148. package/systemverilog/systemverilog.contribution.js +14 -0
  149. package/systemverilog/systemverilog.js +575 -0
  150. package/tcl/tcl.contribution.js +8 -0
  151. package/tcl/tcl.js +231 -0
  152. package/twig/twig.contribution.js +9 -0
  153. package/twig/twig.js +391 -0
  154. package/typescript/typescript.contribution.js +11 -0
  155. package/typescript/typescript.js +336 -0
  156. package/typespec/typespec.contribution.js +8 -0
  157. package/typespec/typespec.js +126 -0
  158. package/vb/vb.contribution.js +8 -0
  159. package/vb/vb.js +371 -0
  160. package/wgsl/wgsl.contribution.js +8 -0
  161. package/wgsl/wgsl.js +452 -0
  162. package/xml/xml.contribution.js +28 -0
  163. package/xml/xml.js +88 -0
  164. package/yaml/yaml.contribution.js +9 -0
  165. package/yaml/yaml.js +199 -0
@@ -0,0 +1,9 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "php",
5
+ extensions: [".php", ".php4", ".php5", ".phtml", ".ctp"],
6
+ aliases: ["PHP", "php"],
7
+ mimetypes: ["application/x-php"],
8
+ loader: () => import('./php.js')
9
+ });
package/php/php.js ADDED
@@ -0,0 +1,499 @@
1
+ const conf = {
2
+ wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
3
+ comments: {
4
+ lineComment: "//",
5
+ blockComment: ["/*", "*/"]
6
+ },
7
+ brackets: [
8
+ ["{", "}"],
9
+ ["[", "]"],
10
+ ["(", ")"]
11
+ ],
12
+ autoClosingPairs: [
13
+ { open: "{", close: "}", notIn: ["string"] },
14
+ { open: "[", close: "]", notIn: ["string"] },
15
+ { open: "(", close: ")", notIn: ["string"] },
16
+ { open: '"', close: '"', notIn: ["string"] },
17
+ { open: "'", close: "'", notIn: ["string", "comment"] }
18
+ ],
19
+ folding: {
20
+ markers: {
21
+ start: new RegExp("^\\s*(#|//)region\\b"),
22
+ end: new RegExp("^\\s*(#|//)endregion\\b")
23
+ }
24
+ }
25
+ };
26
+ const language = {
27
+ defaultToken: "",
28
+ tokenPostfix: "",
29
+ // ignoreCase: true,
30
+ // The main tokenizer for our languages
31
+ tokenizer: {
32
+ root: [
33
+ [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.root" }],
34
+ [/<!DOCTYPE/, "metatag.html", "@doctype"],
35
+ [/<!--/, "comment.html", "@comment"],
36
+ [/(<)(\w+)(\/>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
37
+ [/(<)(script)/, ["delimiter.html", { token: "tag.html", next: "@script" }]],
38
+ [/(<)(style)/, ["delimiter.html", { token: "tag.html", next: "@style" }]],
39
+ [/(<)([:\w]+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
40
+ [/(<\/)(\w+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
41
+ [/</, "delimiter.html"],
42
+ [/[^<]+/]
43
+ // text
44
+ ],
45
+ doctype: [
46
+ [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.comment" }],
47
+ [/[^>]+/, "metatag.content.html"],
48
+ [/>/, "metatag.html", "@pop"]
49
+ ],
50
+ comment: [
51
+ [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.comment" }],
52
+ [/-->/, "comment.html", "@pop"],
53
+ [/[^-]+/, "comment.content.html"],
54
+ [/./, "comment.content.html"]
55
+ ],
56
+ otherTag: [
57
+ [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.otherTag" }],
58
+ [/\/?>/, "delimiter.html", "@pop"],
59
+ [/"([^"]*)"/, "attribute.value"],
60
+ [/'([^']*)'/, "attribute.value"],
61
+ [/[\w\-]+/, "attribute.name"],
62
+ [/=/, "delimiter"],
63
+ [/[ \t\r\n]+/]
64
+ // whitespace
65
+ ],
66
+ // -- BEGIN <script> tags handling
67
+ // After <script
68
+ script: [
69
+ [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.script" }],
70
+ [/type/, "attribute.name", "@scriptAfterType"],
71
+ [/"([^"]*)"/, "attribute.value"],
72
+ [/'([^']*)'/, "attribute.value"],
73
+ [/[\w\-]+/, "attribute.name"],
74
+ [/=/, "delimiter"],
75
+ [
76
+ />/,
77
+ {
78
+ token: "delimiter.html",
79
+ next: "@scriptEmbedded.text/javascript",
80
+ nextEmbedded: "text/javascript"
81
+ }
82
+ ],
83
+ [/[ \t\r\n]+/],
84
+ // whitespace
85
+ [
86
+ /(<\/)(script\s*)(>)/,
87
+ ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }]
88
+ ]
89
+ ],
90
+ // After <script ... type
91
+ scriptAfterType: [
92
+ [
93
+ /<\?((php)|=)?/,
94
+ {
95
+ token: "@rematch",
96
+ switchTo: "@phpInSimpleState.scriptAfterType"
97
+ }
98
+ ],
99
+ [/=/, "delimiter", "@scriptAfterTypeEquals"],
100
+ [
101
+ />/,
102
+ {
103
+ token: "delimiter.html",
104
+ next: "@scriptEmbedded.text/javascript",
105
+ nextEmbedded: "text/javascript"
106
+ }
107
+ ],
108
+ // cover invalid e.g. <script type>
109
+ [/[ \t\r\n]+/],
110
+ // whitespace
111
+ [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
112
+ ],
113
+ // After <script ... type =
114
+ scriptAfterTypeEquals: [
115
+ [
116
+ /<\?((php)|=)?/,
117
+ {
118
+ token: "@rematch",
119
+ switchTo: "@phpInSimpleState.scriptAfterTypeEquals"
120
+ }
121
+ ],
122
+ [
123
+ /"([^"]*)"/,
124
+ {
125
+ token: "attribute.value",
126
+ switchTo: "@scriptWithCustomType.$1"
127
+ }
128
+ ],
129
+ [
130
+ /'([^']*)'/,
131
+ {
132
+ token: "attribute.value",
133
+ switchTo: "@scriptWithCustomType.$1"
134
+ }
135
+ ],
136
+ [
137
+ />/,
138
+ {
139
+ token: "delimiter.html",
140
+ next: "@scriptEmbedded.text/javascript",
141
+ nextEmbedded: "text/javascript"
142
+ }
143
+ ],
144
+ // cover invalid e.g. <script type=>
145
+ [/[ \t\r\n]+/],
146
+ // whitespace
147
+ [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
148
+ ],
149
+ // After <script ... type = $S2
150
+ scriptWithCustomType: [
151
+ [
152
+ /<\?((php)|=)?/,
153
+ {
154
+ token: "@rematch",
155
+ switchTo: "@phpInSimpleState.scriptWithCustomType.$S2"
156
+ }
157
+ ],
158
+ [
159
+ />/,
160
+ {
161
+ token: "delimiter.html",
162
+ next: "@scriptEmbedded.$S2",
163
+ nextEmbedded: "$S2"
164
+ }
165
+ ],
166
+ [/"([^"]*)"/, "attribute.value"],
167
+ [/'([^']*)'/, "attribute.value"],
168
+ [/[\w\-]+/, "attribute.name"],
169
+ [/=/, "delimiter"],
170
+ [/[ \t\r\n]+/],
171
+ // whitespace
172
+ [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
173
+ ],
174
+ scriptEmbedded: [
175
+ [
176
+ /<\?((php)|=)?/,
177
+ {
178
+ token: "@rematch",
179
+ switchTo: "@phpInEmbeddedState.scriptEmbedded.$S2",
180
+ nextEmbedded: "@pop"
181
+ }
182
+ ],
183
+ [/<\/script/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }]
184
+ ],
185
+ // -- END <script> tags handling
186
+ // -- BEGIN <style> tags handling
187
+ // After <style
188
+ style: [
189
+ [/<\?((php)|=)?/, { token: "@rematch", switchTo: "@phpInSimpleState.style" }],
190
+ [/type/, "attribute.name", "@styleAfterType"],
191
+ [/"([^"]*)"/, "attribute.value"],
192
+ [/'([^']*)'/, "attribute.value"],
193
+ [/[\w\-]+/, "attribute.name"],
194
+ [/=/, "delimiter"],
195
+ [
196
+ />/,
197
+ {
198
+ token: "delimiter.html",
199
+ next: "@styleEmbedded.text/css",
200
+ nextEmbedded: "text/css"
201
+ }
202
+ ],
203
+ [/[ \t\r\n]+/],
204
+ // whitespace
205
+ [
206
+ /(<\/)(style\s*)(>)/,
207
+ ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }]
208
+ ]
209
+ ],
210
+ // After <style ... type
211
+ styleAfterType: [
212
+ [
213
+ /<\?((php)|=)?/,
214
+ {
215
+ token: "@rematch",
216
+ switchTo: "@phpInSimpleState.styleAfterType"
217
+ }
218
+ ],
219
+ [/=/, "delimiter", "@styleAfterTypeEquals"],
220
+ [
221
+ />/,
222
+ {
223
+ token: "delimiter.html",
224
+ next: "@styleEmbedded.text/css",
225
+ nextEmbedded: "text/css"
226
+ }
227
+ ],
228
+ // cover invalid e.g. <style type>
229
+ [/[ \t\r\n]+/],
230
+ // whitespace
231
+ [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
232
+ ],
233
+ // After <style ... type =
234
+ styleAfterTypeEquals: [
235
+ [
236
+ /<\?((php)|=)?/,
237
+ {
238
+ token: "@rematch",
239
+ switchTo: "@phpInSimpleState.styleAfterTypeEquals"
240
+ }
241
+ ],
242
+ [
243
+ /"([^"]*)"/,
244
+ {
245
+ token: "attribute.value",
246
+ switchTo: "@styleWithCustomType.$1"
247
+ }
248
+ ],
249
+ [
250
+ /'([^']*)'/,
251
+ {
252
+ token: "attribute.value",
253
+ switchTo: "@styleWithCustomType.$1"
254
+ }
255
+ ],
256
+ [
257
+ />/,
258
+ {
259
+ token: "delimiter.html",
260
+ next: "@styleEmbedded.text/css",
261
+ nextEmbedded: "text/css"
262
+ }
263
+ ],
264
+ // cover invalid e.g. <style type=>
265
+ [/[ \t\r\n]+/],
266
+ // whitespace
267
+ [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
268
+ ],
269
+ // After <style ... type = $S2
270
+ styleWithCustomType: [
271
+ [
272
+ /<\?((php)|=)?/,
273
+ {
274
+ token: "@rematch",
275
+ switchTo: "@phpInSimpleState.styleWithCustomType.$S2"
276
+ }
277
+ ],
278
+ [
279
+ />/,
280
+ {
281
+ token: "delimiter.html",
282
+ next: "@styleEmbedded.$S2",
283
+ nextEmbedded: "$S2"
284
+ }
285
+ ],
286
+ [/"([^"]*)"/, "attribute.value"],
287
+ [/'([^']*)'/, "attribute.value"],
288
+ [/[\w\-]+/, "attribute.name"],
289
+ [/=/, "delimiter"],
290
+ [/[ \t\r\n]+/],
291
+ // whitespace
292
+ [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
293
+ ],
294
+ styleEmbedded: [
295
+ [
296
+ /<\?((php)|=)?/,
297
+ {
298
+ token: "@rematch",
299
+ switchTo: "@phpInEmbeddedState.styleEmbedded.$S2",
300
+ nextEmbedded: "@pop"
301
+ }
302
+ ],
303
+ [/<\/style/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }]
304
+ ],
305
+ // -- END <style> tags handling
306
+ phpInSimpleState: [
307
+ [/<\?((php)|=)?/, "metatag.php"],
308
+ [/\?>/, { token: "metatag.php", switchTo: "@$S2.$S3" }],
309
+ { include: "phpRoot" }
310
+ ],
311
+ phpInEmbeddedState: [
312
+ [/<\?((php)|=)?/, "metatag.php"],
313
+ [
314
+ /\?>/,
315
+ {
316
+ token: "metatag.php",
317
+ switchTo: "@$S2.$S3",
318
+ nextEmbedded: "$S3"
319
+ }
320
+ ],
321
+ { include: "phpRoot" }
322
+ ],
323
+ phpRoot: [
324
+ [
325
+ /[a-zA-Z_]\w*/,
326
+ {
327
+ cases: {
328
+ "@phpKeywords": { token: "keyword.php" },
329
+ "@phpCompileTimeConstants": { token: "constant.php" },
330
+ "@default": "identifier.php"
331
+ }
332
+ }
333
+ ],
334
+ [
335
+ /[$a-zA-Z_]\w*/,
336
+ {
337
+ cases: {
338
+ "@phpPreDefinedVariables": {
339
+ token: "variable.predefined.php"
340
+ },
341
+ "@default": "variable.php"
342
+ }
343
+ }
344
+ ],
345
+ // brackets
346
+ [/[{}]/, "delimiter.bracket.php"],
347
+ [/[\[\]]/, "delimiter.array.php"],
348
+ [/[()]/, "delimiter.parenthesis.php"],
349
+ // whitespace
350
+ [/[ \t\r\n]+/],
351
+ // comments
352
+ [/(#|\/\/)$/, "comment.php"],
353
+ [/(#|\/\/)/, "comment.php", "@phpLineComment"],
354
+ // block comments
355
+ [/\/\*/, "comment.php", "@phpComment"],
356
+ // strings
357
+ [/"/, "string.php", "@phpDoubleQuoteString"],
358
+ [/'/, "string.php", "@phpSingleQuoteString"],
359
+ // delimiters
360
+ [/[\+\-\*\%\&\|\^\~\!\=\<\>\/\?\;\:\.\,\@]/, "delimiter.php"],
361
+ // numbers
362
+ [/\d*\d+[eE]([\-+]?\d+)?/, "number.float.php"],
363
+ [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float.php"],
364
+ [/0[xX][0-9a-fA-F']*[0-9a-fA-F]/, "number.hex.php"],
365
+ [/0[0-7']*[0-7]/, "number.octal.php"],
366
+ [/0[bB][0-1']*[0-1]/, "number.binary.php"],
367
+ [/\d[\d']*/, "number.php"],
368
+ [/\d/, "number.php"]
369
+ ],
370
+ phpComment: [
371
+ [/\*\//, "comment.php", "@pop"],
372
+ [/[^*]+/, "comment.php"],
373
+ [/./, "comment.php"]
374
+ ],
375
+ phpLineComment: [
376
+ [/\?>/, { token: "@rematch", next: "@pop" }],
377
+ [/.$/, "comment.php", "@pop"],
378
+ [/[^?]+$/, "comment.php", "@pop"],
379
+ [/[^?]+/, "comment.php"],
380
+ [/./, "comment.php"]
381
+ ],
382
+ phpDoubleQuoteString: [
383
+ [/[^\\"]+/, "string.php"],
384
+ [/@escapes/, "string.escape.php"],
385
+ [/\\./, "string.escape.invalid.php"],
386
+ [/"/, "string.php", "@pop"]
387
+ ],
388
+ phpSingleQuoteString: [
389
+ [/[^\\']+/, "string.php"],
390
+ [/@escapes/, "string.escape.php"],
391
+ [/\\./, "string.escape.invalid.php"],
392
+ [/'/, "string.php", "@pop"]
393
+ ]
394
+ },
395
+ phpKeywords: [
396
+ "abstract",
397
+ "and",
398
+ "array",
399
+ "as",
400
+ "break",
401
+ "callable",
402
+ "case",
403
+ "catch",
404
+ "cfunction",
405
+ "class",
406
+ "clone",
407
+ "const",
408
+ "continue",
409
+ "declare",
410
+ "default",
411
+ "do",
412
+ "else",
413
+ "elseif",
414
+ "enddeclare",
415
+ "endfor",
416
+ "endforeach",
417
+ "endif",
418
+ "endswitch",
419
+ "endwhile",
420
+ "extends",
421
+ "false",
422
+ "final",
423
+ "for",
424
+ "foreach",
425
+ "function",
426
+ "global",
427
+ "goto",
428
+ "if",
429
+ "implements",
430
+ "interface",
431
+ "instanceof",
432
+ "insteadof",
433
+ "namespace",
434
+ "new",
435
+ "null",
436
+ "object",
437
+ "old_function",
438
+ "or",
439
+ "private",
440
+ "protected",
441
+ "public",
442
+ "resource",
443
+ "static",
444
+ "switch",
445
+ "throw",
446
+ "trait",
447
+ "try",
448
+ "true",
449
+ "use",
450
+ "var",
451
+ "while",
452
+ "xor",
453
+ "die",
454
+ "echo",
455
+ "empty",
456
+ "exit",
457
+ "eval",
458
+ "include",
459
+ "include_once",
460
+ "isset",
461
+ "list",
462
+ "require",
463
+ "require_once",
464
+ "return",
465
+ "print",
466
+ "unset",
467
+ "yield",
468
+ "__construct"
469
+ ],
470
+ phpCompileTimeConstants: [
471
+ "__CLASS__",
472
+ "__DIR__",
473
+ "__FILE__",
474
+ "__LINE__",
475
+ "__NAMESPACE__",
476
+ "__METHOD__",
477
+ "__FUNCTION__",
478
+ "__TRAIT__"
479
+ ],
480
+ phpPreDefinedVariables: [
481
+ "$GLOBALS",
482
+ "$_SERVER",
483
+ "$_GET",
484
+ "$_POST",
485
+ "$_FILES",
486
+ "$_REQUEST",
487
+ "$_SESSION",
488
+ "$_ENV",
489
+ "$_COOKIE",
490
+ "$php_errormsg",
491
+ "$HTTP_RAW_POST_DATA",
492
+ "$http_response_header",
493
+ "$argc",
494
+ "$argv"
495
+ ],
496
+ escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/
497
+ };
498
+
499
+ export { conf, language };
@@ -0,0 +1,7 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "pla",
5
+ extensions: [".pla"],
6
+ loader: () => import('./pla.js')
7
+ });
package/pla/pla.js ADDED
@@ -0,0 +1,136 @@
1
+ const conf = {
2
+ comments: {
3
+ lineComment: "#"
4
+ },
5
+ brackets: [
6
+ ["[", "]"],
7
+ ["<", ">"],
8
+ ["(", ")"]
9
+ ],
10
+ autoClosingPairs: [
11
+ { open: "[", close: "]" },
12
+ { open: "<", close: ">" },
13
+ { open: "(", close: ")" }
14
+ ],
15
+ surroundingPairs: [
16
+ { open: "[", close: "]" },
17
+ { open: "<", close: ">" },
18
+ { open: "(", close: ")" }
19
+ ]
20
+ };
21
+ const language = {
22
+ defaultToken: "",
23
+ tokenPostfix: ".pla",
24
+ brackets: [
25
+ { open: "[", close: "]", token: "delimiter.square" },
26
+ { open: "<", close: ">", token: "delimiter.angle" },
27
+ { open: "(", close: ")", token: "delimiter.parenthesis" }
28
+ ],
29
+ keywords: [
30
+ ".i",
31
+ ".o",
32
+ ".mv",
33
+ ".ilb",
34
+ ".ob",
35
+ ".label",
36
+ ".type",
37
+ ".phase",
38
+ ".pair",
39
+ ".symbolic",
40
+ ".symbolic-output",
41
+ ".kiss",
42
+ ".p",
43
+ ".e",
44
+ ".end"
45
+ ],
46
+ // regular expressions
47
+ comment: /#.*$/,
48
+ identifier: /[a-zA-Z]+[a-zA-Z0-9_\-]*/,
49
+ plaContent: /[01\-~\|]+/,
50
+ // The main tokenizer for our languages
51
+ tokenizer: {
52
+ root: [
53
+ // comments and whitespace
54
+ { include: "@whitespace" },
55
+ [/@comment/, "comment"],
56
+ // keyword
57
+ [
58
+ /\.([a-zA-Z_\-]+)/,
59
+ {
60
+ cases: {
61
+ "@eos": { token: "keyword.$1" },
62
+ "@keywords": {
63
+ cases: {
64
+ ".type": { token: "keyword.$1", next: "@type" },
65
+ "@default": { token: "keyword.$1", next: "@keywordArg" }
66
+ }
67
+ },
68
+ "@default": { token: "keyword.$1" }
69
+ }
70
+ }
71
+ ],
72
+ // identifiers
73
+ [/@identifier/, "identifier"],
74
+ // PLA row
75
+ [/@plaContent/, "string"]
76
+ ],
77
+ whitespace: [[/[ \t\r\n]+/, ""]],
78
+ type: [{ include: "@whitespace" }, [/\w+/, { token: "type", next: "@pop" }]],
79
+ keywordArg: [
80
+ // whitespace
81
+ [
82
+ /[ \t\r\n]+/,
83
+ {
84
+ cases: {
85
+ "@eos": { token: "", next: "@pop" },
86
+ "@default": ""
87
+ }
88
+ }
89
+ ],
90
+ // comments
91
+ [/@comment/, "comment", "@pop"],
92
+ // brackets
93
+ [
94
+ /[<>()\[\]]/,
95
+ {
96
+ cases: {
97
+ "@eos": { token: "@brackets", next: "@pop" },
98
+ "@default": "@brackets"
99
+ }
100
+ }
101
+ ],
102
+ // numbers
103
+ [
104
+ /\-?\d+/,
105
+ {
106
+ cases: {
107
+ "@eos": { token: "number", next: "@pop" },
108
+ "@default": "number"
109
+ }
110
+ }
111
+ ],
112
+ // identifiers
113
+ [
114
+ /@identifier/,
115
+ {
116
+ cases: {
117
+ "@eos": { token: "identifier", next: "@pop" },
118
+ "@default": "identifier"
119
+ }
120
+ }
121
+ ],
122
+ // delimiter
123
+ [
124
+ /[;=]/,
125
+ {
126
+ cases: {
127
+ "@eos": { token: "delimiter", next: "@pop" },
128
+ "@default": "delimiter"
129
+ }
130
+ }
131
+ ]
132
+ ]
133
+ }
134
+ };
135
+
136
+ export { conf, language };
@@ -0,0 +1,8 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "postiats",
5
+ extensions: [".dats", ".sats", ".hats"],
6
+ aliases: ["ATS", "ATS/Postiats"],
7
+ loader: () => import('./postiats.js')
8
+ });