@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
package/tcl/tcl.js ADDED
@@ -0,0 +1,231 @@
1
+ const conf = {
2
+ brackets: [
3
+ ["{", "}"],
4
+ ["[", "]"],
5
+ ["(", ")"]
6
+ ],
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
+ ]
21
+ };
22
+ const language = {
23
+ tokenPostfix: ".tcl",
24
+ specialFunctions: [
25
+ "set",
26
+ "unset",
27
+ "rename",
28
+ "variable",
29
+ "proc",
30
+ "coroutine",
31
+ "foreach",
32
+ "incr",
33
+ "append",
34
+ "lappend",
35
+ "linsert",
36
+ "lreplace"
37
+ ],
38
+ mainFunctions: [
39
+ "if",
40
+ "then",
41
+ "elseif",
42
+ "else",
43
+ "case",
44
+ "switch",
45
+ "while",
46
+ "for",
47
+ "break",
48
+ "continue",
49
+ "return",
50
+ "package",
51
+ "namespace",
52
+ "catch",
53
+ "exit",
54
+ "eval",
55
+ "expr",
56
+ "uplevel",
57
+ "upvar"
58
+ ],
59
+ builtinFunctions: [
60
+ "file",
61
+ "info",
62
+ "concat",
63
+ "join",
64
+ "lindex",
65
+ "list",
66
+ "llength",
67
+ "lrange",
68
+ "lsearch",
69
+ "lsort",
70
+ "split",
71
+ "array",
72
+ "parray",
73
+ "binary",
74
+ "format",
75
+ "regexp",
76
+ "regsub",
77
+ "scan",
78
+ "string",
79
+ "subst",
80
+ "dict",
81
+ "cd",
82
+ "clock",
83
+ "exec",
84
+ "glob",
85
+ "pid",
86
+ "pwd",
87
+ "close",
88
+ "eof",
89
+ "fblocked",
90
+ "fconfigure",
91
+ "fcopy",
92
+ "fileevent",
93
+ "flush",
94
+ "gets",
95
+ "open",
96
+ "puts",
97
+ "read",
98
+ "seek",
99
+ "socket",
100
+ "tell",
101
+ "interp",
102
+ "after",
103
+ "auto_execok",
104
+ "auto_load",
105
+ "auto_mkindex",
106
+ "auto_reset",
107
+ "bgerror",
108
+ "error",
109
+ "global",
110
+ "history",
111
+ "load",
112
+ "source",
113
+ "time",
114
+ "trace",
115
+ "unknown",
116
+ "unset",
117
+ "update",
118
+ "vwait",
119
+ "winfo",
120
+ "wm",
121
+ "bind",
122
+ "event",
123
+ "pack",
124
+ "place",
125
+ "grid",
126
+ "font",
127
+ "bell",
128
+ "clipboard",
129
+ "destroy",
130
+ "focus",
131
+ "grab",
132
+ "lower",
133
+ "option",
134
+ "raise",
135
+ "selection",
136
+ "send",
137
+ "tk",
138
+ "tkwait",
139
+ "tk_bisque",
140
+ "tk_focusNext",
141
+ "tk_focusPrev",
142
+ "tk_focusFollowsMouse",
143
+ "tk_popup",
144
+ "tk_setPalette"
145
+ ],
146
+ symbols: /[=><!~?:&|+\-*\/\^%]+/,
147
+ brackets: [
148
+ { open: "(", close: ")", token: "delimiter.parenthesis" },
149
+ { open: "{", close: "}", token: "delimiter.curly" },
150
+ { open: "[", close: "]", token: "delimiter.square" }
151
+ ],
152
+ escapes: /\\(?:[abfnrtv\\"'\[\]\{\};\$]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
153
+ variables: /(?:\$+(?:(?:\:\:?)?[a-zA-Z_]\w*)+)/,
154
+ tokenizer: {
155
+ root: [
156
+ // identifiers and keywords
157
+ [
158
+ /[a-zA-Z_]\w*/,
159
+ {
160
+ cases: {
161
+ "@specialFunctions": {
162
+ token: "keyword.flow",
163
+ next: "@specialFunc"
164
+ },
165
+ "@mainFunctions": "keyword",
166
+ "@builtinFunctions": "variable",
167
+ "@default": "operator.scss"
168
+ }
169
+ }
170
+ ],
171
+ [/\s+\-+(?!\d|\.)\w*|{\*}/, "metatag"],
172
+ // whitespace
173
+ { include: "@whitespace" },
174
+ // delimiters and operators
175
+ [/[{}()\[\]]/, "@brackets"],
176
+ [/@symbols/, "operator"],
177
+ [/\$+(?:\:\:)?\{/, { token: "identifier", next: "@nestedVariable" }],
178
+ [/@variables/, "type.identifier"],
179
+ [/\.(?!\d|\.)[\w\-]*/, "operator.sql"],
180
+ // numbers
181
+ [/\d+(\.\d+)?/, "number"],
182
+ [/\d+/, "number"],
183
+ // delimiter
184
+ [/;/, "delimiter"],
185
+ // strings
186
+ [/"/, { token: "string.quote", bracket: "@open", next: "@dstring" }],
187
+ [/'/, { token: "string.quote", bracket: "@open", next: "@sstring" }]
188
+ ],
189
+ dstring: [
190
+ [/\[/, { token: "@brackets", next: "@nestedCall" }],
191
+ [/\$+(?:\:\:)?\{/, { token: "identifier", next: "@nestedVariable" }],
192
+ [/@variables/, "type.identifier"],
193
+ [/[^\\$\[\]"]+/, "string"],
194
+ [/@escapes/, "string.escape"],
195
+ [/"/, { token: "string.quote", bracket: "@close", next: "@pop" }]
196
+ ],
197
+ sstring: [
198
+ [/\[/, { token: "@brackets", next: "@nestedCall" }],
199
+ [/\$+(?:\:\:)?\{/, { token: "identifier", next: "@nestedVariable" }],
200
+ [/@variables/, "type.identifier"],
201
+ [/[^\\$\[\]']+/, "string"],
202
+ [/@escapes/, "string.escape"],
203
+ [/'/, { token: "string.quote", bracket: "@close", next: "@pop" }]
204
+ ],
205
+ whitespace: [
206
+ [/[ \t\r\n]+/, "white"],
207
+ [/#.*\\$/, { token: "comment", next: "@newlineComment" }],
208
+ [/#.*(?!\\)$/, "comment"]
209
+ ],
210
+ newlineComment: [
211
+ [/.*\\$/, "comment"],
212
+ [/.*(?!\\)$/, { token: "comment", next: "@pop" }]
213
+ ],
214
+ nestedVariable: [
215
+ [/[^\{\}\$]+/, "type.identifier"],
216
+ [/\}/, { token: "identifier", next: "@pop" }]
217
+ ],
218
+ nestedCall: [
219
+ [/\[/, { token: "@brackets", next: "@nestedCall" }],
220
+ [/\]/, { token: "@brackets", next: "@pop" }],
221
+ { include: "root" }
222
+ ],
223
+ specialFunc: [
224
+ [/"/, { token: "string", next: "@dstring" }],
225
+ [/'/, { token: "string", next: "@sstring" }],
226
+ [/\S+/, { token: "type", next: "@pop" }]
227
+ ]
228
+ }
229
+ };
230
+
231
+ export { conf, language };
@@ -0,0 +1,9 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "twig",
5
+ extensions: [".twig"],
6
+ aliases: ["Twig", "twig"],
7
+ mimetypes: ["text/x-twig"],
8
+ loader: () => import('./twig.js')
9
+ });
package/twig/twig.js ADDED
@@ -0,0 +1,391 @@
1
+ const conf = {
2
+ wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
3
+ comments: {
4
+ blockComment: ["{#", "#}"]
5
+ },
6
+ brackets: [
7
+ ["{#", "#}"],
8
+ ["{%", "%}"],
9
+ ["{{", "}}"],
10
+ ["(", ")"],
11
+ ["[", "]"],
12
+ // HTML
13
+ ["<!--", "-->"],
14
+ ["<", ">"]
15
+ ],
16
+ autoClosingPairs: [
17
+ { open: "{# ", close: " #}" },
18
+ { open: "{% ", close: " %}" },
19
+ { open: "{{ ", close: " }}" },
20
+ { open: "[", close: "]" },
21
+ { open: "(", close: ")" },
22
+ { open: '"', close: '"' },
23
+ { open: "'", close: "'" }
24
+ ],
25
+ surroundingPairs: [
26
+ { open: '"', close: '"' },
27
+ { open: "'", close: "'" },
28
+ // HTML
29
+ { open: "<", close: ">" }
30
+ ]
31
+ };
32
+ const language = {
33
+ defaultToken: "",
34
+ tokenPostfix: "",
35
+ ignoreCase: true,
36
+ keywords: [
37
+ // (opening) tags
38
+ "apply",
39
+ "autoescape",
40
+ "block",
41
+ "deprecated",
42
+ "do",
43
+ "embed",
44
+ "extends",
45
+ "flush",
46
+ "for",
47
+ "from",
48
+ "if",
49
+ "import",
50
+ "include",
51
+ "macro",
52
+ "sandbox",
53
+ "set",
54
+ "use",
55
+ "verbatim",
56
+ "with",
57
+ // closing tags
58
+ "endapply",
59
+ "endautoescape",
60
+ "endblock",
61
+ "endembed",
62
+ "endfor",
63
+ "endif",
64
+ "endmacro",
65
+ "endsandbox",
66
+ "endset",
67
+ "endwith",
68
+ // literals
69
+ "true",
70
+ "false"
71
+ ],
72
+ tokenizer: {
73
+ root: [
74
+ // whitespace
75
+ [/\s+/],
76
+ // Twig Tag Delimiters
77
+ [/{#/, "comment.twig", "@commentState"],
78
+ [/{%[-~]?/, "delimiter.twig", "@blockState"],
79
+ [/{{[-~]?/, "delimiter.twig", "@variableState"],
80
+ // HTML
81
+ [/<!DOCTYPE/, "metatag.html", "@doctype"],
82
+ [/<!--/, "comment.html", "@comment"],
83
+ [/(<)((?:[\w\-]+:)?[\w\-]+)(\s*)(\/>)/, ["delimiter.html", "tag.html", "", "delimiter.html"]],
84
+ [/(<)(script)/, ["delimiter.html", { token: "tag.html", next: "@script" }]],
85
+ [/(<)(style)/, ["delimiter.html", { token: "tag.html", next: "@style" }]],
86
+ [/(<)((?:[\w\-]+:)?[\w\-]+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
87
+ [/(<\/)((?:[\w\-]+:)?[\w\-]+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
88
+ [/</, "delimiter.html"],
89
+ [/[^<{]+/]
90
+ // text
91
+ ],
92
+ /**
93
+ * Comment Tag Handling
94
+ */
95
+ commentState: [
96
+ [/#}/, "comment.twig", "@pop"],
97
+ [/./, "comment.twig"]
98
+ ],
99
+ /**
100
+ * Block Tag Handling
101
+ */
102
+ blockState: [
103
+ [/[-~]?%}/, "delimiter.twig", "@pop"],
104
+ // whitespace
105
+ [/\s+/],
106
+ // verbatim
107
+ // Unlike other blocks, verbatim ehas its own state
108
+ // transition to ensure we mark its contents as strings.
109
+ [
110
+ /(verbatim)(\s*)([-~]?%})/,
111
+ ["keyword.twig", "", { token: "delimiter.twig", next: "@rawDataState" }]
112
+ ],
113
+ { include: "expression" }
114
+ ],
115
+ rawDataState: [
116
+ // endverbatim
117
+ [
118
+ /({%[-~]?)(\s*)(endverbatim)(\s*)([-~]?%})/,
119
+ ["delimiter.twig", "", "keyword.twig", "", { token: "delimiter.twig", next: "@popall" }]
120
+ ],
121
+ [/./, "string.twig"]
122
+ ],
123
+ /**
124
+ * Variable Tag Handling
125
+ */
126
+ variableState: [[/[-~]?}}/, "delimiter.twig", "@pop"], { include: "expression" }],
127
+ stringState: [
128
+ // closing double quoted string
129
+ [/"/, "string.twig", "@pop"],
130
+ // interpolation start
131
+ [/#{\s*/, "string.twig", "@interpolationState"],
132
+ // string part
133
+ [/[^#"\\]*(?:(?:\\.|#(?!\{))[^#"\\]*)*/, "string.twig"]
134
+ ],
135
+ interpolationState: [
136
+ // interpolation end
137
+ [/}/, "string.twig", "@pop"],
138
+ { include: "expression" }
139
+ ],
140
+ /**
141
+ * Expression Handling
142
+ */
143
+ expression: [
144
+ // whitespace
145
+ [/\s+/],
146
+ // operators - math
147
+ [/\+|-|\/{1,2}|%|\*{1,2}/, "operators.twig"],
148
+ // operators - logic
149
+ [/(and|or|not|b-and|b-xor|b-or)(\s+)/, ["operators.twig", ""]],
150
+ // operators - comparison (symbols)
151
+ [/==|!=|<|>|>=|<=/, "operators.twig"],
152
+ // operators - comparison (words)
153
+ [/(starts with|ends with|matches)(\s+)/, ["operators.twig", ""]],
154
+ // operators - containment
155
+ [/(in)(\s+)/, ["operators.twig", ""]],
156
+ // operators - test
157
+ [/(is)(\s+)/, ["operators.twig", ""]],
158
+ // operators - misc
159
+ [/\||~|:|\.{1,2}|\?{1,2}/, "operators.twig"],
160
+ // names
161
+ [
162
+ /[^\W\d][\w]*/,
163
+ {
164
+ cases: {
165
+ "@keywords": "keyword.twig",
166
+ "@default": "variable.twig"
167
+ }
168
+ }
169
+ ],
170
+ // numbers
171
+ [/\d+(\.\d+)?/, "number.twig"],
172
+ // punctuation
173
+ [/\(|\)|\[|\]|{|}|,/, "delimiter.twig"],
174
+ // strings
175
+ [/"([^#"\\]*(?:\\.[^#"\\]*)*)"|\'([^\'\\]*(?:\\.[^\'\\]*)*)\'/, "string.twig"],
176
+ // opening double quoted string
177
+ [/"/, "string.twig", "@stringState"],
178
+ // misc syntactic constructs
179
+ // These are not operators per se, but for the purposes of lexical analysis we
180
+ // can treat them as such.
181
+ // arrow functions
182
+ [/=>/, "operators.twig"],
183
+ // assignment
184
+ [/=/, "operators.twig"]
185
+ ],
186
+ /**
187
+ * HTML
188
+ */
189
+ doctype: [
190
+ [/[^>]+/, "metatag.content.html"],
191
+ [/>/, "metatag.html", "@pop"]
192
+ ],
193
+ comment: [
194
+ [/-->/, "comment.html", "@pop"],
195
+ [/[^-]+/, "comment.content.html"],
196
+ [/./, "comment.content.html"]
197
+ ],
198
+ otherTag: [
199
+ [/\/?>/, "delimiter.html", "@pop"],
200
+ [/"([^"]*)"/, "attribute.value.html"],
201
+ [/'([^']*)'/, "attribute.value.html"],
202
+ [/[\w\-]+/, "attribute.name.html"],
203
+ [/=/, "delimiter.html"],
204
+ [/[ \t\r\n]+/]
205
+ // whitespace
206
+ ],
207
+ // -- BEGIN <script> tags handling
208
+ // After <script
209
+ script: [
210
+ [/type/, "attribute.name.html", "@scriptAfterType"],
211
+ [/"([^"]*)"/, "attribute.value.html"],
212
+ [/'([^']*)'/, "attribute.value.html"],
213
+ [/[\w\-]+/, "attribute.name.html"],
214
+ [/=/, "delimiter.html"],
215
+ [
216
+ />/,
217
+ {
218
+ token: "delimiter.html",
219
+ next: "@scriptEmbedded",
220
+ nextEmbedded: "text/javascript"
221
+ }
222
+ ],
223
+ [/[ \t\r\n]+/],
224
+ // whitespace
225
+ [
226
+ /(<\/)(script\s*)(>)/,
227
+ ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }]
228
+ ]
229
+ ],
230
+ // After <script ... type
231
+ scriptAfterType: [
232
+ [/=/, "delimiter.html", "@scriptAfterTypeEquals"],
233
+ [
234
+ />/,
235
+ {
236
+ token: "delimiter.html",
237
+ next: "@scriptEmbedded",
238
+ nextEmbedded: "text/javascript"
239
+ }
240
+ ],
241
+ // cover invalid e.g. <script type>
242
+ [/[ \t\r\n]+/],
243
+ // whitespace
244
+ [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
245
+ ],
246
+ // After <script ... type =
247
+ scriptAfterTypeEquals: [
248
+ [
249
+ /"([^"]*)"/,
250
+ {
251
+ token: "attribute.value.html",
252
+ switchTo: "@scriptWithCustomType.$1"
253
+ }
254
+ ],
255
+ [
256
+ /'([^']*)'/,
257
+ {
258
+ token: "attribute.value.html",
259
+ switchTo: "@scriptWithCustomType.$1"
260
+ }
261
+ ],
262
+ [
263
+ />/,
264
+ {
265
+ token: "delimiter.html",
266
+ next: "@scriptEmbedded",
267
+ nextEmbedded: "text/javascript"
268
+ }
269
+ ],
270
+ // cover invalid e.g. <script type=>
271
+ [/[ \t\r\n]+/],
272
+ // whitespace
273
+ [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
274
+ ],
275
+ // After <script ... type = $S2
276
+ scriptWithCustomType: [
277
+ [
278
+ />/,
279
+ {
280
+ token: "delimiter.html",
281
+ next: "@scriptEmbedded.$S2",
282
+ nextEmbedded: "$S2"
283
+ }
284
+ ],
285
+ [/"([^"]*)"/, "attribute.value.html"],
286
+ [/'([^']*)'/, "attribute.value.html"],
287
+ [/[\w\-]+/, "attribute.name.html"],
288
+ [/=/, "delimiter.html"],
289
+ [/[ \t\r\n]+/],
290
+ // whitespace
291
+ [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
292
+ ],
293
+ scriptEmbedded: [
294
+ [/<\/script/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
295
+ [/[^<]+/, ""]
296
+ ],
297
+ // -- END <script> tags handling
298
+ // -- BEGIN <style> tags handling
299
+ // After <style
300
+ style: [
301
+ [/type/, "attribute.name.html", "@styleAfterType"],
302
+ [/"([^"]*)"/, "attribute.value.html"],
303
+ [/'([^']*)'/, "attribute.value.html"],
304
+ [/[\w\-]+/, "attribute.name.html"],
305
+ [/=/, "delimiter.html"],
306
+ [
307
+ />/,
308
+ {
309
+ token: "delimiter.html",
310
+ next: "@styleEmbedded",
311
+ nextEmbedded: "text/css"
312
+ }
313
+ ],
314
+ [/[ \t\r\n]+/],
315
+ // whitespace
316
+ [
317
+ /(<\/)(style\s*)(>)/,
318
+ ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }]
319
+ ]
320
+ ],
321
+ // After <style ... type
322
+ styleAfterType: [
323
+ [/=/, "delimiter.html", "@styleAfterTypeEquals"],
324
+ [
325
+ />/,
326
+ {
327
+ token: "delimiter.html",
328
+ next: "@styleEmbedded",
329
+ nextEmbedded: "text/css"
330
+ }
331
+ ],
332
+ // cover invalid e.g. <style type>
333
+ [/[ \t\r\n]+/],
334
+ // whitespace
335
+ [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
336
+ ],
337
+ // After <style ... type =
338
+ styleAfterTypeEquals: [
339
+ [
340
+ /"([^"]*)"/,
341
+ {
342
+ token: "attribute.value.html",
343
+ switchTo: "@styleWithCustomType.$1"
344
+ }
345
+ ],
346
+ [
347
+ /'([^']*)'/,
348
+ {
349
+ token: "attribute.value.html",
350
+ switchTo: "@styleWithCustomType.$1"
351
+ }
352
+ ],
353
+ [
354
+ />/,
355
+ {
356
+ token: "delimiter.html",
357
+ next: "@styleEmbedded",
358
+ nextEmbedded: "text/css"
359
+ }
360
+ ],
361
+ // cover invalid e.g. <style type=>
362
+ [/[ \t\r\n]+/],
363
+ // whitespace
364
+ [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
365
+ ],
366
+ // After <style ... type = $S2
367
+ styleWithCustomType: [
368
+ [
369
+ />/,
370
+ {
371
+ token: "delimiter.html",
372
+ next: "@styleEmbedded.$S2",
373
+ nextEmbedded: "$S2"
374
+ }
375
+ ],
376
+ [/"([^"]*)"/, "attribute.value.html"],
377
+ [/'([^']*)'/, "attribute.value.html"],
378
+ [/[\w\-]+/, "attribute.name.html"],
379
+ [/=/, "delimiter.html"],
380
+ [/[ \t\r\n]+/],
381
+ // whitespace
382
+ [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
383
+ ],
384
+ styleEmbedded: [
385
+ [/<\/style/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
386
+ [/[^<]+/, ""]
387
+ ]
388
+ }
389
+ };
390
+
391
+ export { conf, language };
@@ -0,0 +1,11 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "typescript",
5
+ extensions: [".ts", ".tsx", ".cts", ".mts"],
6
+ aliases: ["TypeScript", "ts", "typescript"],
7
+ mimetypes: ["text/typescript"],
8
+ loader: () => {
9
+ return import('./typescript.js');
10
+ }
11
+ });