@codingame/monaco-vscode-standalone-languages 23.2.1 → 23.3.0
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.
- package/_.contribution.js +48 -0
- package/abap/abap.contribution.js +8 -0
- package/abap/abap.js +1397 -0
- package/apex/apex.contribution.js +9 -0
- package/apex/apex.js +329 -0
- package/azcli/azcli.contribution.js +8 -0
- package/azcli/azcli.js +67 -0
- package/bat/bat.contribution.js +8 -0
- package/bat/bat.js +99 -0
- package/bicep/bicep.contribution.js +8 -0
- package/bicep/bicep.js +108 -0
- package/cameligo/cameligo.contribution.js +8 -0
- package/cameligo/cameligo.js +173 -0
- package/clojure/clojure.contribution.js +8 -0
- package/clojure/clojure.js +760 -0
- package/coffee/coffee.contribution.js +9 -0
- package/coffee/coffee.js +231 -0
- package/cpp/cpp.contribution.js +14 -0
- package/cpp/cpp.js +388 -0
- package/csharp/csharp.contribution.js +8 -0
- package/csharp/csharp.js +325 -0
- package/csp/csp.contribution.js +8 -0
- package/csp/csp.js +52 -0
- package/css/css.contribution.js +9 -0
- package/css/css.js +184 -0
- package/cypher/cypher.contribution.js +8 -0
- package/cypher/cypher.js +262 -0
- package/dart/dart.contribution.js +9 -0
- package/dart/dart.js +280 -0
- package/dockerfile/dockerfile.contribution.js +9 -0
- package/dockerfile/dockerfile.js +129 -0
- package/ecl/ecl.contribution.js +8 -0
- package/ecl/ecl.js +455 -0
- package/elixir/elixir.contribution.js +8 -0
- package/elixir/elixir.js +568 -0
- package/flow9/flow9.contribution.js +8 -0
- package/flow9/flow9.js +141 -0
- package/freemarker2/freemarker2.contribution.js +52 -0
- package/freemarker2/freemarker2.js +990 -0
- package/fsharp/fsharp.contribution.js +8 -0
- package/fsharp/fsharp.js +216 -0
- package/go/go.contribution.js +8 -0
- package/go/go.js +217 -0
- package/graphql/graphql.contribution.js +9 -0
- package/graphql/graphql.js +150 -0
- package/handlebars/handlebars.contribution.js +9 -0
- package/handlebars/handlebars.js +413 -0
- package/hcl/hcl.contribution.js +8 -0
- package/hcl/hcl.js +182 -0
- package/html/html.contribution.js +9 -0
- package/html/html.js +302 -0
- package/index.js +81 -48
- package/ini/ini.contribution.js +9 -0
- package/ini/ini.js +70 -0
- package/java/java.contribution.js +9 -0
- package/java/java.js +231 -0
- package/javascript/javascript.contribution.js +11 -0
- package/javascript/javascript.js +70 -0
- package/julia/julia.contribution.js +8 -0
- package/julia/julia.js +510 -0
- package/kotlin/kotlin.contribution.js +9 -0
- package/kotlin/kotlin.js +251 -0
- package/less/less.contribution.js +9 -0
- package/less/less.js +160 -0
- package/lexon/lexon.contribution.js +8 -0
- package/lexon/lexon.js +156 -0
- package/liquid/liquid.contribution.js +9 -0
- package/liquid/liquid.js +234 -0
- package/lua/lua.contribution.js +8 -0
- package/lua/lua.js +161 -0
- package/m3/m3.contribution.js +8 -0
- package/m3/m3.js +209 -0
- package/markdown/markdown.contribution.js +8 -0
- package/markdown/markdown.js +228 -0
- package/mdx/mdx.contribution.js +8 -0
- package/mdx/mdx.js +158 -0
- package/mips/mips.contribution.js +9 -0
- package/mips/mips.js +197 -0
- package/msdax/msdax.contribution.js +8 -0
- package/msdax/msdax.js +374 -0
- package/mysql/mysql.contribution.js +8 -0
- package/mysql/mysql.js +877 -0
- package/objective-c/objective-c.contribution.js +8 -0
- package/objective-c/objective-c.js +182 -0
- package/package.json +2 -2
- package/pascal/pascal.contribution.js +9 -0
- package/pascal/pascal.js +250 -0
- package/pascaligo/pascaligo.contribution.js +8 -0
- package/pascaligo/pascaligo.js +163 -0
- package/perl/perl.contribution.js +8 -0
- package/perl/perl.js +625 -0
- package/pgsql/pgsql.contribution.js +8 -0
- package/pgsql/pgsql.js +850 -0
- package/php/php.contribution.js +9 -0
- package/php/php.js +499 -0
- package/pla/pla.contribution.js +7 -0
- package/pla/pla.js +136 -0
- package/postiats/postiats.contribution.js +8 -0
- package/postiats/postiats.js +906 -0
- package/powerquery/powerquery.contribution.js +8 -0
- package/powerquery/powerquery.js +889 -0
- package/powershell/powershell.contribution.js +8 -0
- package/powershell/powershell.js +238 -0
- package/protobuf/protobuf.contribution.js +8 -0
- package/protobuf/protobuf.js +419 -0
- package/pug/pug.contribution.js +8 -0
- package/pug/pug.js +401 -0
- package/python/python.contribution.js +9 -0
- package/python/python.js +294 -0
- package/qsharp/qsharp.contribution.js +8 -0
- package/qsharp/qsharp.js +300 -0
- package/r/r.contribution.js +8 -0
- package/r/r.js +242 -0
- package/razor/razor.contribution.js +9 -0
- package/razor/razor.js +544 -0
- package/redis/redis.contribution.js +8 -0
- package/redis/redis.js +301 -0
- package/redshift/redshift.contribution.js +8 -0
- package/redshift/redshift.js +808 -0
- package/restructuredtext/restructuredtext.contribution.js +8 -0
- package/restructuredtext/restructuredtext.js +173 -0
- package/ruby/ruby.contribution.js +9 -0
- package/ruby/ruby.js +510 -0
- package/rust/rust.contribution.js +8 -0
- package/rust/rust.js +342 -0
- package/sb/sb.contribution.js +8 -0
- package/sb/sb.js +114 -0
- package/scala/scala.contribution.js +9 -0
- package/scala/scala.js +369 -0
- package/scheme/scheme.contribution.js +8 -0
- package/scheme/scheme.js +107 -0
- package/scss/scss.contribution.js +9 -0
- package/scss/scss.js +259 -0
- package/shell/shell.contribution.js +8 -0
- package/shell/shell.js +220 -0
- package/solidity/solidity.contribution.js +8 -0
- package/solidity/solidity.js +1366 -0
- package/sophia/sophia.contribution.js +8 -0
- package/sophia/sophia.js +198 -0
- package/sparql/sparql.contribution.js +8 -0
- package/sparql/sparql.js +200 -0
- package/sql/sql.contribution.js +8 -0
- package/sql/sql.js +852 -0
- package/st/st.contribution.js +8 -0
- package/st/st.js +415 -0
- package/swift/swift.contribution.js +9 -0
- package/swift/swift.js +311 -0
- package/systemverilog/systemverilog.contribution.js +14 -0
- package/systemverilog/systemverilog.js +575 -0
- package/tcl/tcl.contribution.js +8 -0
- package/tcl/tcl.js +231 -0
- package/twig/twig.contribution.js +9 -0
- package/twig/twig.js +391 -0
- package/typescript/typescript.contribution.js +11 -0
- package/typescript/typescript.js +336 -0
- package/typespec/typespec.contribution.js +8 -0
- package/typespec/typespec.js +126 -0
- package/vb/vb.contribution.js +8 -0
- package/vb/vb.js +371 -0
- package/wgsl/wgsl.contribution.js +8 -0
- package/wgsl/wgsl.js +452 -0
- package/xml/xml.contribution.js +28 -0
- package/xml/xml.js +88 -0
- package/yaml/yaml.contribution.js +9 -0
- package/yaml/yaml.js +199 -0
package/csharp/csharp.js
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
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: "}" },
|
|
14
|
+
{ open: "[", close: "]" },
|
|
15
|
+
{ open: "(", close: ")" },
|
|
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
|
+
{ open: '"', close: '"' }
|
|
26
|
+
],
|
|
27
|
+
folding: {
|
|
28
|
+
markers: {
|
|
29
|
+
start: new RegExp("^\\s*#region\\b"),
|
|
30
|
+
end: new RegExp("^\\s*#endregion\\b")
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const language = {
|
|
35
|
+
defaultToken: "",
|
|
36
|
+
tokenPostfix: ".cs",
|
|
37
|
+
brackets: [
|
|
38
|
+
{ open: "{", close: "}", token: "delimiter.curly" },
|
|
39
|
+
{ open: "[", close: "]", token: "delimiter.square" },
|
|
40
|
+
{ open: "(", close: ")", token: "delimiter.parenthesis" },
|
|
41
|
+
{ open: "<", close: ">", token: "delimiter.angle" }
|
|
42
|
+
],
|
|
43
|
+
keywords: [
|
|
44
|
+
"extern",
|
|
45
|
+
"alias",
|
|
46
|
+
"using",
|
|
47
|
+
"bool",
|
|
48
|
+
"decimal",
|
|
49
|
+
"sbyte",
|
|
50
|
+
"byte",
|
|
51
|
+
"short",
|
|
52
|
+
"ushort",
|
|
53
|
+
"int",
|
|
54
|
+
"uint",
|
|
55
|
+
"long",
|
|
56
|
+
"ulong",
|
|
57
|
+
"char",
|
|
58
|
+
"float",
|
|
59
|
+
"double",
|
|
60
|
+
"object",
|
|
61
|
+
"dynamic",
|
|
62
|
+
"string",
|
|
63
|
+
"assembly",
|
|
64
|
+
"is",
|
|
65
|
+
"as",
|
|
66
|
+
"ref",
|
|
67
|
+
"out",
|
|
68
|
+
"this",
|
|
69
|
+
"base",
|
|
70
|
+
"new",
|
|
71
|
+
"typeof",
|
|
72
|
+
"void",
|
|
73
|
+
"checked",
|
|
74
|
+
"unchecked",
|
|
75
|
+
"default",
|
|
76
|
+
"delegate",
|
|
77
|
+
"var",
|
|
78
|
+
"const",
|
|
79
|
+
"if",
|
|
80
|
+
"else",
|
|
81
|
+
"switch",
|
|
82
|
+
"case",
|
|
83
|
+
"while",
|
|
84
|
+
"do",
|
|
85
|
+
"for",
|
|
86
|
+
"foreach",
|
|
87
|
+
"in",
|
|
88
|
+
"break",
|
|
89
|
+
"continue",
|
|
90
|
+
"goto",
|
|
91
|
+
"return",
|
|
92
|
+
"throw",
|
|
93
|
+
"try",
|
|
94
|
+
"catch",
|
|
95
|
+
"finally",
|
|
96
|
+
"lock",
|
|
97
|
+
"yield",
|
|
98
|
+
"from",
|
|
99
|
+
"let",
|
|
100
|
+
"where",
|
|
101
|
+
"join",
|
|
102
|
+
"on",
|
|
103
|
+
"equals",
|
|
104
|
+
"into",
|
|
105
|
+
"orderby",
|
|
106
|
+
"ascending",
|
|
107
|
+
"descending",
|
|
108
|
+
"select",
|
|
109
|
+
"group",
|
|
110
|
+
"by",
|
|
111
|
+
"namespace",
|
|
112
|
+
"partial",
|
|
113
|
+
"class",
|
|
114
|
+
"field",
|
|
115
|
+
"event",
|
|
116
|
+
"method",
|
|
117
|
+
"param",
|
|
118
|
+
"public",
|
|
119
|
+
"protected",
|
|
120
|
+
"internal",
|
|
121
|
+
"private",
|
|
122
|
+
"abstract",
|
|
123
|
+
"sealed",
|
|
124
|
+
"static",
|
|
125
|
+
"struct",
|
|
126
|
+
"readonly",
|
|
127
|
+
"volatile",
|
|
128
|
+
"virtual",
|
|
129
|
+
"override",
|
|
130
|
+
"params",
|
|
131
|
+
"get",
|
|
132
|
+
"set",
|
|
133
|
+
"add",
|
|
134
|
+
"remove",
|
|
135
|
+
"operator",
|
|
136
|
+
"true",
|
|
137
|
+
"false",
|
|
138
|
+
"implicit",
|
|
139
|
+
"explicit",
|
|
140
|
+
"interface",
|
|
141
|
+
"enum",
|
|
142
|
+
"null",
|
|
143
|
+
"async",
|
|
144
|
+
"await",
|
|
145
|
+
"fixed",
|
|
146
|
+
"sizeof",
|
|
147
|
+
"stackalloc",
|
|
148
|
+
"unsafe",
|
|
149
|
+
"nameof",
|
|
150
|
+
"when"
|
|
151
|
+
],
|
|
152
|
+
namespaceFollows: ["namespace", "using"],
|
|
153
|
+
parenFollows: ["if", "for", "while", "switch", "foreach", "using", "catch", "when"],
|
|
154
|
+
operators: [
|
|
155
|
+
"=",
|
|
156
|
+
"??",
|
|
157
|
+
"||",
|
|
158
|
+
"&&",
|
|
159
|
+
"|",
|
|
160
|
+
"^",
|
|
161
|
+
"&",
|
|
162
|
+
"==",
|
|
163
|
+
"!=",
|
|
164
|
+
"<=",
|
|
165
|
+
">=",
|
|
166
|
+
"<<",
|
|
167
|
+
"+",
|
|
168
|
+
"-",
|
|
169
|
+
"*",
|
|
170
|
+
"/",
|
|
171
|
+
"%",
|
|
172
|
+
"!",
|
|
173
|
+
"~",
|
|
174
|
+
"++",
|
|
175
|
+
"--",
|
|
176
|
+
"+=",
|
|
177
|
+
"-=",
|
|
178
|
+
"*=",
|
|
179
|
+
"/=",
|
|
180
|
+
"%=",
|
|
181
|
+
"&=",
|
|
182
|
+
"|=",
|
|
183
|
+
"^=",
|
|
184
|
+
"<<=",
|
|
185
|
+
">>=",
|
|
186
|
+
">>",
|
|
187
|
+
"=>"
|
|
188
|
+
],
|
|
189
|
+
symbols: /[=><!~?:&|+\-*\/\^%]+/,
|
|
190
|
+
// escape sequences
|
|
191
|
+
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
|
|
192
|
+
// The main tokenizer for our languages
|
|
193
|
+
tokenizer: {
|
|
194
|
+
root: [
|
|
195
|
+
// identifiers and keywords
|
|
196
|
+
[
|
|
197
|
+
/\@?[a-zA-Z_]\w*/,
|
|
198
|
+
{
|
|
199
|
+
cases: {
|
|
200
|
+
"@namespaceFollows": {
|
|
201
|
+
token: "keyword.$0",
|
|
202
|
+
next: "@namespace"
|
|
203
|
+
},
|
|
204
|
+
"@keywords": {
|
|
205
|
+
token: "keyword.$0",
|
|
206
|
+
next: "@qualified"
|
|
207
|
+
},
|
|
208
|
+
"@default": { token: "identifier", next: "@qualified" }
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
],
|
|
212
|
+
// whitespace
|
|
213
|
+
{ include: "@whitespace" },
|
|
214
|
+
// delimiters and operators
|
|
215
|
+
[
|
|
216
|
+
/}/,
|
|
217
|
+
{
|
|
218
|
+
cases: {
|
|
219
|
+
"$S2==interpolatedstring": {
|
|
220
|
+
token: "string.quote",
|
|
221
|
+
next: "@pop"
|
|
222
|
+
},
|
|
223
|
+
"$S2==litinterpstring": {
|
|
224
|
+
token: "string.quote",
|
|
225
|
+
next: "@pop"
|
|
226
|
+
},
|
|
227
|
+
"@default": "@brackets"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
],
|
|
231
|
+
[/[{}()\[\]]/, "@brackets"],
|
|
232
|
+
[/[<>](?!@symbols)/, "@brackets"],
|
|
233
|
+
[
|
|
234
|
+
/@symbols/,
|
|
235
|
+
{
|
|
236
|
+
cases: {
|
|
237
|
+
"@operators": "delimiter",
|
|
238
|
+
"@default": ""
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
// numbers
|
|
243
|
+
[/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?[fFdD]?/, "number.float"],
|
|
244
|
+
[/0[xX][0-9a-fA-F_]+/, "number.hex"],
|
|
245
|
+
[/0[bB][01_]+/, "number.hex"],
|
|
246
|
+
// binary: use same theme style as hex
|
|
247
|
+
[/[0-9_]+/, "number"],
|
|
248
|
+
// delimiter: after number because of .\d floats
|
|
249
|
+
[/[;,.]/, "delimiter"],
|
|
250
|
+
// strings
|
|
251
|
+
[/"([^"\\]|\\.)*$/, "string.invalid"],
|
|
252
|
+
// non-teminated string
|
|
253
|
+
[/"/, { token: "string.quote", next: "@string" }],
|
|
254
|
+
[/\$\@"/, { token: "string.quote", next: "@litinterpstring" }],
|
|
255
|
+
[/\@"/, { token: "string.quote", next: "@litstring" }],
|
|
256
|
+
[/\$"/, { token: "string.quote", next: "@interpolatedstring" }],
|
|
257
|
+
// characters
|
|
258
|
+
[/'[^\\']'/, "string"],
|
|
259
|
+
[/(')(@escapes)(')/, ["string", "string.escape", "string"]],
|
|
260
|
+
[/'/, "string.invalid"]
|
|
261
|
+
],
|
|
262
|
+
qualified: [
|
|
263
|
+
[
|
|
264
|
+
/[a-zA-Z_][\w]*/,
|
|
265
|
+
{
|
|
266
|
+
cases: {
|
|
267
|
+
"@keywords": { token: "keyword.$0" },
|
|
268
|
+
"@default": "identifier"
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
],
|
|
272
|
+
[/\./, "delimiter"],
|
|
273
|
+
["", "", "@pop"]
|
|
274
|
+
],
|
|
275
|
+
namespace: [
|
|
276
|
+
{ include: "@whitespace" },
|
|
277
|
+
[/[A-Z]\w*/, "namespace"],
|
|
278
|
+
[/[\.=]/, "delimiter"],
|
|
279
|
+
["", "", "@pop"]
|
|
280
|
+
],
|
|
281
|
+
comment: [
|
|
282
|
+
[/[^\/*]+/, "comment"],
|
|
283
|
+
// [/\/\*/, 'comment', '@push' ], // no nested comments :-(
|
|
284
|
+
["\\*/", "comment", "@pop"],
|
|
285
|
+
[/[\/*]/, "comment"]
|
|
286
|
+
],
|
|
287
|
+
string: [
|
|
288
|
+
[/[^\\"]+/, "string"],
|
|
289
|
+
[/@escapes/, "string.escape"],
|
|
290
|
+
[/\\./, "string.escape.invalid"],
|
|
291
|
+
[/"/, { token: "string.quote", next: "@pop" }]
|
|
292
|
+
],
|
|
293
|
+
litstring: [
|
|
294
|
+
[/[^"]+/, "string"],
|
|
295
|
+
[/""/, "string.escape"],
|
|
296
|
+
[/"/, { token: "string.quote", next: "@pop" }]
|
|
297
|
+
],
|
|
298
|
+
litinterpstring: [
|
|
299
|
+
[/[^"{]+/, "string"],
|
|
300
|
+
[/""/, "string.escape"],
|
|
301
|
+
[/{{/, "string.escape"],
|
|
302
|
+
[/}}/, "string.escape"],
|
|
303
|
+
[/{/, { token: "string.quote", next: "root.litinterpstring" }],
|
|
304
|
+
[/"/, { token: "string.quote", next: "@pop" }]
|
|
305
|
+
],
|
|
306
|
+
interpolatedstring: [
|
|
307
|
+
[/[^\\"{]+/, "string"],
|
|
308
|
+
[/@escapes/, "string.escape"],
|
|
309
|
+
[/\\./, "string.escape.invalid"],
|
|
310
|
+
[/{{/, "string.escape"],
|
|
311
|
+
[/}}/, "string.escape"],
|
|
312
|
+
[/{/, { token: "string.quote", next: "root.interpolatedstring" }],
|
|
313
|
+
[/"/, { token: "string.quote", next: "@pop" }]
|
|
314
|
+
],
|
|
315
|
+
whitespace: [
|
|
316
|
+
[/^[ \t\v\f]*#((r)|(load))(?=\s)/, "directive.csx"],
|
|
317
|
+
[/^[ \t\v\f]*#\w.*$/, "namespace.cpp"],
|
|
318
|
+
[/[ \t\v\f\r\n]+/, ""],
|
|
319
|
+
[/\/\*/, "comment", "@comment"],
|
|
320
|
+
[/\/\/.*$/, "comment"]
|
|
321
|
+
]
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
export { conf, language };
|
package/csp/csp.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const conf = {
|
|
2
|
+
brackets: [],
|
|
3
|
+
autoClosingPairs: [],
|
|
4
|
+
surroundingPairs: []
|
|
5
|
+
};
|
|
6
|
+
const language = {
|
|
7
|
+
// Set defaultToken to invalid to see what you do not tokenize yet
|
|
8
|
+
// defaultToken: 'invalid',
|
|
9
|
+
keywords: [],
|
|
10
|
+
typeKeywords: [],
|
|
11
|
+
tokenPostfix: ".csp",
|
|
12
|
+
operators: [],
|
|
13
|
+
symbols: /[=><!~?:&|+\-*\/\^%]+/,
|
|
14
|
+
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
|
|
15
|
+
tokenizer: {
|
|
16
|
+
root: [
|
|
17
|
+
[/child-src/, "string.quote"],
|
|
18
|
+
[/connect-src/, "string.quote"],
|
|
19
|
+
[/default-src/, "string.quote"],
|
|
20
|
+
[/font-src/, "string.quote"],
|
|
21
|
+
[/frame-src/, "string.quote"],
|
|
22
|
+
[/img-src/, "string.quote"],
|
|
23
|
+
[/manifest-src/, "string.quote"],
|
|
24
|
+
[/media-src/, "string.quote"],
|
|
25
|
+
[/object-src/, "string.quote"],
|
|
26
|
+
[/script-src/, "string.quote"],
|
|
27
|
+
[/style-src/, "string.quote"],
|
|
28
|
+
[/worker-src/, "string.quote"],
|
|
29
|
+
[/base-uri/, "string.quote"],
|
|
30
|
+
[/plugin-types/, "string.quote"],
|
|
31
|
+
[/sandbox/, "string.quote"],
|
|
32
|
+
[/disown-opener/, "string.quote"],
|
|
33
|
+
[/form-action/, "string.quote"],
|
|
34
|
+
[/frame-ancestors/, "string.quote"],
|
|
35
|
+
[/report-uri/, "string.quote"],
|
|
36
|
+
[/report-to/, "string.quote"],
|
|
37
|
+
[/upgrade-insecure-requests/, "string.quote"],
|
|
38
|
+
[/block-all-mixed-content/, "string.quote"],
|
|
39
|
+
[/require-sri-for/, "string.quote"],
|
|
40
|
+
[/reflected-xss/, "string.quote"],
|
|
41
|
+
[/referrer/, "string.quote"],
|
|
42
|
+
[/policy-uri/, "string.quote"],
|
|
43
|
+
[/'self'/, "string.quote"],
|
|
44
|
+
[/'unsafe-inline'/, "string.quote"],
|
|
45
|
+
[/'unsafe-eval'/, "string.quote"],
|
|
46
|
+
[/'strict-dynamic'/, "string.quote"],
|
|
47
|
+
[/'unsafe-hashed-attributes'/, "string.quote"]
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export { conf, language };
|
package/css/css.js
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
const conf = {
|
|
2
|
+
wordPattern: /(#?-?\d*\.\d\w*%?)|((::|[@#.!:])?[\w-?]+%?)|::|[@#.!:]/g,
|
|
3
|
+
comments: {
|
|
4
|
+
blockComment: ["/*", "*/"]
|
|
5
|
+
},
|
|
6
|
+
brackets: [
|
|
7
|
+
["{", "}"],
|
|
8
|
+
["[", "]"],
|
|
9
|
+
["(", ")"]
|
|
10
|
+
],
|
|
11
|
+
autoClosingPairs: [
|
|
12
|
+
{ open: "{", close: "}", notIn: ["string", "comment"] },
|
|
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
|
+
],
|
|
18
|
+
surroundingPairs: [
|
|
19
|
+
{ open: "{", close: "}" },
|
|
20
|
+
{ open: "[", close: "]" },
|
|
21
|
+
{ open: "(", close: ")" },
|
|
22
|
+
{ open: '"', close: '"' },
|
|
23
|
+
{ open: "'", close: "'" }
|
|
24
|
+
],
|
|
25
|
+
folding: {
|
|
26
|
+
markers: {
|
|
27
|
+
start: new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),
|
|
28
|
+
end: new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const language = {
|
|
33
|
+
defaultToken: "",
|
|
34
|
+
tokenPostfix: ".css",
|
|
35
|
+
ws: "[ \n\r\f]*",
|
|
36
|
+
// whitespaces (referenced in several rules)
|
|
37
|
+
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])))*",
|
|
38
|
+
brackets: [
|
|
39
|
+
{ open: "{", close: "}", token: "delimiter.bracket" },
|
|
40
|
+
{ open: "[", close: "]", token: "delimiter.bracket" },
|
|
41
|
+
{ open: "(", close: ")", token: "delimiter.parenthesis" },
|
|
42
|
+
{ open: "<", close: ">", token: "delimiter.angle" }
|
|
43
|
+
],
|
|
44
|
+
tokenizer: {
|
|
45
|
+
root: [{ include: "@selector" }],
|
|
46
|
+
selector: [
|
|
47
|
+
{ include: "@comments" },
|
|
48
|
+
{ include: "@import" },
|
|
49
|
+
{ include: "@strings" },
|
|
50
|
+
[
|
|
51
|
+
"[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",
|
|
52
|
+
{ token: "keyword", next: "@keyframedeclaration" }
|
|
53
|
+
],
|
|
54
|
+
["[@](page|content|font-face|-moz-document)", { token: "keyword" }],
|
|
55
|
+
["[@](charset|namespace)", { token: "keyword", next: "@declarationbody" }],
|
|
56
|
+
[
|
|
57
|
+
"(url-prefix)(\\()",
|
|
58
|
+
["attribute.value", { token: "delimiter.parenthesis", next: "@urldeclaration" }]
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
"(url)(\\()",
|
|
62
|
+
["attribute.value", { token: "delimiter.parenthesis", next: "@urldeclaration" }]
|
|
63
|
+
],
|
|
64
|
+
{ include: "@selectorname" },
|
|
65
|
+
["[\\*]", "tag"],
|
|
66
|
+
// selector symbols
|
|
67
|
+
["[>\\+,]", "delimiter"],
|
|
68
|
+
// selector operators
|
|
69
|
+
["\\[", { token: "delimiter.bracket", next: "@selectorattribute" }],
|
|
70
|
+
["{", { token: "delimiter.bracket", next: "@selectorbody" }]
|
|
71
|
+
],
|
|
72
|
+
selectorbody: [
|
|
73
|
+
{ include: "@comments" },
|
|
74
|
+
["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))", "attribute.name", "@rulevalue"],
|
|
75
|
+
// rule definition: to distinguish from a nested selector check for whitespace, number or a semicolon
|
|
76
|
+
["}", { token: "delimiter.bracket", next: "@pop" }]
|
|
77
|
+
],
|
|
78
|
+
selectorname: [
|
|
79
|
+
["(\\.|#(?=[^{])|%|(@identifier)|:)+", "tag"]
|
|
80
|
+
// selector (.foo, div, ...)
|
|
81
|
+
],
|
|
82
|
+
selectorattribute: [{ include: "@term" }, ["]", { token: "delimiter.bracket", next: "@pop" }]],
|
|
83
|
+
term: [
|
|
84
|
+
{ include: "@comments" },
|
|
85
|
+
[
|
|
86
|
+
"(url-prefix)(\\()",
|
|
87
|
+
["attribute.value", { token: "delimiter.parenthesis", next: "@urldeclaration" }]
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"(url)(\\()",
|
|
91
|
+
["attribute.value", { token: "delimiter.parenthesis", next: "@urldeclaration" }]
|
|
92
|
+
],
|
|
93
|
+
{ include: "@functioninvocation" },
|
|
94
|
+
{ include: "@numbers" },
|
|
95
|
+
{ include: "@name" },
|
|
96
|
+
{ include: "@strings" },
|
|
97
|
+
["([<>=\\+\\-\\*\\/\\^\\|\\~,])", "delimiter"],
|
|
98
|
+
[",", "delimiter"]
|
|
99
|
+
],
|
|
100
|
+
rulevalue: [
|
|
101
|
+
{ include: "@comments" },
|
|
102
|
+
{ include: "@strings" },
|
|
103
|
+
{ include: "@term" },
|
|
104
|
+
["!important", "keyword"],
|
|
105
|
+
[";", "delimiter", "@pop"],
|
|
106
|
+
["(?=})", { token: "", next: "@pop" }]
|
|
107
|
+
// missing semicolon
|
|
108
|
+
],
|
|
109
|
+
warndebug: [["[@](warn|debug)", { token: "keyword", next: "@declarationbody" }]],
|
|
110
|
+
import: [["[@](import)", { token: "keyword", next: "@declarationbody" }]],
|
|
111
|
+
urldeclaration: [
|
|
112
|
+
{ include: "@strings" },
|
|
113
|
+
["[^)\r\n]+", "string"],
|
|
114
|
+
["\\)", { token: "delimiter.parenthesis", next: "@pop" }]
|
|
115
|
+
],
|
|
116
|
+
parenthizedterm: [
|
|
117
|
+
{ include: "@term" },
|
|
118
|
+
["\\)", { token: "delimiter.parenthesis", next: "@pop" }]
|
|
119
|
+
],
|
|
120
|
+
declarationbody: [
|
|
121
|
+
{ include: "@term" },
|
|
122
|
+
[";", "delimiter", "@pop"],
|
|
123
|
+
["(?=})", { token: "", next: "@pop" }]
|
|
124
|
+
// missing semicolon
|
|
125
|
+
],
|
|
126
|
+
comments: [
|
|
127
|
+
["\\/\\*", "comment", "@comment"],
|
|
128
|
+
["\\/\\/+.*", "comment"]
|
|
129
|
+
],
|
|
130
|
+
comment: [
|
|
131
|
+
["\\*\\/", "comment", "@pop"],
|
|
132
|
+
[/[^*/]+/, "comment"],
|
|
133
|
+
[/./, "comment"]
|
|
134
|
+
],
|
|
135
|
+
name: [["@identifier", "attribute.value"]],
|
|
136
|
+
numbers: [
|
|
137
|
+
["-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?", { token: "attribute.value.number", next: "@units" }],
|
|
138
|
+
["#[0-9a-fA-F_]+(?!\\w)", "attribute.value.hex"]
|
|
139
|
+
],
|
|
140
|
+
units: [
|
|
141
|
+
[
|
|
142
|
+
"(em|ex|ch|rem|fr|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?",
|
|
143
|
+
"attribute.value.unit",
|
|
144
|
+
"@pop"
|
|
145
|
+
]
|
|
146
|
+
],
|
|
147
|
+
keyframedeclaration: [
|
|
148
|
+
["@identifier", "attribute.value"],
|
|
149
|
+
["{", { token: "delimiter.bracket", switchTo: "@keyframebody" }]
|
|
150
|
+
],
|
|
151
|
+
keyframebody: [
|
|
152
|
+
{ include: "@term" },
|
|
153
|
+
["{", { token: "delimiter.bracket", next: "@selectorbody" }],
|
|
154
|
+
["}", { token: "delimiter.bracket", next: "@pop" }]
|
|
155
|
+
],
|
|
156
|
+
functioninvocation: [
|
|
157
|
+
["@identifier\\(", { token: "attribute.value", next: "@functionarguments" }]
|
|
158
|
+
],
|
|
159
|
+
functionarguments: [
|
|
160
|
+
["\\$@identifier@ws:", "attribute.name"],
|
|
161
|
+
["[,]", "delimiter"],
|
|
162
|
+
{ include: "@term" },
|
|
163
|
+
["\\)", { token: "attribute.value", next: "@pop" }]
|
|
164
|
+
],
|
|
165
|
+
strings: [
|
|
166
|
+
['~?"', { token: "string", next: "@stringenddoublequote" }],
|
|
167
|
+
["~?'", { token: "string", next: "@stringendquote" }]
|
|
168
|
+
],
|
|
169
|
+
stringenddoublequote: [
|
|
170
|
+
["\\\\.", "string"],
|
|
171
|
+
['"', { token: "string", next: "@pop" }],
|
|
172
|
+
[/[^\\"]+/, "string"],
|
|
173
|
+
[".", "string"]
|
|
174
|
+
],
|
|
175
|
+
stringendquote: [
|
|
176
|
+
["\\\\.", "string"],
|
|
177
|
+
["'", { token: "string", next: "@pop" }],
|
|
178
|
+
[/[^\\']+/, "string"],
|
|
179
|
+
[".", "string"]
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export { conf, language };
|