@codingame/monaco-vscode-standalone-languages 23.2.0 → 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,251 @@
1
+ const conf = {
2
+ // the default separators except `@$`
3
+ wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
4
+ comments: {
5
+ lineComment: "//",
6
+ blockComment: ["/*", "*/"]
7
+ },
8
+ brackets: [
9
+ ["{", "}"],
10
+ ["[", "]"],
11
+ ["(", ")"]
12
+ ],
13
+ autoClosingPairs: [
14
+ { open: "{", close: "}" },
15
+ { open: "[", close: "]" },
16
+ { open: "(", close: ")" },
17
+ { open: '"', close: '"' },
18
+ { open: "'", close: "'" }
19
+ ],
20
+ surroundingPairs: [
21
+ { open: "{", close: "}" },
22
+ { open: "[", close: "]" },
23
+ { open: "(", close: ")" },
24
+ { open: '"', close: '"' },
25
+ { open: "'", close: "'" },
26
+ { open: "<", close: ">" }
27
+ ],
28
+ folding: {
29
+ markers: {
30
+ start: new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),
31
+ end: new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")
32
+ }
33
+ }
34
+ };
35
+ const language = {
36
+ defaultToken: "",
37
+ tokenPostfix: ".kt",
38
+ keywords: [
39
+ "as",
40
+ "as?",
41
+ "break",
42
+ "class",
43
+ "continue",
44
+ "do",
45
+ "else",
46
+ "false",
47
+ "for",
48
+ "fun",
49
+ "if",
50
+ "in",
51
+ "!in",
52
+ "interface",
53
+ "is",
54
+ "!is",
55
+ "null",
56
+ "object",
57
+ "package",
58
+ "return",
59
+ "super",
60
+ "this",
61
+ "throw",
62
+ "true",
63
+ "try",
64
+ "typealias",
65
+ "val",
66
+ "var",
67
+ "when",
68
+ "while",
69
+ "by",
70
+ "catch",
71
+ "constructor",
72
+ "delegate",
73
+ "dynamic",
74
+ "field",
75
+ "file",
76
+ "finally",
77
+ "get",
78
+ "import",
79
+ "init",
80
+ "param",
81
+ "property",
82
+ "receiver",
83
+ "set",
84
+ "setparam",
85
+ "where",
86
+ "actual",
87
+ "abstract",
88
+ "annotation",
89
+ "companion",
90
+ "const",
91
+ "crossinline",
92
+ "data",
93
+ "enum",
94
+ "expect",
95
+ "external",
96
+ "final",
97
+ "infix",
98
+ "inline",
99
+ "inner",
100
+ "internal",
101
+ "lateinit",
102
+ "noinline",
103
+ "open",
104
+ "operator",
105
+ "out",
106
+ "override",
107
+ "private",
108
+ "protected",
109
+ "public",
110
+ "reified",
111
+ "sealed",
112
+ "suspend",
113
+ "tailrec",
114
+ "vararg",
115
+ "field",
116
+ "it"
117
+ ],
118
+ operators: [
119
+ "+",
120
+ "-",
121
+ "*",
122
+ "/",
123
+ "%",
124
+ "=",
125
+ "+=",
126
+ "-=",
127
+ "*=",
128
+ "/=",
129
+ "%=",
130
+ "++",
131
+ "--",
132
+ "&&",
133
+ "||",
134
+ "!",
135
+ "==",
136
+ "!=",
137
+ "===",
138
+ "!==",
139
+ ">",
140
+ "<",
141
+ "<=",
142
+ ">=",
143
+ "[",
144
+ "]",
145
+ "!!",
146
+ "?.",
147
+ "?:",
148
+ "::",
149
+ "..",
150
+ ":",
151
+ "?",
152
+ "->",
153
+ "@",
154
+ ";",
155
+ "$",
156
+ "_"
157
+ ],
158
+ // we include these common regular expressions
159
+ symbols: /[=><!~?:&|+\-*\/\^%]+/,
160
+ escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
161
+ digits: /\d+(_+\d+)*/,
162
+ octaldigits: /[0-7]+(_+[0-7]+)*/,
163
+ binarydigits: /[0-1]+(_+[0-1]+)*/,
164
+ hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,
165
+ // The main tokenizer for our languages
166
+ tokenizer: {
167
+ root: [
168
+ // class name highlighting
169
+ [/[A-Z][\w\$]*/, "type.identifier"],
170
+ // identifiers and keywords
171
+ [
172
+ /[a-zA-Z_$][\w$]*/,
173
+ {
174
+ cases: {
175
+ "@keywords": { token: "keyword.$0" },
176
+ "@default": "identifier"
177
+ }
178
+ }
179
+ ],
180
+ // whitespace
181
+ { include: "@whitespace" },
182
+ // delimiters and operators
183
+ [/[{}()\[\]]/, "@brackets"],
184
+ [/[<>](?!@symbols)/, "@brackets"],
185
+ [
186
+ /@symbols/,
187
+ {
188
+ cases: {
189
+ "@operators": "delimiter",
190
+ "@default": ""
191
+ }
192
+ }
193
+ ],
194
+ // @ annotations.
195
+ [/@\s*[a-zA-Z_\$][\w\$]*/, "annotation"],
196
+ // numbers
197
+ [/(@digits)[eE]([\-+]?(@digits))?[fF]?/, "number.float"],
198
+ [/(@digits)?\.(@digits)([eE][\-+]?(@digits))?[fF]?/, "number.float"],
199
+ [/0[xX](@hexdigits)[uU]?L?/, "number.hex"],
200
+ [/0[bB](@binarydigits)[uU]?L?/, "number.binary"],
201
+ [/(@digits)[fF]/, "number.float"],
202
+ [/(@digits)[uU]?L?/, "number"],
203
+ // delimiter: after number because of .\d floats
204
+ [/[;,.]/, "delimiter"],
205
+ // strings
206
+ [/"([^"\\]|\\.)*$/, "string.invalid"],
207
+ // non-teminated string
208
+ [/"""/, "string", "@multistring"],
209
+ [/"/, "string", "@string"],
210
+ // characters
211
+ [/'[^\\']'/, "string"],
212
+ [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
213
+ [/'/, "string.invalid"]
214
+ ],
215
+ whitespace: [
216
+ [/[ \t\r\n]+/, ""],
217
+ [/\/\*\*(?!\/)/, "comment.doc", "@javadoc"],
218
+ [/\/\*/, "comment", "@comment"],
219
+ [/\/\/.*$/, "comment"]
220
+ ],
221
+ comment: [
222
+ [/[^\/*]+/, "comment"],
223
+ [/\/\*/, "comment", "@comment"],
224
+ [/\*\//, "comment", "@pop"],
225
+ [/[\/*]/, "comment"]
226
+ ],
227
+ //Identical copy of comment above, except for the addition of .doc
228
+ javadoc: [
229
+ [/[^\/*]+/, "comment.doc"],
230
+ [/\/\*/, "comment.doc", "@push"],
231
+ [/\/\*/, "comment.doc.invalid"],
232
+ [/\*\//, "comment.doc", "@pop"],
233
+ [/[\/*]/, "comment.doc"]
234
+ ],
235
+ string: [
236
+ [/[^\\"]+/, "string"],
237
+ [/@escapes/, "string.escape"],
238
+ [/\\./, "string.escape.invalid"],
239
+ [/"/, "string", "@pop"]
240
+ ],
241
+ multistring: [
242
+ [/[^\\"]+/, "string"],
243
+ [/@escapes/, "string.escape"],
244
+ [/\\./, "string.escape.invalid"],
245
+ [/"""/, "string", "@pop"],
246
+ [/./, "string"]
247
+ ]
248
+ }
249
+ };
250
+
251
+ export { conf, language };
@@ -0,0 +1,9 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "less",
5
+ extensions: [".less"],
6
+ aliases: ["Less", "less"],
7
+ mimetypes: ["text/x-less", "text/less"],
8
+ loader: () => import('./less.js')
9
+ });
package/less/less.js ADDED
@@ -0,0 +1,160 @@
1
+ const conf = {
2
+ wordPattern: /(#?-?\d*\.\d\w*%?)|([@#!.:]?[\w-?]+%?)|[@#!.]/g,
3
+ comments: {
4
+ blockComment: ["/*", "*/"],
5
+ lineComment: "//"
6
+ },
7
+ brackets: [
8
+ ["{", "}"],
9
+ ["[", "]"],
10
+ ["(", ")"]
11
+ ],
12
+ autoClosingPairs: [
13
+ { open: "{", close: "}", notIn: ["string", "comment"] },
14
+ { open: "[", close: "]", notIn: ["string", "comment"] },
15
+ { open: "(", close: ")", notIn: ["string", "comment"] },
16
+ { open: '"', close: '"', notIn: ["string", "comment"] },
17
+ { open: "'", close: "'", notIn: ["string", "comment"] }
18
+ ],
19
+ surroundingPairs: [
20
+ { open: "{", close: "}" },
21
+ { open: "[", close: "]" },
22
+ { open: "(", close: ")" },
23
+ { open: '"', close: '"' },
24
+ { open: "'", close: "'" }
25
+ ],
26
+ folding: {
27
+ markers: {
28
+ start: new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),
29
+ end: new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")
30
+ }
31
+ }
32
+ };
33
+ const language = {
34
+ defaultToken: "",
35
+ tokenPostfix: ".less",
36
+ identifier: "-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",
37
+ identifierPlus: "-?-?([a-zA-Z:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",
38
+ brackets: [
39
+ { open: "{", close: "}", token: "delimiter.curly" },
40
+ { open: "[", close: "]", token: "delimiter.bracket" },
41
+ { open: "(", close: ")", token: "delimiter.parenthesis" },
42
+ { open: "<", close: ">", token: "delimiter.angle" }
43
+ ],
44
+ tokenizer: {
45
+ root: [
46
+ { include: "@nestedJSBegin" },
47
+ ["[ \\t\\r\\n]+", ""],
48
+ { include: "@comments" },
49
+ { include: "@keyword" },
50
+ { include: "@strings" },
51
+ { include: "@numbers" },
52
+ ["[*_]?[a-zA-Z\\-\\s]+(?=:.*(;|(\\\\$)))", "attribute.name", "@attribute"],
53
+ ["url(\\-prefix)?\\(", { token: "tag", next: "@urldeclaration" }],
54
+ ["[{}()\\[\\]]", "@brackets"],
55
+ ["[,:;]", "delimiter"],
56
+ ["#@identifierPlus", "tag.id"],
57
+ ["&", "tag"],
58
+ ["\\.@identifierPlus(?=\\()", "tag.class", "@attribute"],
59
+ ["\\.@identifierPlus", "tag.class"],
60
+ ["@identifierPlus", "tag"],
61
+ { include: "@operators" },
62
+ ["@(@identifier(?=[:,\\)]))", "variable", "@attribute"],
63
+ ["@(@identifier)", "variable"],
64
+ ["@", "key", "@atRules"]
65
+ ],
66
+ nestedJSBegin: [
67
+ ["``", "delimiter.backtick"],
68
+ [
69
+ "`",
70
+ {
71
+ token: "delimiter.backtick",
72
+ next: "@nestedJSEnd",
73
+ nextEmbedded: "text/javascript"
74
+ }
75
+ ]
76
+ ],
77
+ nestedJSEnd: [
78
+ [
79
+ "`",
80
+ {
81
+ token: "delimiter.backtick",
82
+ next: "@pop",
83
+ nextEmbedded: "@pop"
84
+ }
85
+ ]
86
+ ],
87
+ operators: [["[<>=\\+\\-\\*\\/\\^\\|\\~]", "operator"]],
88
+ keyword: [
89
+ [
90
+ "(@[\\s]*import|![\\s]*important|true|false|when|iscolor|isnumber|isstring|iskeyword|isurl|ispixel|ispercentage|isem|hue|saturation|lightness|alpha|lighten|darken|saturate|desaturate|fadein|fadeout|fade|spin|mix|round|ceil|floor|percentage)\\b",
91
+ "keyword"
92
+ ]
93
+ ],
94
+ urldeclaration: [
95
+ { include: "@strings" },
96
+ ["[^)\r\n]+", "string"],
97
+ ["\\)", { token: "tag", next: "@pop" }]
98
+ ],
99
+ attribute: [
100
+ { include: "@nestedJSBegin" },
101
+ { include: "@comments" },
102
+ { include: "@strings" },
103
+ { include: "@numbers" },
104
+ { include: "@keyword" },
105
+ ["[a-zA-Z\\-]+(?=\\()", "attribute.value", "@attribute"],
106
+ [">", "operator", "@pop"],
107
+ ["@identifier", "attribute.value"],
108
+ { include: "@operators" },
109
+ ["@(@identifier)", "variable"],
110
+ ["[)\\}]", "@brackets", "@pop"],
111
+ ["[{}()\\[\\]>]", "@brackets"],
112
+ ["[;]", "delimiter", "@pop"],
113
+ ["[,=:]", "delimiter"],
114
+ ["\\s", ""],
115
+ [".", "attribute.value"]
116
+ ],
117
+ comments: [
118
+ ["\\/\\*", "comment", "@comment"],
119
+ ["\\/\\/+.*", "comment"]
120
+ ],
121
+ comment: [
122
+ ["\\*\\/", "comment", "@pop"],
123
+ [".", "comment"]
124
+ ],
125
+ numbers: [
126
+ ["(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?", { token: "attribute.value.number", next: "@units" }],
127
+ ["#[0-9a-fA-F_]+(?!\\w)", "attribute.value.hex"]
128
+ ],
129
+ units: [
130
+ [
131
+ "(em|ex|ch|rem|fr|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?",
132
+ "attribute.value.unit",
133
+ "@pop"
134
+ ]
135
+ ],
136
+ strings: [
137
+ ['~?"', { token: "string.delimiter", next: "@stringsEndDoubleQuote" }],
138
+ ["~?'", { token: "string.delimiter", next: "@stringsEndQuote" }]
139
+ ],
140
+ stringsEndDoubleQuote: [
141
+ ['\\\\"', "string"],
142
+ ['"', { token: "string.delimiter", next: "@popall" }],
143
+ [".", "string"]
144
+ ],
145
+ stringsEndQuote: [
146
+ ["\\\\'", "string"],
147
+ ["'", { token: "string.delimiter", next: "@popall" }],
148
+ [".", "string"]
149
+ ],
150
+ atRules: [
151
+ { include: "@comments" },
152
+ { include: "@strings" },
153
+ ["[()]", "delimiter"],
154
+ ["[\\{;]", "delimiter", "@pop"],
155
+ [".", "key"]
156
+ ]
157
+ }
158
+ };
159
+
160
+ export { conf, language };
@@ -0,0 +1,8 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "lexon",
5
+ extensions: [".lex"],
6
+ aliases: ["Lexon"],
7
+ loader: () => import('./lexon.js')
8
+ });
package/lexon/lexon.js ADDED
@@ -0,0 +1,156 @@
1
+ const conf = {
2
+ comments: {
3
+ lineComment: "COMMENT"
4
+ // blockComment: ['COMMENT', '.'],
5
+ },
6
+ brackets: [["(", ")"]],
7
+ autoClosingPairs: [
8
+ { open: "{", close: "}" },
9
+ { open: "[", close: "]" },
10
+ { open: "(", close: ")" },
11
+ { open: '"', close: '"' },
12
+ { open: ":", close: "." }
13
+ ],
14
+ surroundingPairs: [
15
+ { open: "{", close: "}" },
16
+ { open: "[", close: "]" },
17
+ { open: "(", close: ")" },
18
+ { open: "`", close: "`" },
19
+ { open: '"', close: '"' },
20
+ { open: "'", close: "'" },
21
+ { open: ":", close: "." }
22
+ ],
23
+ folding: {
24
+ markers: {
25
+ start: new RegExp("^\\s*(::\\s*|COMMENT\\s+)#region"),
26
+ end: new RegExp("^\\s*(::\\s*|COMMENT\\s+)#endregion")
27
+ }
28
+ }
29
+ };
30
+ const language = {
31
+ // Set defaultToken to invalid to see what you do not tokenize yet
32
+ // defaultToken: 'invalid',
33
+ tokenPostfix: ".lexon",
34
+ ignoreCase: true,
35
+ keywords: [
36
+ "lexon",
37
+ "lex",
38
+ "clause",
39
+ "terms",
40
+ "contracts",
41
+ "may",
42
+ "pay",
43
+ "pays",
44
+ "appoints",
45
+ "into",
46
+ "to"
47
+ ],
48
+ typeKeywords: ["amount", "person", "key", "time", "date", "asset", "text"],
49
+ operators: [
50
+ "less",
51
+ "greater",
52
+ "equal",
53
+ "le",
54
+ "gt",
55
+ "or",
56
+ "and",
57
+ "add",
58
+ "added",
59
+ "subtract",
60
+ "subtracted",
61
+ "multiply",
62
+ "multiplied",
63
+ "times",
64
+ "divide",
65
+ "divided",
66
+ "is",
67
+ "be",
68
+ "certified"
69
+ ],
70
+ // we include these common regular expressions
71
+ symbols: /[=><!~?:&|+\-*\/\^%]+/,
72
+ // The main tokenizer for our languages
73
+ tokenizer: {
74
+ root: [
75
+ // comment
76
+ [/^(\s*)(comment:?(?:\s.*|))$/, ["", "comment"]],
77
+ // special identifier cases
78
+ [
79
+ /"/,
80
+ {
81
+ token: "identifier.quote",
82
+ bracket: "@open",
83
+ next: "@quoted_identifier"
84
+ }
85
+ ],
86
+ [
87
+ "LEX$",
88
+ {
89
+ token: "keyword",
90
+ bracket: "@open",
91
+ next: "@identifier_until_period"
92
+ }
93
+ ],
94
+ ["LEXON", { token: "keyword", bracket: "@open", next: "@semver" }],
95
+ [
96
+ ":",
97
+ {
98
+ token: "delimiter",
99
+ bracket: "@open",
100
+ next: "@identifier_until_period"
101
+ }
102
+ ],
103
+ // identifiers and keywords
104
+ [
105
+ /[a-z_$][\w$]*/,
106
+ {
107
+ cases: {
108
+ "@operators": "operator",
109
+ "@typeKeywords": "keyword.type",
110
+ "@keywords": "keyword",
111
+ "@default": "identifier"
112
+ }
113
+ }
114
+ ],
115
+ // whitespace
116
+ { include: "@whitespace" },
117
+ // delimiters and operators
118
+ [/[{}()\[\]]/, "@brackets"],
119
+ [/[<>](?!@symbols)/, "@brackets"],
120
+ [/@symbols/, "delimiter"],
121
+ // numbers
122
+ [/\d*\.\d*\.\d*/, "number.semver"],
123
+ [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
124
+ [/0[xX][0-9a-fA-F]+/, "number.hex"],
125
+ [/\d+/, "number"],
126
+ // delimiter: after number because of .\d floats
127
+ [/[;,.]/, "delimiter"]
128
+ ],
129
+ quoted_identifier: [
130
+ [/[^\\"]+/, "identifier"],
131
+ [/"/, { token: "identifier.quote", bracket: "@close", next: "@pop" }]
132
+ ],
133
+ space_identifier_until_period: [
134
+ [":", "delimiter"],
135
+ [" ", { token: "white", next: "@identifier_rest" }]
136
+ ],
137
+ identifier_until_period: [
138
+ { include: "@whitespace" },
139
+ [":", { token: "delimiter", next: "@identifier_rest" }],
140
+ [/[^\\.]+/, "identifier"],
141
+ [/\./, { token: "delimiter", bracket: "@close", next: "@pop" }]
142
+ ],
143
+ identifier_rest: [
144
+ [/[^\\.]+/, "identifier"],
145
+ [/\./, { token: "delimiter", bracket: "@close", next: "@pop" }]
146
+ ],
147
+ semver: [
148
+ { include: "@whitespace" },
149
+ [":", "delimiter"],
150
+ [/\d*\.\d*\.\d*/, { token: "number.semver", bracket: "@close", next: "@pop" }]
151
+ ],
152
+ whitespace: [[/[ \t\r\n]+/, "white"]]
153
+ }
154
+ };
155
+
156
+ export { conf, language };
@@ -0,0 +1,9 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "liquid",
5
+ extensions: [".liquid", ".html.liquid"],
6
+ aliases: ["Liquid", "liquid"],
7
+ mimetypes: ["application/liquid"],
8
+ loader: () => import('./liquid.js')
9
+ });