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,162 @@
|
|
|
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: '"' },
|
|
16
|
+
{ open: "'", close: "'" }
|
|
17
|
+
],
|
|
18
|
+
surroundingPairs: [
|
|
19
|
+
{ open: "{", close: "}" },
|
|
20
|
+
{ open: "[", close: "]" },
|
|
21
|
+
{ open: "(", close: ")" },
|
|
22
|
+
{ open: '"', close: '"' },
|
|
23
|
+
{ open: "'", close: "'" }
|
|
24
|
+
]
|
|
25
|
+
}, o = {
|
|
26
|
+
defaultToken: "",
|
|
27
|
+
tokenPostfix: ".lua",
|
|
28
|
+
keywords: [
|
|
29
|
+
"and",
|
|
30
|
+
"break",
|
|
31
|
+
"do",
|
|
32
|
+
"else",
|
|
33
|
+
"elseif",
|
|
34
|
+
"end",
|
|
35
|
+
"false",
|
|
36
|
+
"for",
|
|
37
|
+
"function",
|
|
38
|
+
"goto",
|
|
39
|
+
"if",
|
|
40
|
+
"in",
|
|
41
|
+
"local",
|
|
42
|
+
"nil",
|
|
43
|
+
"not",
|
|
44
|
+
"or",
|
|
45
|
+
"repeat",
|
|
46
|
+
"return",
|
|
47
|
+
"then",
|
|
48
|
+
"true",
|
|
49
|
+
"until",
|
|
50
|
+
"while"
|
|
51
|
+
],
|
|
52
|
+
brackets: [
|
|
53
|
+
{ token: "delimiter.bracket", open: "{", close: "}" },
|
|
54
|
+
{ token: "delimiter.array", open: "[", close: "]" },
|
|
55
|
+
{ token: "delimiter.parenthesis", open: "(", close: ")" }
|
|
56
|
+
],
|
|
57
|
+
operators: [
|
|
58
|
+
"+",
|
|
59
|
+
"-",
|
|
60
|
+
"*",
|
|
61
|
+
"/",
|
|
62
|
+
"%",
|
|
63
|
+
"^",
|
|
64
|
+
"#",
|
|
65
|
+
"==",
|
|
66
|
+
"~=",
|
|
67
|
+
"<=",
|
|
68
|
+
">=",
|
|
69
|
+
"<",
|
|
70
|
+
">",
|
|
71
|
+
"=",
|
|
72
|
+
";",
|
|
73
|
+
":",
|
|
74
|
+
",",
|
|
75
|
+
".",
|
|
76
|
+
"..",
|
|
77
|
+
"..."
|
|
78
|
+
],
|
|
79
|
+
// we include these common regular expressions
|
|
80
|
+
symbols: /[=><!~?:&|+\-*\/\^%]+/,
|
|
81
|
+
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
|
|
82
|
+
// The main tokenizer for our languages
|
|
83
|
+
tokenizer: {
|
|
84
|
+
root: [
|
|
85
|
+
// identifiers and keywords
|
|
86
|
+
[
|
|
87
|
+
/[a-zA-Z_]\w*/,
|
|
88
|
+
{
|
|
89
|
+
cases: {
|
|
90
|
+
"@keywords": { token: "keyword.$0" },
|
|
91
|
+
"@default": "identifier"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
// whitespace
|
|
96
|
+
{ include: "@whitespace" },
|
|
97
|
+
// keys
|
|
98
|
+
[/(,)(\s*)([a-zA-Z_]\w*)(\s*)(:)(?!:)/, ["delimiter", "", "key", "", "delimiter"]],
|
|
99
|
+
[/({)(\s*)([a-zA-Z_]\w*)(\s*)(:)(?!:)/, ["@brackets", "", "key", "", "delimiter"]],
|
|
100
|
+
// delimiters and operators
|
|
101
|
+
[/[{}()\[\]]/, "@brackets"],
|
|
102
|
+
[
|
|
103
|
+
/@symbols/,
|
|
104
|
+
{
|
|
105
|
+
cases: {
|
|
106
|
+
"@operators": "delimiter",
|
|
107
|
+
"@default": ""
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
// numbers
|
|
112
|
+
[/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
|
|
113
|
+
[/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/, "number.hex"],
|
|
114
|
+
[/\d+?/, "number"],
|
|
115
|
+
// delimiter: after number because of .\d floats
|
|
116
|
+
[/[;,.]/, "delimiter"],
|
|
117
|
+
// strings: recover on non-terminated strings
|
|
118
|
+
[/"([^"\\]|\\.)*$/, "string.invalid"],
|
|
119
|
+
// non-teminated string
|
|
120
|
+
[/'([^'\\]|\\.)*$/, "string.invalid"],
|
|
121
|
+
// non-teminated string
|
|
122
|
+
[/"/, "string", '@string."'],
|
|
123
|
+
[/'/, "string", "@string.'"]
|
|
124
|
+
],
|
|
125
|
+
whitespace: [
|
|
126
|
+
[/[ \t\r\n]+/, ""],
|
|
127
|
+
[/--\[([=]*)\[/, "comment", "@comment.$1"],
|
|
128
|
+
[/--.*$/, "comment"]
|
|
129
|
+
],
|
|
130
|
+
comment: [
|
|
131
|
+
[/[^\]]+/, "comment"],
|
|
132
|
+
[
|
|
133
|
+
/\]([=]*)\]/,
|
|
134
|
+
{
|
|
135
|
+
cases: {
|
|
136
|
+
"$1==$S2": { token: "comment", next: "@pop" },
|
|
137
|
+
"@default": "comment"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
[/./, "comment"]
|
|
142
|
+
],
|
|
143
|
+
string: [
|
|
144
|
+
[/[^\\"']+/, "string"],
|
|
145
|
+
[/@escapes/, "string.escape"],
|
|
146
|
+
[/\\./, "string.escape.invalid"],
|
|
147
|
+
[
|
|
148
|
+
/["']/,
|
|
149
|
+
{
|
|
150
|
+
cases: {
|
|
151
|
+
"$#==$S2": { token: "string", next: "@pop" },
|
|
152
|
+
"@default": "string"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
export {
|
|
160
|
+
e as conf,
|
|
161
|
+
o as language
|
|
162
|
+
};
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
comments: {
|
|
3
|
+
blockComment: ["(*", "*)"]
|
|
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: "'", notIn: ["string", "comment"] },
|
|
17
|
+
{ open: '"', close: '"', notIn: ["string", "comment"] }
|
|
18
|
+
]
|
|
19
|
+
}, o = {
|
|
20
|
+
defaultToken: "",
|
|
21
|
+
tokenPostfix: ".m3",
|
|
22
|
+
brackets: [
|
|
23
|
+
{ token: "delimiter.curly", open: "{", close: "}" },
|
|
24
|
+
{ token: "delimiter.parenthesis", open: "(", close: ")" },
|
|
25
|
+
{ token: "delimiter.square", open: "[", close: "]" }
|
|
26
|
+
],
|
|
27
|
+
keywords: [
|
|
28
|
+
"AND",
|
|
29
|
+
"ANY",
|
|
30
|
+
"ARRAY",
|
|
31
|
+
"AS",
|
|
32
|
+
"BEGIN",
|
|
33
|
+
"BITS",
|
|
34
|
+
"BRANDED",
|
|
35
|
+
"BY",
|
|
36
|
+
"CASE",
|
|
37
|
+
"CONST",
|
|
38
|
+
"DIV",
|
|
39
|
+
"DO",
|
|
40
|
+
"ELSE",
|
|
41
|
+
"ELSIF",
|
|
42
|
+
"END",
|
|
43
|
+
"EVAL",
|
|
44
|
+
"EXCEPT",
|
|
45
|
+
"EXCEPTION",
|
|
46
|
+
"EXIT",
|
|
47
|
+
"EXPORTS",
|
|
48
|
+
"FINALLY",
|
|
49
|
+
"FOR",
|
|
50
|
+
"FROM",
|
|
51
|
+
"GENERIC",
|
|
52
|
+
"IF",
|
|
53
|
+
"IMPORT",
|
|
54
|
+
"IN",
|
|
55
|
+
"INTERFACE",
|
|
56
|
+
"LOCK",
|
|
57
|
+
"LOOP",
|
|
58
|
+
"METHODS",
|
|
59
|
+
"MOD",
|
|
60
|
+
"MODULE",
|
|
61
|
+
"NOT",
|
|
62
|
+
"OBJECT",
|
|
63
|
+
"OF",
|
|
64
|
+
"OR",
|
|
65
|
+
"OVERRIDES",
|
|
66
|
+
"PROCEDURE",
|
|
67
|
+
"RAISE",
|
|
68
|
+
"RAISES",
|
|
69
|
+
"READONLY",
|
|
70
|
+
"RECORD",
|
|
71
|
+
"REF",
|
|
72
|
+
"REPEAT",
|
|
73
|
+
"RETURN",
|
|
74
|
+
"REVEAL",
|
|
75
|
+
"SET",
|
|
76
|
+
"THEN",
|
|
77
|
+
"TO",
|
|
78
|
+
"TRY",
|
|
79
|
+
"TYPE",
|
|
80
|
+
"TYPECASE",
|
|
81
|
+
"UNSAFE",
|
|
82
|
+
"UNTIL",
|
|
83
|
+
"UNTRACED",
|
|
84
|
+
"VALUE",
|
|
85
|
+
"VAR",
|
|
86
|
+
"WHILE",
|
|
87
|
+
"WITH"
|
|
88
|
+
],
|
|
89
|
+
reservedConstNames: [
|
|
90
|
+
"ABS",
|
|
91
|
+
"ADR",
|
|
92
|
+
"ADRSIZE",
|
|
93
|
+
"BITSIZE",
|
|
94
|
+
"BYTESIZE",
|
|
95
|
+
"CEILING",
|
|
96
|
+
"DEC",
|
|
97
|
+
"DISPOSE",
|
|
98
|
+
"FALSE",
|
|
99
|
+
"FIRST",
|
|
100
|
+
"FLOAT",
|
|
101
|
+
"FLOOR",
|
|
102
|
+
"INC",
|
|
103
|
+
"ISTYPE",
|
|
104
|
+
"LAST",
|
|
105
|
+
"LOOPHOLE",
|
|
106
|
+
"MAX",
|
|
107
|
+
"MIN",
|
|
108
|
+
"NARROW",
|
|
109
|
+
"NEW",
|
|
110
|
+
"NIL",
|
|
111
|
+
"NUMBER",
|
|
112
|
+
"ORD",
|
|
113
|
+
"ROUND",
|
|
114
|
+
"SUBARRAY",
|
|
115
|
+
"TRUE",
|
|
116
|
+
"TRUNC",
|
|
117
|
+
"TYPECODE",
|
|
118
|
+
"VAL"
|
|
119
|
+
],
|
|
120
|
+
reservedTypeNames: [
|
|
121
|
+
"ADDRESS",
|
|
122
|
+
"ANY",
|
|
123
|
+
"BOOLEAN",
|
|
124
|
+
"CARDINAL",
|
|
125
|
+
"CHAR",
|
|
126
|
+
"EXTENDED",
|
|
127
|
+
"INTEGER",
|
|
128
|
+
"LONGCARD",
|
|
129
|
+
"LONGINT",
|
|
130
|
+
"LONGREAL",
|
|
131
|
+
"MUTEX",
|
|
132
|
+
"NULL",
|
|
133
|
+
"REAL",
|
|
134
|
+
"REFANY",
|
|
135
|
+
"ROOT",
|
|
136
|
+
"TEXT"
|
|
137
|
+
],
|
|
138
|
+
operators: ["+", "-", "*", "/", "&", "^", "."],
|
|
139
|
+
relations: ["=", "#", "<", "<=", ">", ">=", "<:", ":"],
|
|
140
|
+
delimiters: ["|", "..", "=>", ",", ";", ":="],
|
|
141
|
+
symbols: /[>=<#.,:;+\-*/&^]+/,
|
|
142
|
+
escapes: /\\(?:[\\fnrt"']|[0-7]{3})/,
|
|
143
|
+
tokenizer: {
|
|
144
|
+
root: [
|
|
145
|
+
// Identifiers and keywords
|
|
146
|
+
[/_\w*/, "invalid"],
|
|
147
|
+
[
|
|
148
|
+
/[a-zA-Z][a-zA-Z0-9_]*/,
|
|
149
|
+
{
|
|
150
|
+
cases: {
|
|
151
|
+
"@keywords": { token: "keyword.$0" },
|
|
152
|
+
"@reservedConstNames": { token: "constant.reserved.$0" },
|
|
153
|
+
"@reservedTypeNames": { token: "type.reserved.$0" },
|
|
154
|
+
"@default": "identifier"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
// Whitespace
|
|
159
|
+
{ include: "@whitespace" },
|
|
160
|
+
[/[{}()\[\]]/, "@brackets"],
|
|
161
|
+
// Integer- and real literals
|
|
162
|
+
[/[0-9]+\.[0-9]+(?:[DdEeXx][\+\-]?[0-9]+)?/, "number.float"],
|
|
163
|
+
[/[0-9]+(?:\_[0-9a-fA-F]+)?L?/, "number"],
|
|
164
|
+
// Operators, relations, and delimiters
|
|
165
|
+
[
|
|
166
|
+
/@symbols/,
|
|
167
|
+
{
|
|
168
|
+
cases: {
|
|
169
|
+
"@operators": "operators",
|
|
170
|
+
"@relations": "operators",
|
|
171
|
+
"@delimiters": "delimiter",
|
|
172
|
+
"@default": "invalid"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
// Character literals
|
|
177
|
+
[/'[^\\']'/, "string.char"],
|
|
178
|
+
[/(')(@escapes)(')/, ["string.char", "string.escape", "string.char"]],
|
|
179
|
+
[/'/, "invalid"],
|
|
180
|
+
// Text literals
|
|
181
|
+
[/"([^"\\]|\\.)*$/, "invalid"],
|
|
182
|
+
[/"/, "string.text", "@text"]
|
|
183
|
+
],
|
|
184
|
+
text: [
|
|
185
|
+
[/[^\\"]+/, "string.text"],
|
|
186
|
+
[/@escapes/, "string.escape"],
|
|
187
|
+
[/\\./, "invalid"],
|
|
188
|
+
[/"/, "string.text", "@pop"]
|
|
189
|
+
],
|
|
190
|
+
comment: [
|
|
191
|
+
[/\(\*/, "comment", "@push"],
|
|
192
|
+
[/\*\)/, "comment", "@pop"],
|
|
193
|
+
[/./, "comment"]
|
|
194
|
+
],
|
|
195
|
+
pragma: [
|
|
196
|
+
[/<\*/, "keyword.pragma", "@push"],
|
|
197
|
+
[/\*>/, "keyword.pragma", "@pop"],
|
|
198
|
+
[/./, "keyword.pragma"]
|
|
199
|
+
],
|
|
200
|
+
whitespace: [
|
|
201
|
+
[/[ \t\r\n]+/, "white"],
|
|
202
|
+
[/\(\*/, "comment", "@comment"],
|
|
203
|
+
[/<\*/, "keyword.pragma", "@pragma"]
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
export {
|
|
208
|
+
e as conf,
|
|
209
|
+
o as language
|
|
210
|
+
};
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
comments: {
|
|
3
|
+
blockComment: ["<!--", "-->"]
|
|
4
|
+
},
|
|
5
|
+
brackets: [
|
|
6
|
+
["{", "}"],
|
|
7
|
+
["[", "]"],
|
|
8
|
+
["(", ")"]
|
|
9
|
+
],
|
|
10
|
+
autoClosingPairs: [
|
|
11
|
+
{ open: "{", close: "}" },
|
|
12
|
+
{ open: "[", close: "]" },
|
|
13
|
+
{ open: "(", close: ")" },
|
|
14
|
+
{ open: "<", close: ">", notIn: ["string"] }
|
|
15
|
+
],
|
|
16
|
+
surroundingPairs: [
|
|
17
|
+
{ open: "(", close: ")" },
|
|
18
|
+
{ open: "[", close: "]" },
|
|
19
|
+
{ open: "`", close: "`" }
|
|
20
|
+
],
|
|
21
|
+
folding: {
|
|
22
|
+
markers: {
|
|
23
|
+
start: new RegExp("^\\s*<!--\\s*#?region\\b.*-->"),
|
|
24
|
+
end: new RegExp("^\\s*<!--\\s*#?endregion\\b.*-->")
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}, t = {
|
|
28
|
+
defaultToken: "",
|
|
29
|
+
tokenPostfix: ".md",
|
|
30
|
+
// escape codes
|
|
31
|
+
control: /[\\`*_\[\]{}()#+\-\.!]/,
|
|
32
|
+
noncontrol: /[^\\`*_\[\]{}()#+\-\.!]/,
|
|
33
|
+
escapes: /\\(?:@control)/,
|
|
34
|
+
// escape codes for javascript/CSS strings
|
|
35
|
+
jsescapes: /\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,
|
|
36
|
+
// non matched elements
|
|
37
|
+
empty: [
|
|
38
|
+
"area",
|
|
39
|
+
"base",
|
|
40
|
+
"basefont",
|
|
41
|
+
"br",
|
|
42
|
+
"col",
|
|
43
|
+
"frame",
|
|
44
|
+
"hr",
|
|
45
|
+
"img",
|
|
46
|
+
"input",
|
|
47
|
+
"isindex",
|
|
48
|
+
"link",
|
|
49
|
+
"meta",
|
|
50
|
+
"param"
|
|
51
|
+
],
|
|
52
|
+
tokenizer: {
|
|
53
|
+
root: [
|
|
54
|
+
// markdown tables
|
|
55
|
+
[/^\s*\|/, "@rematch", "@table_header"],
|
|
56
|
+
// headers (with #)
|
|
57
|
+
[/^(\s{0,3})(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/, ["white", "keyword", "keyword", "keyword"]],
|
|
58
|
+
// headers (with =)
|
|
59
|
+
[/^\s*(=+|\-+)\s*$/, "keyword"],
|
|
60
|
+
// headers (with ***)
|
|
61
|
+
[/^\s*((\*[ ]?)+)\s*$/, "meta.separator"],
|
|
62
|
+
// quote
|
|
63
|
+
[/^\s*>+/, "comment"],
|
|
64
|
+
// list (starting with * or number)
|
|
65
|
+
[/^\s*([\*\-+:]|\d+\.)\s/, "keyword"],
|
|
66
|
+
// code block (4 spaces indent)
|
|
67
|
+
[/^(\t|[ ]{4})[^ ].*$/, "string"],
|
|
68
|
+
// code block (3 tilde)
|
|
69
|
+
[/^\s*~~~\s*((?:\w|[\/\-#])+)?\s*$/, { token: "string", next: "@codeblock" }],
|
|
70
|
+
// github style code blocks (with backticks and language)
|
|
71
|
+
[
|
|
72
|
+
/^\s*```\s*((?:\w|[\/\-#])+).*$/,
|
|
73
|
+
{ token: "string", next: "@codeblockgh", nextEmbedded: "$1" }
|
|
74
|
+
],
|
|
75
|
+
// github style code blocks (with backticks but no language)
|
|
76
|
+
[/^\s*```\s*$/, { token: "string", next: "@codeblock" }],
|
|
77
|
+
// markup within lines
|
|
78
|
+
{ include: "@linecontent" }
|
|
79
|
+
],
|
|
80
|
+
table_header: [
|
|
81
|
+
{ include: "@table_common" },
|
|
82
|
+
[/[^\|]+/, "keyword.table.header"]
|
|
83
|
+
// table header
|
|
84
|
+
],
|
|
85
|
+
table_body: [{ include: "@table_common" }, { include: "@linecontent" }],
|
|
86
|
+
table_common: [
|
|
87
|
+
[/\s*[\-:]+\s*/, { token: "keyword", switchTo: "table_body" }],
|
|
88
|
+
// header-divider
|
|
89
|
+
[/^\s*\|/, "keyword.table.left"],
|
|
90
|
+
// opening |
|
|
91
|
+
[/^\s*[^\|]/, "@rematch", "@pop"],
|
|
92
|
+
// exiting
|
|
93
|
+
[/^\s*$/, "@rematch", "@pop"],
|
|
94
|
+
// exiting
|
|
95
|
+
[
|
|
96
|
+
/\|/,
|
|
97
|
+
{
|
|
98
|
+
cases: {
|
|
99
|
+
"@eos": "keyword.table.right",
|
|
100
|
+
// closing |
|
|
101
|
+
"@default": "keyword.table.middle"
|
|
102
|
+
// inner |
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
],
|
|
107
|
+
codeblock: [
|
|
108
|
+
[/^\s*~~~\s*$/, { token: "string", next: "@pop" }],
|
|
109
|
+
[/^\s*```\s*$/, { token: "string", next: "@pop" }],
|
|
110
|
+
[/.*$/, "variable.source"]
|
|
111
|
+
],
|
|
112
|
+
// github style code blocks
|
|
113
|
+
codeblockgh: [
|
|
114
|
+
[/```\s*$/, { token: "string", next: "@pop", nextEmbedded: "@pop" }],
|
|
115
|
+
[/[^`]+/, "variable.source"]
|
|
116
|
+
],
|
|
117
|
+
linecontent: [
|
|
118
|
+
// escapes
|
|
119
|
+
[/&\w+;/, "string.escape"],
|
|
120
|
+
[/@escapes/, "escape"],
|
|
121
|
+
// various markup
|
|
122
|
+
[/\b__([^\\_]|@escapes|_(?!_))+__\b/, "strong"],
|
|
123
|
+
[/\*\*([^\\*]|@escapes|\*(?!\*))+\*\*/, "strong"],
|
|
124
|
+
[/\b_[^_]+_\b/, "emphasis"],
|
|
125
|
+
[/\*([^\\*]|@escapes)+\*/, "emphasis"],
|
|
126
|
+
[/`([^\\`]|@escapes)+`/, "variable"],
|
|
127
|
+
// links
|
|
128
|
+
[/\{+[^}]+\}+/, "string.target"],
|
|
129
|
+
[/(!?\[)((?:[^\]\\]|@escapes)*)(\]\([^\)]+\))/, ["string.link", "", "string.link"]],
|
|
130
|
+
[/(!?\[)((?:[^\]\\]|@escapes)*)(\])/, "string.link"],
|
|
131
|
+
// or html
|
|
132
|
+
{ include: "html" }
|
|
133
|
+
],
|
|
134
|
+
// Note: it is tempting to rather switch to the real HTML mode instead of building our own here
|
|
135
|
+
// but currently there is a limitation in Monarch that prevents us from doing it: The opening
|
|
136
|
+
// '<' would start the HTML mode, however there is no way to jump 1 character back to let the
|
|
137
|
+
// HTML mode also tokenize the opening angle bracket. Thus, even though we could jump to HTML,
|
|
138
|
+
// we cannot correctly tokenize it in that mode yet.
|
|
139
|
+
html: [
|
|
140
|
+
// html tags
|
|
141
|
+
[/<(\w+)\/>/, "tag"],
|
|
142
|
+
[
|
|
143
|
+
/<(\w+)(\-|\w)*/,
|
|
144
|
+
{
|
|
145
|
+
cases: {
|
|
146
|
+
"@empty": { token: "tag", next: "@tag.$1" },
|
|
147
|
+
"@default": { token: "tag", next: "@tag.$1" }
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
[/<\/(\w+)(\-|\w)*\s*>/, { token: "tag" }],
|
|
152
|
+
[/<!--/, "comment", "@comment"]
|
|
153
|
+
],
|
|
154
|
+
comment: [
|
|
155
|
+
[/[^<\-]+/, "comment.content"],
|
|
156
|
+
[/-->/, "comment", "@pop"],
|
|
157
|
+
[/<!--/, "comment.content.invalid"],
|
|
158
|
+
[/[<\-]/, "comment.content"]
|
|
159
|
+
],
|
|
160
|
+
// Almost full HTML tag matching, complete with embedded scripts & styles
|
|
161
|
+
tag: [
|
|
162
|
+
[/[ \t\r\n]+/, "white"],
|
|
163
|
+
[
|
|
164
|
+
/(type)(\s*=\s*)(")([^"]+)(")/,
|
|
165
|
+
[
|
|
166
|
+
"attribute.name.html",
|
|
167
|
+
"delimiter.html",
|
|
168
|
+
"string.html",
|
|
169
|
+
{ token: "string.html", switchTo: "@tag.$S2.$4" },
|
|
170
|
+
"string.html"
|
|
171
|
+
]
|
|
172
|
+
],
|
|
173
|
+
[
|
|
174
|
+
/(type)(\s*=\s*)(')([^']+)(')/,
|
|
175
|
+
[
|
|
176
|
+
"attribute.name.html",
|
|
177
|
+
"delimiter.html",
|
|
178
|
+
"string.html",
|
|
179
|
+
{ token: "string.html", switchTo: "@tag.$S2.$4" },
|
|
180
|
+
"string.html"
|
|
181
|
+
]
|
|
182
|
+
],
|
|
183
|
+
[/(\w+)(\s*=\s*)("[^"]*"|'[^']*')/, ["attribute.name.html", "delimiter.html", "string.html"]],
|
|
184
|
+
[/\w+/, "attribute.name.html"],
|
|
185
|
+
[/\/>/, "tag", "@pop"],
|
|
186
|
+
[
|
|
187
|
+
/>/,
|
|
188
|
+
{
|
|
189
|
+
cases: {
|
|
190
|
+
"$S2==style": {
|
|
191
|
+
token: "tag",
|
|
192
|
+
switchTo: "embeddedStyle",
|
|
193
|
+
nextEmbedded: "text/css"
|
|
194
|
+
},
|
|
195
|
+
"$S2==script": {
|
|
196
|
+
cases: {
|
|
197
|
+
$S3: {
|
|
198
|
+
token: "tag",
|
|
199
|
+
switchTo: "embeddedScript",
|
|
200
|
+
nextEmbedded: "$S3"
|
|
201
|
+
},
|
|
202
|
+
"@default": {
|
|
203
|
+
token: "tag",
|
|
204
|
+
switchTo: "embeddedScript",
|
|
205
|
+
nextEmbedded: "text/javascript"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"@default": { token: "tag", next: "@pop" }
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
]
|
|
213
|
+
],
|
|
214
|
+
embeddedStyle: [
|
|
215
|
+
[/[^<]+/, ""],
|
|
216
|
+
[/<\/style\s*>/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
|
|
217
|
+
[/</, ""]
|
|
218
|
+
],
|
|
219
|
+
embeddedScript: [
|
|
220
|
+
[/[^<]+/, ""],
|
|
221
|
+
[/<\/script\s*>/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
|
|
222
|
+
[/</, ""]
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
export {
|
|
227
|
+
e as conf,
|
|
228
|
+
t as language
|
|
229
|
+
};
|