online-compiler-widget 0.0.4 → 1.0.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/dist/abap-CrvW7_qN.js +1398 -0
- package/dist/apex-BAOI8p1v.js +327 -0
- package/dist/assets/css.worker-Cb0JI69t.js +93 -0
- package/dist/assets/html.worker-BNFZMwEc.js +470 -0
- package/dist/assets/json.worker-BCybXpia.js +58 -0
- package/dist/assets/ts.worker-DAVh1bw1.js +67731 -0
- package/dist/azcli-BlCk_UqW.js +68 -0
- package/dist/bat-DPoEelVx.js +100 -0
- package/dist/bicep-Cp1F394l.js +102 -0
- package/dist/cameligo-CWqtSlQs.js +174 -0
- package/dist/clojure-CKBp32Gf.js +761 -0
- package/dist/coffee-CDo6vc-J.js +232 -0
- package/dist/cpp-DokufPgf.js +389 -0
- package/dist/csharp-BQi3szM0.js +326 -0
- package/dist/csp-BSGtCCZ-.js +53 -0
- package/dist/css-DEPFDJfb.js +187 -0
- package/dist/cssMode-nHrB9Mnr.js +141 -0
- package/dist/cypher-DAb1vOxS.js +263 -0
- package/dist/dart-C8p4jewR.js +281 -0
- package/dist/dockerfile-DP0iLFPN.js +130 -0
- package/dist/ecl-BDQHA6fi.js +456 -0
- package/dist/elixir-D4II6kDM.js +569 -0
- package/dist/flow9-StcnL-VB.js +142 -0
- package/dist/freemarker2-BoiXdkJM.js +982 -0
- package/dist/fsharp-DdUVp3EN.js +217 -0
- package/dist/go-D1-I258M.js +218 -0
- package/dist/graphql-DWkL3f8U.js +151 -0
- package/dist/handlebars-C7PJzkmo.js +412 -0
- package/dist/hcl-D_0MNifv.js +183 -0
- package/dist/html-D_xe_tUa.js +301 -0
- package/dist/htmlMode-Dk_luXu_.js +152 -0
- package/dist/index-Ds0EJmOd.js +129200 -0
- package/dist/index.js +14 -0
- package/dist/ini-C4I2-MT7.js +71 -0
- package/dist/java-OBvaP_SS.js +232 -0
- package/dist/javascript-CUK67ITD.js +70 -0
- package/dist/jsonMode-BIAYTpVF.js +569 -0
- package/dist/julia-BmDH8Kkf.js +511 -0
- package/dist/kotlin-Dhu5AGOD.js +252 -0
- package/dist/less-CzmjXREq.js +162 -0
- package/dist/lexon-CV2c4pN9.js +157 -0
- package/dist/liquid-Cgsk8EmK.js +233 -0
- package/dist/lspLanguageFeatures-HqO1l9Me.js +1458 -0
- package/dist/lua-CFY5U8qF.js +162 -0
- package/dist/m3-BL_AnZVh.js +210 -0
- package/dist/markdown-CWKQPXCv.js +229 -0
- package/dist/mdx-QboWmT4M.js +158 -0
- package/dist/mips-ButYmJ5E.js +198 -0
- package/dist/msdax-C3cnXqDh.js +375 -0
- package/dist/mysql-YlSHaf6G.js +878 -0
- package/dist/objective-c-Dwnlproe.js +183 -0
- package/dist/pascal-UzGbSWEN.js +251 -0
- package/dist/pascaligo-CslTgu68.js +164 -0
- package/dist/perl-oj6r_mgw.js +626 -0
- package/dist/pgsql-DSBO0Mev.js +851 -0
- package/dist/php-YzCD--7j.js +500 -0
- package/dist/pla-CmylB8vQ.js +137 -0
- package/dist/postiats-CLFW5gNY.js +907 -0
- package/dist/powerquery-CmOWUvlh.js +890 -0
- package/dist/powershell-fHQcmBLK.js +239 -0
- package/dist/protobuf-p5BArb-9.js +420 -0
- package/dist/pug-gVdUDvqf.js +402 -0
- package/dist/python-kIZaMFF7.js +294 -0
- package/dist/qsharp-DnrWSUlt.js +301 -0
- package/dist/r-Cv309K2z.js +243 -0
- package/dist/razor-ms2cCMGp.js +543 -0
- package/dist/redis-DTcS4wMj.js +302 -0
- package/dist/redshift-hLxZVESM.js +809 -0
- package/dist/restructuredtext-C898lK4f.js +174 -0
- package/dist/ruby-CgKtnJIQ.js +511 -0
- package/dist/rust-bj8oxVnh.js +343 -0
- package/dist/sb-DWynz26l.js +115 -0
- package/dist/scala-BL5z1UEd.js +370 -0
- package/dist/scheme-DUJsH6VU.js +108 -0
- package/dist/scss-CxjmhvaL.js +262 -0
- package/dist/shell-D14Zs1dF.js +221 -0
- package/dist/solidity-WyRm-BGK.js +1367 -0
- package/dist/sophia-CKk-_Oa5.js +199 -0
- package/dist/sparql-DHtmINMZ.js +201 -0
- package/dist/sql-Dqaj5JHC.js +853 -0
- package/dist/st-Bj2IIaop.js +416 -0
- package/dist/style.css +1 -0
- package/dist/swift-DwxP72iM.js +312 -0
- package/dist/systemverilog-D7wJfuql.js +576 -0
- package/dist/tcl-0ApMt-eC.js +232 -0
- package/dist/tsMode-BiXWAJYS.js +946 -0
- package/dist/twig-DxwbdmvQ.js +392 -0
- package/dist/typescript-ByMmjZ38.js +336 -0
- package/dist/typespec-Fd-JwSuS.js +117 -0
- package/dist/vb-CxuyYE1I.js +372 -0
- package/dist/wgsl-DoEGc31J.js +439 -0
- package/dist/xml-iOXTZgNN.js +88 -0
- package/dist/yaml-RRlyy-QW.js +199 -0
- package/package.json +41 -36
- package/FileStorage/obj/FileStorage.csproj.EntityFrameworkCore.targets +0 -28
- package/README.md +0 -1
- package/eslint.config.js +0 -26
- package/index.html +0 -13
- package/index.tsx +0 -3
- package/openapitools.json +0 -7
- package/pnpm-workspace.yaml +0 -2
- package/public/vite.svg +0 -1
- package/src/App.css +0 -49
- package/src/App.tsx +0 -84
- package/src/api/.openapi-generator/FILES +0 -25
- package/src/api/.openapi-generator/VERSION +0 -1
- package/src/api/.openapi-generator-ignore +0 -23
- package/src/api/api.ts +0 -1312
- package/src/api/base.ts +0 -62
- package/src/api/common.ts +0 -113
- package/src/api/configuration.ts +0 -121
- package/src/api/docs/CompilationError.md +0 -26
- package/src/api/docs/CompileRequest.md +0 -22
- package/src/api/docs/CompileResult.md +0 -28
- package/src/api/docs/CompilerApi.md +0 -263
- package/src/api/docs/CreateFileDto.md +0 -22
- package/src/api/docs/CreateProjectRequest.md +0 -20
- package/src/api/docs/FileApi.md +0 -274
- package/src/api/docs/ProcessStatus.md +0 -28
- package/src/api/docs/ProjectApi.md +0 -362
- package/src/api/docs/ProjectInfo.md +0 -24
- package/src/api/docs/ProjectStats.md +0 -28
- package/src/api/docs/RenameFileDto.md +0 -20
- package/src/api/docs/RenameProjectRequest.md +0 -20
- package/src/api/docs/RunRequest.md +0 -24
- package/src/api/docs/RunResult.md +0 -30
- package/src/api/docs/RunningProjectInfo.md +0 -26
- package/src/api/docs/UpdateFileDto.md +0 -20
- package/src/api/git_push.sh +0 -57
- package/src/api/index.ts +0 -18
- package/src/assets/Badge.svg +0 -17
- package/src/assets/closeIcon.svg +0 -20
- package/src/assets/documentIcon.svg +0 -11
- package/src/assets/history.svg +0 -11
- package/src/assets/output.svg +0 -12
- package/src/assets/plus.svg +0 -20
- package/src/assets/react.svg +0 -1
- package/src/assets/save-icon.svg +0 -11
- package/src/assets/shield.svg +0 -10
- package/src/assets/start.svg +0 -11
- package/src/assets/stop.svg +0 -11
- package/src/components/CompilerWidget.module.scss +0 -169
- package/src/components/CompilerWidget.tsx +0 -331
- package/src/components/FileExplorer.module.scss +0 -372
- package/src/components/FileExplorer.tsx +0 -285
- package/src/components/MonacoEditorWrapper.module.scss +0 -29
- package/src/components/MonacoEditorWrapper.tsx +0 -74
- package/src/components/OutputPanel.module.scss +0 -123
- package/src/components/OutputPanel.tsx +0 -53
- package/src/components/RunContainer.module.scss +0 -150
- package/src/components/RunContainer.tsx +0 -34
- package/src/hooks/useCompiler.ts +0 -228
- package/src/hooks/useInitialNodes.ts +0 -0
- package/src/index.css +0 -78
- package/src/main.tsx +0 -8
- package/src/types/EditorDocument.ts +0 -8
- package/swagger.json +0 -1020
- package/tsconfig.app.json +0 -29
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -26
- package/vite.config.ts +0 -8
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import { l as e } from "./index-Ds0EJmOd.js";
|
|
2
|
+
const t = [
|
|
3
|
+
"area",
|
|
4
|
+
"base",
|
|
5
|
+
"br",
|
|
6
|
+
"col",
|
|
7
|
+
"embed",
|
|
8
|
+
"hr",
|
|
9
|
+
"img",
|
|
10
|
+
"input",
|
|
11
|
+
"keygen",
|
|
12
|
+
"link",
|
|
13
|
+
"menuitem",
|
|
14
|
+
"meta",
|
|
15
|
+
"param",
|
|
16
|
+
"source",
|
|
17
|
+
"track",
|
|
18
|
+
"wbr"
|
|
19
|
+
], a = {
|
|
20
|
+
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
|
|
21
|
+
comments: {
|
|
22
|
+
blockComment: ["{{!--", "--}}"]
|
|
23
|
+
},
|
|
24
|
+
brackets: [
|
|
25
|
+
["<!--", "-->"],
|
|
26
|
+
["<", ">"],
|
|
27
|
+
["{{", "}}"],
|
|
28
|
+
["{", "}"],
|
|
29
|
+
["(", ")"]
|
|
30
|
+
],
|
|
31
|
+
autoClosingPairs: [
|
|
32
|
+
{ open: "{", close: "}" },
|
|
33
|
+
{ open: "[", close: "]" },
|
|
34
|
+
{ open: "(", close: ")" },
|
|
35
|
+
{ open: '"', close: '"' },
|
|
36
|
+
{ open: "'", close: "'" }
|
|
37
|
+
],
|
|
38
|
+
surroundingPairs: [
|
|
39
|
+
{ open: "<", close: ">" },
|
|
40
|
+
{ open: '"', close: '"' },
|
|
41
|
+
{ open: "'", close: "'" }
|
|
42
|
+
],
|
|
43
|
+
onEnterRules: [
|
|
44
|
+
{
|
|
45
|
+
beforeText: new RegExp(
|
|
46
|
+
`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,
|
|
47
|
+
"i"
|
|
48
|
+
),
|
|
49
|
+
afterText: /^<\/(\w[\w\d]*)\s*>$/i,
|
|
50
|
+
action: {
|
|
51
|
+
indentAction: e.IndentAction.IndentOutdent
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
beforeText: new RegExp(
|
|
56
|
+
`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,
|
|
57
|
+
"i"
|
|
58
|
+
),
|
|
59
|
+
action: { indentAction: e.IndentAction.Indent }
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}, m = {
|
|
63
|
+
defaultToken: "",
|
|
64
|
+
tokenPostfix: "",
|
|
65
|
+
// ignoreCase: true,
|
|
66
|
+
// The main tokenizer for our languages
|
|
67
|
+
tokenizer: {
|
|
68
|
+
root: [
|
|
69
|
+
[/\{\{!--/, "comment.block.start.handlebars", "@commentBlock"],
|
|
70
|
+
[/\{\{!/, "comment.start.handlebars", "@comment"],
|
|
71
|
+
[/\{\{/, { token: "@rematch", switchTo: "@handlebarsInSimpleState.root" }],
|
|
72
|
+
[/<!DOCTYPE/, "metatag.html", "@doctype"],
|
|
73
|
+
[/<!--/, "comment.html", "@commentHtml"],
|
|
74
|
+
[/(<)(\w+)(\/>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
|
|
75
|
+
[/(<)(script)/, ["delimiter.html", { token: "tag.html", next: "@script" }]],
|
|
76
|
+
[/(<)(style)/, ["delimiter.html", { token: "tag.html", next: "@style" }]],
|
|
77
|
+
[/(<)([:\w]+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
|
|
78
|
+
[/(<\/)(\w+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
|
|
79
|
+
[/</, "delimiter.html"],
|
|
80
|
+
[/\{/, "delimiter.html"],
|
|
81
|
+
[/[^<{]+/]
|
|
82
|
+
// text
|
|
83
|
+
],
|
|
84
|
+
doctype: [
|
|
85
|
+
[
|
|
86
|
+
/\{\{/,
|
|
87
|
+
{
|
|
88
|
+
token: "@rematch",
|
|
89
|
+
switchTo: "@handlebarsInSimpleState.comment"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
[/[^>]+/, "metatag.content.html"],
|
|
93
|
+
[/>/, "metatag.html", "@pop"]
|
|
94
|
+
],
|
|
95
|
+
comment: [
|
|
96
|
+
[/\}\}/, "comment.end.handlebars", "@pop"],
|
|
97
|
+
[/./, "comment.content.handlebars"]
|
|
98
|
+
],
|
|
99
|
+
commentBlock: [
|
|
100
|
+
[/--\}\}/, "comment.block.end.handlebars", "@pop"],
|
|
101
|
+
[/./, "comment.content.handlebars"]
|
|
102
|
+
],
|
|
103
|
+
commentHtml: [
|
|
104
|
+
[
|
|
105
|
+
/\{\{/,
|
|
106
|
+
{
|
|
107
|
+
token: "@rematch",
|
|
108
|
+
switchTo: "@handlebarsInSimpleState.comment"
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
[/-->/, "comment.html", "@pop"],
|
|
112
|
+
[/[^-]+/, "comment.content.html"],
|
|
113
|
+
[/./, "comment.content.html"]
|
|
114
|
+
],
|
|
115
|
+
otherTag: [
|
|
116
|
+
[
|
|
117
|
+
/\{\{/,
|
|
118
|
+
{
|
|
119
|
+
token: "@rematch",
|
|
120
|
+
switchTo: "@handlebarsInSimpleState.otherTag"
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
[/\/?>/, "delimiter.html", "@pop"],
|
|
124
|
+
[/"([^"]*)"/, "attribute.value"],
|
|
125
|
+
[/'([^']*)'/, "attribute.value"],
|
|
126
|
+
[/[\w\-]+/, "attribute.name"],
|
|
127
|
+
[/=/, "delimiter"],
|
|
128
|
+
[/[ \t\r\n]+/]
|
|
129
|
+
// whitespace
|
|
130
|
+
],
|
|
131
|
+
// -- BEGIN <script> tags handling
|
|
132
|
+
// After <script
|
|
133
|
+
script: [
|
|
134
|
+
[
|
|
135
|
+
/\{\{/,
|
|
136
|
+
{
|
|
137
|
+
token: "@rematch",
|
|
138
|
+
switchTo: "@handlebarsInSimpleState.script"
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
[/type/, "attribute.name", "@scriptAfterType"],
|
|
142
|
+
[/"([^"]*)"/, "attribute.value"],
|
|
143
|
+
[/'([^']*)'/, "attribute.value"],
|
|
144
|
+
[/[\w\-]+/, "attribute.name"],
|
|
145
|
+
[/=/, "delimiter"],
|
|
146
|
+
[
|
|
147
|
+
/>/,
|
|
148
|
+
{
|
|
149
|
+
token: "delimiter.html",
|
|
150
|
+
next: "@scriptEmbedded.text/javascript",
|
|
151
|
+
nextEmbedded: "text/javascript"
|
|
152
|
+
}
|
|
153
|
+
],
|
|
154
|
+
[/[ \t\r\n]+/],
|
|
155
|
+
// whitespace
|
|
156
|
+
[
|
|
157
|
+
/(<\/)(script\s*)(>)/,
|
|
158
|
+
["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }]
|
|
159
|
+
]
|
|
160
|
+
],
|
|
161
|
+
// After <script ... type
|
|
162
|
+
scriptAfterType: [
|
|
163
|
+
[
|
|
164
|
+
/\{\{/,
|
|
165
|
+
{
|
|
166
|
+
token: "@rematch",
|
|
167
|
+
switchTo: "@handlebarsInSimpleState.scriptAfterType"
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
[/=/, "delimiter", "@scriptAfterTypeEquals"],
|
|
171
|
+
[
|
|
172
|
+
/>/,
|
|
173
|
+
{
|
|
174
|
+
token: "delimiter.html",
|
|
175
|
+
next: "@scriptEmbedded.text/javascript",
|
|
176
|
+
nextEmbedded: "text/javascript"
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
// cover invalid e.g. <script type>
|
|
180
|
+
[/[ \t\r\n]+/],
|
|
181
|
+
// whitespace
|
|
182
|
+
[/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
|
|
183
|
+
],
|
|
184
|
+
// After <script ... type =
|
|
185
|
+
scriptAfterTypeEquals: [
|
|
186
|
+
[
|
|
187
|
+
/\{\{/,
|
|
188
|
+
{
|
|
189
|
+
token: "@rematch",
|
|
190
|
+
switchTo: "@handlebarsInSimpleState.scriptAfterTypeEquals"
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
[
|
|
194
|
+
/"([^"]*)"/,
|
|
195
|
+
{
|
|
196
|
+
token: "attribute.value",
|
|
197
|
+
switchTo: "@scriptWithCustomType.$1"
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
[
|
|
201
|
+
/'([^']*)'/,
|
|
202
|
+
{
|
|
203
|
+
token: "attribute.value",
|
|
204
|
+
switchTo: "@scriptWithCustomType.$1"
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
[
|
|
208
|
+
/>/,
|
|
209
|
+
{
|
|
210
|
+
token: "delimiter.html",
|
|
211
|
+
next: "@scriptEmbedded.text/javascript",
|
|
212
|
+
nextEmbedded: "text/javascript"
|
|
213
|
+
}
|
|
214
|
+
],
|
|
215
|
+
// cover invalid e.g. <script type=>
|
|
216
|
+
[/[ \t\r\n]+/],
|
|
217
|
+
// whitespace
|
|
218
|
+
[/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
|
|
219
|
+
],
|
|
220
|
+
// After <script ... type = $S2
|
|
221
|
+
scriptWithCustomType: [
|
|
222
|
+
[
|
|
223
|
+
/\{\{/,
|
|
224
|
+
{
|
|
225
|
+
token: "@rematch",
|
|
226
|
+
switchTo: "@handlebarsInSimpleState.scriptWithCustomType.$S2"
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
[
|
|
230
|
+
/>/,
|
|
231
|
+
{
|
|
232
|
+
token: "delimiter.html",
|
|
233
|
+
next: "@scriptEmbedded.$S2",
|
|
234
|
+
nextEmbedded: "$S2"
|
|
235
|
+
}
|
|
236
|
+
],
|
|
237
|
+
[/"([^"]*)"/, "attribute.value"],
|
|
238
|
+
[/'([^']*)'/, "attribute.value"],
|
|
239
|
+
[/[\w\-]+/, "attribute.name"],
|
|
240
|
+
[/=/, "delimiter"],
|
|
241
|
+
[/[ \t\r\n]+/],
|
|
242
|
+
// whitespace
|
|
243
|
+
[/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
|
|
244
|
+
],
|
|
245
|
+
scriptEmbedded: [
|
|
246
|
+
[
|
|
247
|
+
/\{\{/,
|
|
248
|
+
{
|
|
249
|
+
token: "@rematch",
|
|
250
|
+
switchTo: "@handlebarsInEmbeddedState.scriptEmbedded.$S2",
|
|
251
|
+
nextEmbedded: "@pop"
|
|
252
|
+
}
|
|
253
|
+
],
|
|
254
|
+
[/<\/script/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }]
|
|
255
|
+
],
|
|
256
|
+
// -- END <script> tags handling
|
|
257
|
+
// -- BEGIN <style> tags handling
|
|
258
|
+
// After <style
|
|
259
|
+
style: [
|
|
260
|
+
[
|
|
261
|
+
/\{\{/,
|
|
262
|
+
{
|
|
263
|
+
token: "@rematch",
|
|
264
|
+
switchTo: "@handlebarsInSimpleState.style"
|
|
265
|
+
}
|
|
266
|
+
],
|
|
267
|
+
[/type/, "attribute.name", "@styleAfterType"],
|
|
268
|
+
[/"([^"]*)"/, "attribute.value"],
|
|
269
|
+
[/'([^']*)'/, "attribute.value"],
|
|
270
|
+
[/[\w\-]+/, "attribute.name"],
|
|
271
|
+
[/=/, "delimiter"],
|
|
272
|
+
[
|
|
273
|
+
/>/,
|
|
274
|
+
{
|
|
275
|
+
token: "delimiter.html",
|
|
276
|
+
next: "@styleEmbedded.text/css",
|
|
277
|
+
nextEmbedded: "text/css"
|
|
278
|
+
}
|
|
279
|
+
],
|
|
280
|
+
[/[ \t\r\n]+/],
|
|
281
|
+
// whitespace
|
|
282
|
+
[
|
|
283
|
+
/(<\/)(style\s*)(>)/,
|
|
284
|
+
["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }]
|
|
285
|
+
]
|
|
286
|
+
],
|
|
287
|
+
// After <style ... type
|
|
288
|
+
styleAfterType: [
|
|
289
|
+
[
|
|
290
|
+
/\{\{/,
|
|
291
|
+
{
|
|
292
|
+
token: "@rematch",
|
|
293
|
+
switchTo: "@handlebarsInSimpleState.styleAfterType"
|
|
294
|
+
}
|
|
295
|
+
],
|
|
296
|
+
[/=/, "delimiter", "@styleAfterTypeEquals"],
|
|
297
|
+
[
|
|
298
|
+
/>/,
|
|
299
|
+
{
|
|
300
|
+
token: "delimiter.html",
|
|
301
|
+
next: "@styleEmbedded.text/css",
|
|
302
|
+
nextEmbedded: "text/css"
|
|
303
|
+
}
|
|
304
|
+
],
|
|
305
|
+
// cover invalid e.g. <style type>
|
|
306
|
+
[/[ \t\r\n]+/],
|
|
307
|
+
// whitespace
|
|
308
|
+
[/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
|
|
309
|
+
],
|
|
310
|
+
// After <style ... type =
|
|
311
|
+
styleAfterTypeEquals: [
|
|
312
|
+
[
|
|
313
|
+
/\{\{/,
|
|
314
|
+
{
|
|
315
|
+
token: "@rematch",
|
|
316
|
+
switchTo: "@handlebarsInSimpleState.styleAfterTypeEquals"
|
|
317
|
+
}
|
|
318
|
+
],
|
|
319
|
+
[
|
|
320
|
+
/"([^"]*)"/,
|
|
321
|
+
{
|
|
322
|
+
token: "attribute.value",
|
|
323
|
+
switchTo: "@styleWithCustomType.$1"
|
|
324
|
+
}
|
|
325
|
+
],
|
|
326
|
+
[
|
|
327
|
+
/'([^']*)'/,
|
|
328
|
+
{
|
|
329
|
+
token: "attribute.value",
|
|
330
|
+
switchTo: "@styleWithCustomType.$1"
|
|
331
|
+
}
|
|
332
|
+
],
|
|
333
|
+
[
|
|
334
|
+
/>/,
|
|
335
|
+
{
|
|
336
|
+
token: "delimiter.html",
|
|
337
|
+
next: "@styleEmbedded.text/css",
|
|
338
|
+
nextEmbedded: "text/css"
|
|
339
|
+
}
|
|
340
|
+
],
|
|
341
|
+
// cover invalid e.g. <style type=>
|
|
342
|
+
[/[ \t\r\n]+/],
|
|
343
|
+
// whitespace
|
|
344
|
+
[/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
|
|
345
|
+
],
|
|
346
|
+
// After <style ... type = $S2
|
|
347
|
+
styleWithCustomType: [
|
|
348
|
+
[
|
|
349
|
+
/\{\{/,
|
|
350
|
+
{
|
|
351
|
+
token: "@rematch",
|
|
352
|
+
switchTo: "@handlebarsInSimpleState.styleWithCustomType.$S2"
|
|
353
|
+
}
|
|
354
|
+
],
|
|
355
|
+
[
|
|
356
|
+
/>/,
|
|
357
|
+
{
|
|
358
|
+
token: "delimiter.html",
|
|
359
|
+
next: "@styleEmbedded.$S2",
|
|
360
|
+
nextEmbedded: "$S2"
|
|
361
|
+
}
|
|
362
|
+
],
|
|
363
|
+
[/"([^"]*)"/, "attribute.value"],
|
|
364
|
+
[/'([^']*)'/, "attribute.value"],
|
|
365
|
+
[/[\w\-]+/, "attribute.name"],
|
|
366
|
+
[/=/, "delimiter"],
|
|
367
|
+
[/[ \t\r\n]+/],
|
|
368
|
+
// whitespace
|
|
369
|
+
[/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
|
|
370
|
+
],
|
|
371
|
+
styleEmbedded: [
|
|
372
|
+
[
|
|
373
|
+
/\{\{/,
|
|
374
|
+
{
|
|
375
|
+
token: "@rematch",
|
|
376
|
+
switchTo: "@handlebarsInEmbeddedState.styleEmbedded.$S2",
|
|
377
|
+
nextEmbedded: "@pop"
|
|
378
|
+
}
|
|
379
|
+
],
|
|
380
|
+
[/<\/style/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }]
|
|
381
|
+
],
|
|
382
|
+
// -- END <style> tags handling
|
|
383
|
+
handlebarsInSimpleState: [
|
|
384
|
+
[/\{\{\{?/, "delimiter.handlebars"],
|
|
385
|
+
[/\}\}\}?/, { token: "delimiter.handlebars", switchTo: "@$S2.$S3" }],
|
|
386
|
+
{ include: "handlebarsRoot" }
|
|
387
|
+
],
|
|
388
|
+
handlebarsInEmbeddedState: [
|
|
389
|
+
[/\{\{\{?/, "delimiter.handlebars"],
|
|
390
|
+
[
|
|
391
|
+
/\}\}\}?/,
|
|
392
|
+
{
|
|
393
|
+
token: "delimiter.handlebars",
|
|
394
|
+
switchTo: "@$S2.$S3",
|
|
395
|
+
nextEmbedded: "$S3"
|
|
396
|
+
}
|
|
397
|
+
],
|
|
398
|
+
{ include: "handlebarsRoot" }
|
|
399
|
+
],
|
|
400
|
+
handlebarsRoot: [
|
|
401
|
+
[/"[^"]*"/, "string.handlebars"],
|
|
402
|
+
[/[#/][^\s}]+/, "keyword.helper.handlebars"],
|
|
403
|
+
[/else\b/, "keyword.helper.handlebars"],
|
|
404
|
+
[/[\s]+/],
|
|
405
|
+
[/[^}]/, "variable.parameter.handlebars"]
|
|
406
|
+
]
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
export {
|
|
410
|
+
a as conf,
|
|
411
|
+
m as language
|
|
412
|
+
};
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
comments: {
|
|
3
|
+
lineComment: "#",
|
|
4
|
+
blockComment: ["/*", "*/"]
|
|
5
|
+
},
|
|
6
|
+
brackets: [
|
|
7
|
+
["{", "}"],
|
|
8
|
+
["[", "]"],
|
|
9
|
+
["(", ")"]
|
|
10
|
+
],
|
|
11
|
+
autoClosingPairs: [
|
|
12
|
+
{ open: "{", close: "}" },
|
|
13
|
+
{ open: "[", close: "]" },
|
|
14
|
+
{ open: "(", close: ")" },
|
|
15
|
+
{ open: '"', close: '"', notIn: ["string"] }
|
|
16
|
+
],
|
|
17
|
+
surroundingPairs: [
|
|
18
|
+
{ open: "{", close: "}" },
|
|
19
|
+
{ open: "[", close: "]" },
|
|
20
|
+
{ open: "(", close: ")" },
|
|
21
|
+
{ open: '"', close: '"' }
|
|
22
|
+
]
|
|
23
|
+
}, t = {
|
|
24
|
+
defaultToken: "",
|
|
25
|
+
tokenPostfix: ".hcl",
|
|
26
|
+
keywords: [
|
|
27
|
+
"var",
|
|
28
|
+
"local",
|
|
29
|
+
"path",
|
|
30
|
+
"for_each",
|
|
31
|
+
"any",
|
|
32
|
+
"string",
|
|
33
|
+
"number",
|
|
34
|
+
"bool",
|
|
35
|
+
"true",
|
|
36
|
+
"false",
|
|
37
|
+
"null",
|
|
38
|
+
"if ",
|
|
39
|
+
"else ",
|
|
40
|
+
"endif ",
|
|
41
|
+
"for ",
|
|
42
|
+
"in",
|
|
43
|
+
"endfor"
|
|
44
|
+
],
|
|
45
|
+
operators: [
|
|
46
|
+
"=",
|
|
47
|
+
">=",
|
|
48
|
+
"<=",
|
|
49
|
+
"==",
|
|
50
|
+
"!=",
|
|
51
|
+
"+",
|
|
52
|
+
"-",
|
|
53
|
+
"*",
|
|
54
|
+
"/",
|
|
55
|
+
"%",
|
|
56
|
+
"&&",
|
|
57
|
+
"||",
|
|
58
|
+
"!",
|
|
59
|
+
"<",
|
|
60
|
+
">",
|
|
61
|
+
"?",
|
|
62
|
+
"...",
|
|
63
|
+
":"
|
|
64
|
+
],
|
|
65
|
+
symbols: /[=><!~?:&|+\-*\/\^%]+/,
|
|
66
|
+
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
|
|
67
|
+
terraformFunctions: /(abs|ceil|floor|log|max|min|pow|signum|chomp|format|formatlist|indent|join|lower|regex|regexall|replace|split|strrev|substr|title|trimspace|upper|chunklist|coalesce|coalescelist|compact|concat|contains|distinct|element|flatten|index|keys|length|list|lookup|map|matchkeys|merge|range|reverse|setintersection|setproduct|setunion|slice|sort|transpose|values|zipmap|base64decode|base64encode|base64gzip|csvdecode|jsondecode|jsonencode|urlencode|yamldecode|yamlencode|abspath|dirname|pathexpand|basename|file|fileexists|fileset|filebase64|templatefile|formatdate|timeadd|timestamp|base64sha256|base64sha512|bcrypt|filebase64sha256|filebase64sha512|filemd5|filemd1|filesha256|filesha512|md5|rsadecrypt|sha1|sha256|sha512|uuid|uuidv5|cidrhost|cidrnetmask|cidrsubnet|tobool|tolist|tomap|tonumber|toset|tostring)/,
|
|
68
|
+
terraformMainBlocks: /(module|data|terraform|resource|provider|variable|output|locals)/,
|
|
69
|
+
tokenizer: {
|
|
70
|
+
root: [
|
|
71
|
+
// highlight main blocks
|
|
72
|
+
[
|
|
73
|
+
/^@terraformMainBlocks([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)(\{)/,
|
|
74
|
+
["type", "", "string", "", "string", "", "@brackets"]
|
|
75
|
+
],
|
|
76
|
+
// highlight all the remaining blocks
|
|
77
|
+
[
|
|
78
|
+
/(\w+[ \t]+)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)(\{)/,
|
|
79
|
+
["identifier", "", "string", "", "string", "", "@brackets"]
|
|
80
|
+
],
|
|
81
|
+
// highlight block
|
|
82
|
+
[
|
|
83
|
+
/(\w+[ \t]+)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)([\w-]+|"[\w-]+"|)(=)(\{)/,
|
|
84
|
+
["identifier", "", "string", "", "operator", "", "@brackets"]
|
|
85
|
+
],
|
|
86
|
+
// terraform general highlight - shared with expressions
|
|
87
|
+
{ include: "@terraform" }
|
|
88
|
+
],
|
|
89
|
+
terraform: [
|
|
90
|
+
// highlight terraform functions
|
|
91
|
+
[/@terraformFunctions(\()/, ["type", "@brackets"]],
|
|
92
|
+
// all other words are variables or keywords
|
|
93
|
+
[
|
|
94
|
+
/[a-zA-Z_]\w*-*/,
|
|
95
|
+
// must work with variables such as foo-bar and also with negative numbers
|
|
96
|
+
{
|
|
97
|
+
cases: {
|
|
98
|
+
"@keywords": { token: "keyword.$0" },
|
|
99
|
+
"@default": "variable"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
{ include: "@whitespace" },
|
|
104
|
+
{ include: "@heredoc" },
|
|
105
|
+
// delimiters and operators
|
|
106
|
+
[/[{}()\[\]]/, "@brackets"],
|
|
107
|
+
[/[<>](?!@symbols)/, "@brackets"],
|
|
108
|
+
[
|
|
109
|
+
/@symbols/,
|
|
110
|
+
{
|
|
111
|
+
cases: {
|
|
112
|
+
"@operators": "operator",
|
|
113
|
+
"@default": ""
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
// numbers
|
|
118
|
+
[/\d*\d+[eE]([\-+]?\d+)?/, "number.float"],
|
|
119
|
+
[/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
|
|
120
|
+
[/\d[\d']*/, "number"],
|
|
121
|
+
[/\d/, "number"],
|
|
122
|
+
[/[;,.]/, "delimiter"],
|
|
123
|
+
// delimiter: after number because of .\d floats
|
|
124
|
+
// strings
|
|
125
|
+
[/"/, "string", "@string"],
|
|
126
|
+
// this will include expressions
|
|
127
|
+
[/'/, "invalid"]
|
|
128
|
+
],
|
|
129
|
+
heredoc: [
|
|
130
|
+
[/<<[-]*\s*["]?([\w\-]+)["]?/, { token: "string.heredoc.delimiter", next: "@heredocBody.$1" }]
|
|
131
|
+
],
|
|
132
|
+
heredocBody: [
|
|
133
|
+
[
|
|
134
|
+
/([\w\-]+)$/,
|
|
135
|
+
{
|
|
136
|
+
cases: {
|
|
137
|
+
"$1==$S2": [
|
|
138
|
+
{
|
|
139
|
+
token: "string.heredoc.delimiter",
|
|
140
|
+
next: "@popall"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"@default": "string.heredoc"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
[/./, "string.heredoc"]
|
|
148
|
+
],
|
|
149
|
+
whitespace: [
|
|
150
|
+
[/[ \t\r\n]+/, ""],
|
|
151
|
+
[/\/\*/, "comment", "@comment"],
|
|
152
|
+
[/\/\/.*$/, "comment"],
|
|
153
|
+
[/#.*$/, "comment"]
|
|
154
|
+
],
|
|
155
|
+
comment: [
|
|
156
|
+
[/[^\/*]+/, "comment"],
|
|
157
|
+
[/\*\//, "comment", "@pop"],
|
|
158
|
+
[/[\/*]/, "comment"]
|
|
159
|
+
],
|
|
160
|
+
string: [
|
|
161
|
+
[/\$\{/, { token: "delimiter", next: "@stringExpression" }],
|
|
162
|
+
[/[^\\"\$]+/, "string"],
|
|
163
|
+
[/@escapes/, "string.escape"],
|
|
164
|
+
[/\\./, "string.escape.invalid"],
|
|
165
|
+
[/"/, "string", "@popall"]
|
|
166
|
+
],
|
|
167
|
+
stringInsideExpression: [
|
|
168
|
+
[/[^\\"]+/, "string"],
|
|
169
|
+
[/@escapes/, "string.escape"],
|
|
170
|
+
[/\\./, "string.escape.invalid"],
|
|
171
|
+
[/"/, "string", "@pop"]
|
|
172
|
+
],
|
|
173
|
+
stringExpression: [
|
|
174
|
+
[/\}/, { token: "delimiter", next: "@pop" }],
|
|
175
|
+
[/"/, "string", "@stringInsideExpression"],
|
|
176
|
+
{ include: "@terraform" }
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
export {
|
|
181
|
+
e as conf,
|
|
182
|
+
t as language
|
|
183
|
+
};
|