@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.
- 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/scss/scss.js
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
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: ".scss",
|
|
36
|
+
ws: "[ \n\r\f]*",
|
|
37
|
+
// whitespaces (referenced in several rules)
|
|
38
|
+
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])))*",
|
|
39
|
+
brackets: [
|
|
40
|
+
{ open: "{", close: "}", token: "delimiter.curly" },
|
|
41
|
+
{ open: "[", close: "]", token: "delimiter.bracket" },
|
|
42
|
+
{ open: "(", close: ")", token: "delimiter.parenthesis" },
|
|
43
|
+
{ open: "<", close: ">", token: "delimiter.angle" }
|
|
44
|
+
],
|
|
45
|
+
tokenizer: {
|
|
46
|
+
root: [{ include: "@selector" }],
|
|
47
|
+
selector: [
|
|
48
|
+
{ include: "@comments" },
|
|
49
|
+
{ include: "@import" },
|
|
50
|
+
{ include: "@variabledeclaration" },
|
|
51
|
+
{ include: "@warndebug" },
|
|
52
|
+
// sass: log statements
|
|
53
|
+
["[@](include)", { token: "keyword", next: "@includedeclaration" }],
|
|
54
|
+
// sass: include statement
|
|
55
|
+
[
|
|
56
|
+
"[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",
|
|
57
|
+
{ token: "keyword", next: "@keyframedeclaration" }
|
|
58
|
+
],
|
|
59
|
+
["[@](page|content|font-face|-moz-document)", { token: "keyword" }],
|
|
60
|
+
// sass: placeholder for includes
|
|
61
|
+
["[@](charset|namespace)", { token: "keyword", next: "@declarationbody" }],
|
|
62
|
+
["[@](function)", { token: "keyword", next: "@functiondeclaration" }],
|
|
63
|
+
["[@](mixin)", { token: "keyword", next: "@mixindeclaration" }],
|
|
64
|
+
["url(\\-prefix)?\\(", { token: "meta", next: "@urldeclaration" }],
|
|
65
|
+
{ include: "@controlstatement" },
|
|
66
|
+
// sass control statements
|
|
67
|
+
{ include: "@selectorname" },
|
|
68
|
+
["[&\\*]", "tag"],
|
|
69
|
+
// selector symbols
|
|
70
|
+
["[>\\+,]", "delimiter"],
|
|
71
|
+
// selector operators
|
|
72
|
+
["\\[", { token: "delimiter.bracket", next: "@selectorattribute" }],
|
|
73
|
+
["{", { token: "delimiter.curly", next: "@selectorbody" }]
|
|
74
|
+
],
|
|
75
|
+
selectorbody: [
|
|
76
|
+
["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))", "attribute.name", "@rulevalue"],
|
|
77
|
+
// rule definition: to distinguish from a nested selector check for whitespace, number or a semicolon
|
|
78
|
+
{ include: "@selector" },
|
|
79
|
+
// sass: nested selectors
|
|
80
|
+
["[@](extend)", { token: "keyword", next: "@extendbody" }],
|
|
81
|
+
// sass: extend other selectors
|
|
82
|
+
["[@](return)", { token: "keyword", next: "@declarationbody" }],
|
|
83
|
+
["}", { token: "delimiter.curly", next: "@pop" }]
|
|
84
|
+
],
|
|
85
|
+
selectorname: [
|
|
86
|
+
["#{", { token: "meta", next: "@variableinterpolation" }],
|
|
87
|
+
// sass: interpolation
|
|
88
|
+
["(\\.|#(?=[^{])|%|(@identifier)|:)+", "tag"]
|
|
89
|
+
// selector (.foo, div, ...)
|
|
90
|
+
],
|
|
91
|
+
selectorattribute: [{ include: "@term" }, ["]", { token: "delimiter.bracket", next: "@pop" }]],
|
|
92
|
+
term: [
|
|
93
|
+
{ include: "@comments" },
|
|
94
|
+
["url(\\-prefix)?\\(", { token: "meta", next: "@urldeclaration" }],
|
|
95
|
+
{ include: "@functioninvocation" },
|
|
96
|
+
{ include: "@numbers" },
|
|
97
|
+
{ include: "@strings" },
|
|
98
|
+
{ include: "@variablereference" },
|
|
99
|
+
["(and\\b|or\\b|not\\b)", "operator"],
|
|
100
|
+
{ include: "@name" },
|
|
101
|
+
["([<>=\\+\\-\\*\\/\\^\\|\\~,])", "operator"],
|
|
102
|
+
[",", "delimiter"],
|
|
103
|
+
["!default", "literal"],
|
|
104
|
+
["\\(", { token: "delimiter.parenthesis", next: "@parenthizedterm" }]
|
|
105
|
+
],
|
|
106
|
+
rulevalue: [
|
|
107
|
+
{ include: "@term" },
|
|
108
|
+
["!important", "literal"],
|
|
109
|
+
[";", "delimiter", "@pop"],
|
|
110
|
+
["{", { token: "delimiter.curly", switchTo: "@nestedproperty" }],
|
|
111
|
+
// sass: nested properties
|
|
112
|
+
["(?=})", { token: "", next: "@pop" }]
|
|
113
|
+
// missing semicolon
|
|
114
|
+
],
|
|
115
|
+
nestedproperty: [
|
|
116
|
+
["[*_]?@identifier@ws:", "attribute.name", "@rulevalue"],
|
|
117
|
+
{ include: "@comments" },
|
|
118
|
+
["}", { token: "delimiter.curly", next: "@pop" }]
|
|
119
|
+
],
|
|
120
|
+
warndebug: [["[@](warn|debug)", { token: "keyword", next: "@declarationbody" }]],
|
|
121
|
+
import: [["[@](import)", { token: "keyword", next: "@declarationbody" }]],
|
|
122
|
+
variabledeclaration: [
|
|
123
|
+
// sass variables
|
|
124
|
+
["\\$@identifier@ws:", "variable.decl", "@declarationbody"]
|
|
125
|
+
],
|
|
126
|
+
urldeclaration: [
|
|
127
|
+
{ include: "@strings" },
|
|
128
|
+
["[^)\r\n]+", "string"],
|
|
129
|
+
["\\)", { token: "meta", next: "@pop" }]
|
|
130
|
+
],
|
|
131
|
+
parenthizedterm: [
|
|
132
|
+
{ include: "@term" },
|
|
133
|
+
["\\)", { token: "delimiter.parenthesis", next: "@pop" }]
|
|
134
|
+
],
|
|
135
|
+
declarationbody: [
|
|
136
|
+
{ include: "@term" },
|
|
137
|
+
[";", "delimiter", "@pop"],
|
|
138
|
+
["(?=})", { token: "", next: "@pop" }]
|
|
139
|
+
// missing semicolon
|
|
140
|
+
],
|
|
141
|
+
extendbody: [
|
|
142
|
+
{ include: "@selectorname" },
|
|
143
|
+
["!optional", "literal"],
|
|
144
|
+
[";", "delimiter", "@pop"],
|
|
145
|
+
["(?=})", { token: "", next: "@pop" }]
|
|
146
|
+
// missing semicolon
|
|
147
|
+
],
|
|
148
|
+
variablereference: [
|
|
149
|
+
// sass variable reference
|
|
150
|
+
["\\$@identifier", "variable.ref"],
|
|
151
|
+
["\\.\\.\\.", "operator"],
|
|
152
|
+
// var args in reference
|
|
153
|
+
["#{", { token: "meta", next: "@variableinterpolation" }]
|
|
154
|
+
// sass var resolve
|
|
155
|
+
],
|
|
156
|
+
variableinterpolation: [
|
|
157
|
+
{ include: "@variablereference" },
|
|
158
|
+
["}", { token: "meta", next: "@pop" }]
|
|
159
|
+
],
|
|
160
|
+
comments: [
|
|
161
|
+
["\\/\\*", "comment", "@comment"],
|
|
162
|
+
["\\/\\/+.*", "comment"]
|
|
163
|
+
],
|
|
164
|
+
comment: [
|
|
165
|
+
["\\*\\/", "comment", "@pop"],
|
|
166
|
+
[".", "comment"]
|
|
167
|
+
],
|
|
168
|
+
name: [["@identifier", "attribute.value"]],
|
|
169
|
+
numbers: [
|
|
170
|
+
["(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?", { token: "number", next: "@units" }],
|
|
171
|
+
["#[0-9a-fA-F_]+(?!\\w)", "number.hex"]
|
|
172
|
+
],
|
|
173
|
+
units: [
|
|
174
|
+
[
|
|
175
|
+
"(em|ex|ch|rem|fr|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?",
|
|
176
|
+
"number",
|
|
177
|
+
"@pop"
|
|
178
|
+
]
|
|
179
|
+
],
|
|
180
|
+
functiondeclaration: [
|
|
181
|
+
["@identifier@ws\\(", { token: "meta", next: "@parameterdeclaration" }],
|
|
182
|
+
["{", { token: "delimiter.curly", switchTo: "@functionbody" }]
|
|
183
|
+
],
|
|
184
|
+
mixindeclaration: [
|
|
185
|
+
// mixin with parameters
|
|
186
|
+
["@identifier@ws\\(", { token: "meta", next: "@parameterdeclaration" }],
|
|
187
|
+
// mixin without parameters
|
|
188
|
+
["@identifier", "meta"],
|
|
189
|
+
["{", { token: "delimiter.curly", switchTo: "@selectorbody" }]
|
|
190
|
+
],
|
|
191
|
+
parameterdeclaration: [
|
|
192
|
+
["\\$@identifier@ws:", "variable.decl"],
|
|
193
|
+
["\\.\\.\\.", "operator"],
|
|
194
|
+
// var args in declaration
|
|
195
|
+
[",", "delimiter"],
|
|
196
|
+
{ include: "@term" },
|
|
197
|
+
["\\)", { token: "meta", next: "@pop" }]
|
|
198
|
+
],
|
|
199
|
+
includedeclaration: [
|
|
200
|
+
{ include: "@functioninvocation" },
|
|
201
|
+
["@identifier", "meta"],
|
|
202
|
+
[";", "delimiter", "@pop"],
|
|
203
|
+
["(?=})", { token: "", next: "@pop" }],
|
|
204
|
+
// missing semicolon
|
|
205
|
+
["{", { token: "delimiter.curly", switchTo: "@selectorbody" }]
|
|
206
|
+
],
|
|
207
|
+
keyframedeclaration: [
|
|
208
|
+
["@identifier", "meta"],
|
|
209
|
+
["{", { token: "delimiter.curly", switchTo: "@keyframebody" }]
|
|
210
|
+
],
|
|
211
|
+
keyframebody: [
|
|
212
|
+
{ include: "@term" },
|
|
213
|
+
["{", { token: "delimiter.curly", next: "@selectorbody" }],
|
|
214
|
+
["}", { token: "delimiter.curly", next: "@pop" }]
|
|
215
|
+
],
|
|
216
|
+
controlstatement: [
|
|
217
|
+
[
|
|
218
|
+
"[@](if|else|for|while|each|media)",
|
|
219
|
+
{ token: "keyword.flow", next: "@controlstatementdeclaration" }
|
|
220
|
+
]
|
|
221
|
+
],
|
|
222
|
+
controlstatementdeclaration: [
|
|
223
|
+
["(in|from|through|if|to)\\b", { token: "keyword.flow" }],
|
|
224
|
+
{ include: "@term" },
|
|
225
|
+
["{", { token: "delimiter.curly", switchTo: "@selectorbody" }]
|
|
226
|
+
],
|
|
227
|
+
functionbody: [
|
|
228
|
+
["[@](return)", { token: "keyword" }],
|
|
229
|
+
{ include: "@variabledeclaration" },
|
|
230
|
+
{ include: "@term" },
|
|
231
|
+
{ include: "@controlstatement" },
|
|
232
|
+
[";", "delimiter"],
|
|
233
|
+
["}", { token: "delimiter.curly", next: "@pop" }]
|
|
234
|
+
],
|
|
235
|
+
functioninvocation: [["@identifier\\(", { token: "meta", next: "@functionarguments" }]],
|
|
236
|
+
functionarguments: [
|
|
237
|
+
["\\$@identifier@ws:", "attribute.name"],
|
|
238
|
+
["[,]", "delimiter"],
|
|
239
|
+
{ include: "@term" },
|
|
240
|
+
["\\)", { token: "meta", next: "@pop" }]
|
|
241
|
+
],
|
|
242
|
+
strings: [
|
|
243
|
+
['~?"', { token: "string.delimiter", next: "@stringenddoublequote" }],
|
|
244
|
+
["~?'", { token: "string.delimiter", next: "@stringendquote" }]
|
|
245
|
+
],
|
|
246
|
+
stringenddoublequote: [
|
|
247
|
+
["\\\\.", "string"],
|
|
248
|
+
['"', { token: "string.delimiter", next: "@pop" }],
|
|
249
|
+
[".", "string"]
|
|
250
|
+
],
|
|
251
|
+
stringendquote: [
|
|
252
|
+
["\\\\.", "string"],
|
|
253
|
+
["'", { token: "string.delimiter", next: "@pop" }],
|
|
254
|
+
[".", "string"]
|
|
255
|
+
]
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
export { conf, language };
|
package/shell/shell.js
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
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
|
+
{ open: '"', close: '"' },
|
|
15
|
+
{ open: "'", close: "'" },
|
|
16
|
+
{ open: "`", close: "`" }
|
|
17
|
+
],
|
|
18
|
+
surroundingPairs: [
|
|
19
|
+
{ open: "{", close: "}" },
|
|
20
|
+
{ open: "[", close: "]" },
|
|
21
|
+
{ open: "(", close: ")" },
|
|
22
|
+
{ open: '"', close: '"' },
|
|
23
|
+
{ open: "'", close: "'" },
|
|
24
|
+
{ open: "`", close: "`" }
|
|
25
|
+
]
|
|
26
|
+
};
|
|
27
|
+
const language = {
|
|
28
|
+
defaultToken: "",
|
|
29
|
+
ignoreCase: true,
|
|
30
|
+
tokenPostfix: ".shell",
|
|
31
|
+
brackets: [
|
|
32
|
+
{ token: "delimiter.bracket", open: "{", close: "}" },
|
|
33
|
+
{ token: "delimiter.parenthesis", open: "(", close: ")" },
|
|
34
|
+
{ token: "delimiter.square", open: "[", close: "]" }
|
|
35
|
+
],
|
|
36
|
+
keywords: [
|
|
37
|
+
"if",
|
|
38
|
+
"then",
|
|
39
|
+
"do",
|
|
40
|
+
"else",
|
|
41
|
+
"elif",
|
|
42
|
+
"while",
|
|
43
|
+
"until",
|
|
44
|
+
"for",
|
|
45
|
+
"in",
|
|
46
|
+
"esac",
|
|
47
|
+
"fi",
|
|
48
|
+
"fin",
|
|
49
|
+
"fil",
|
|
50
|
+
"done",
|
|
51
|
+
"exit",
|
|
52
|
+
"set",
|
|
53
|
+
"unset",
|
|
54
|
+
"export",
|
|
55
|
+
"function"
|
|
56
|
+
],
|
|
57
|
+
builtins: [
|
|
58
|
+
"ab",
|
|
59
|
+
"awk",
|
|
60
|
+
"bash",
|
|
61
|
+
"beep",
|
|
62
|
+
"cat",
|
|
63
|
+
"cc",
|
|
64
|
+
"cd",
|
|
65
|
+
"chown",
|
|
66
|
+
"chmod",
|
|
67
|
+
"chroot",
|
|
68
|
+
"clear",
|
|
69
|
+
"cp",
|
|
70
|
+
"curl",
|
|
71
|
+
"cut",
|
|
72
|
+
"diff",
|
|
73
|
+
"echo",
|
|
74
|
+
"find",
|
|
75
|
+
"gawk",
|
|
76
|
+
"gcc",
|
|
77
|
+
"get",
|
|
78
|
+
"git",
|
|
79
|
+
"grep",
|
|
80
|
+
"hg",
|
|
81
|
+
"kill",
|
|
82
|
+
"killall",
|
|
83
|
+
"ln",
|
|
84
|
+
"ls",
|
|
85
|
+
"make",
|
|
86
|
+
"mkdir",
|
|
87
|
+
"openssl",
|
|
88
|
+
"mv",
|
|
89
|
+
"nc",
|
|
90
|
+
"node",
|
|
91
|
+
"npm",
|
|
92
|
+
"ping",
|
|
93
|
+
"ps",
|
|
94
|
+
"restart",
|
|
95
|
+
"rm",
|
|
96
|
+
"rmdir",
|
|
97
|
+
"sed",
|
|
98
|
+
"service",
|
|
99
|
+
"sh",
|
|
100
|
+
"shopt",
|
|
101
|
+
"shred",
|
|
102
|
+
"source",
|
|
103
|
+
"sort",
|
|
104
|
+
"sleep",
|
|
105
|
+
"ssh",
|
|
106
|
+
"start",
|
|
107
|
+
"stop",
|
|
108
|
+
"su",
|
|
109
|
+
"sudo",
|
|
110
|
+
"svn",
|
|
111
|
+
"tee",
|
|
112
|
+
"telnet",
|
|
113
|
+
"top",
|
|
114
|
+
"touch",
|
|
115
|
+
"vi",
|
|
116
|
+
"vim",
|
|
117
|
+
"wall",
|
|
118
|
+
"wc",
|
|
119
|
+
"wget",
|
|
120
|
+
"who",
|
|
121
|
+
"write",
|
|
122
|
+
"yes",
|
|
123
|
+
"zsh"
|
|
124
|
+
],
|
|
125
|
+
startingWithDash: /\-+\w+/,
|
|
126
|
+
identifiersWithDashes: /[a-zA-Z]\w+(?:@startingWithDash)+/,
|
|
127
|
+
// we include these common regular expressions
|
|
128
|
+
symbols: /[=><!~?&|+\-*\/\^;\.,]+/,
|
|
129
|
+
// The main tokenizer for our languages
|
|
130
|
+
tokenizer: {
|
|
131
|
+
root: [
|
|
132
|
+
[/@identifiersWithDashes/, ""],
|
|
133
|
+
[/(\s)((?:@startingWithDash)+)/, ["white", "attribute.name"]],
|
|
134
|
+
[
|
|
135
|
+
/[a-zA-Z]\w*/,
|
|
136
|
+
{
|
|
137
|
+
cases: {
|
|
138
|
+
"@keywords": "keyword",
|
|
139
|
+
"@builtins": "type.identifier",
|
|
140
|
+
"@default": ""
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
],
|
|
144
|
+
{ include: "@whitespace" },
|
|
145
|
+
{ include: "@strings" },
|
|
146
|
+
{ include: "@parameters" },
|
|
147
|
+
{ include: "@heredoc" },
|
|
148
|
+
[/[{}\[\]()]/, "@brackets"],
|
|
149
|
+
[/@symbols/, "delimiter"],
|
|
150
|
+
{ include: "@numbers" },
|
|
151
|
+
[/[,;]/, "delimiter"]
|
|
152
|
+
],
|
|
153
|
+
whitespace: [
|
|
154
|
+
[/\s+/, "white"],
|
|
155
|
+
[/(^#!.*$)/, "metatag"],
|
|
156
|
+
[/(^#.*$)/, "comment"]
|
|
157
|
+
],
|
|
158
|
+
numbers: [
|
|
159
|
+
[/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
|
|
160
|
+
[/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/, "number.hex"],
|
|
161
|
+
[/\d+/, "number"]
|
|
162
|
+
],
|
|
163
|
+
// Recognize strings, including those broken across lines
|
|
164
|
+
strings: [
|
|
165
|
+
[/'/, "string", "@stringBody"],
|
|
166
|
+
[/"/, "string", "@dblStringBody"]
|
|
167
|
+
],
|
|
168
|
+
stringBody: [
|
|
169
|
+
[/'/, "string", "@popall"],
|
|
170
|
+
[/./, "string"]
|
|
171
|
+
],
|
|
172
|
+
dblStringBody: [
|
|
173
|
+
[/"/, "string", "@popall"],
|
|
174
|
+
[/./, "string"]
|
|
175
|
+
],
|
|
176
|
+
heredoc: [
|
|
177
|
+
[
|
|
178
|
+
/(<<[-<]?)(\s*)(['"`]?)([\w\-]+)(['"`]?)/,
|
|
179
|
+
[
|
|
180
|
+
"constants",
|
|
181
|
+
"white",
|
|
182
|
+
"string.heredoc.delimiter",
|
|
183
|
+
"string.heredoc",
|
|
184
|
+
"string.heredoc.delimiter"
|
|
185
|
+
]
|
|
186
|
+
]
|
|
187
|
+
],
|
|
188
|
+
parameters: [
|
|
189
|
+
[/\$\d+/, "variable.predefined"],
|
|
190
|
+
[/\$\w+/, "variable"],
|
|
191
|
+
[/\$[*@#?\-$!0_]/, "variable"],
|
|
192
|
+
[/\$'/, "variable", "@parameterBodyQuote"],
|
|
193
|
+
[/\$"/, "variable", "@parameterBodyDoubleQuote"],
|
|
194
|
+
[/\$\(/, "variable", "@parameterBodyParen"],
|
|
195
|
+
[/\$\{/, "variable", "@parameterBodyCurlyBrace"]
|
|
196
|
+
],
|
|
197
|
+
parameterBodyQuote: [
|
|
198
|
+
[/[^#:%*@\-!_']+/, "variable"],
|
|
199
|
+
[/[#:%*@\-!_]/, "delimiter"],
|
|
200
|
+
[/[']/, "variable", "@pop"]
|
|
201
|
+
],
|
|
202
|
+
parameterBodyDoubleQuote: [
|
|
203
|
+
[/[^#:%*@\-!_"]+/, "variable"],
|
|
204
|
+
[/[#:%*@\-!_]/, "delimiter"],
|
|
205
|
+
[/["]/, "variable", "@pop"]
|
|
206
|
+
],
|
|
207
|
+
parameterBodyParen: [
|
|
208
|
+
[/[^#:%*@\-!_)]+/, "variable"],
|
|
209
|
+
[/[#:%*@\-!_]/, "delimiter"],
|
|
210
|
+
[/[)]/, "variable", "@pop"]
|
|
211
|
+
],
|
|
212
|
+
parameterBodyCurlyBrace: [
|
|
213
|
+
[/[^#:%*@\-!_}]+/, "variable"],
|
|
214
|
+
[/[#:%*@\-!_]/, "delimiter"],
|
|
215
|
+
[/[}]/, "variable", "@pop"]
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
export { conf, language };
|