@tuoyuan/code-editor 1.0.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/README.md +505 -0
- package/dist/CodeEditor.vue.d.ts +335 -0
- package/dist/abap-Ck4GwL0j.js +1404 -0
- package/dist/abap-Dm-grL-k.cjs +6 -0
- package/dist/apex-BcgYgERc.cjs +6 -0
- package/dist/apex-ODA7HKAJ.js +332 -0
- package/dist/azcli-CTIyen0u.cjs +6 -0
- package/dist/azcli-Cb6cb8s9.js +74 -0
- package/dist/bat-DNcko697.cjs +6 -0
- package/dist/bat-DTzY2NZq.js +106 -0
- package/dist/bicep-BMFU7f1t.js +108 -0
- package/dist/bicep-CaTas9h4.cjs +7 -0
- package/dist/cameligo-CI3fenw2.cjs +6 -0
- package/dist/cameligo-NLSSnjLV.js +180 -0
- package/dist/clojure-BGGaGC_c.cjs +6 -0
- package/dist/clojure-Du0upEOV.js +767 -0
- package/dist/coffee-ClJtyy1o.cjs +6 -0
- package/dist/coffee-v4uQlkM7.js +238 -0
- package/dist/cpp-C8lRvf76.cjs +6 -0
- package/dist/cpp-D8cWT5D_.js +395 -0
- package/dist/csharp-Czug7i7m.js +332 -0
- package/dist/csharp-DWhydAB-.cjs +6 -0
- package/dist/csp-BWvo8sOh.cjs +6 -0
- package/dist/csp-C8fx6eO8.js +59 -0
- package/dist/css-BpNIi06k.js +193 -0
- package/dist/css-CFi1nolN.cjs +8 -0
- package/dist/cssMode-BfZeZ0sl.js +1577 -0
- package/dist/cssMode-CroponXs.cjs +9 -0
- package/dist/cypher-C17znEzs.js +269 -0
- package/dist/cypher-CeoUqDHe.cjs +6 -0
- package/dist/dart-BmDOWGHn.cjs +6 -0
- package/dist/dart-CYyrqmCr.js +287 -0
- package/dist/dockerfile-BQUsBUh7.js +136 -0
- package/dist/dockerfile-CughGaD6.cjs +6 -0
- package/dist/ecl-BDDxLC55.cjs +6 -0
- package/dist/ecl-CJB68izO.js +462 -0
- package/dist/elixir-BPaYnkX2.cjs +6 -0
- package/dist/elixir-DljgmHqx.js +575 -0
- package/dist/flow9-0BfLJTIY.js +148 -0
- package/dist/flow9-BYsSavfX.cjs +6 -0
- package/dist/formatter.d.ts +16 -0
- package/dist/freemarker2-CpMdvAfd.cjs +8 -0
- package/dist/freemarker2-DVRVJu0B.js +995 -0
- package/dist/fsharp-SmZEcjiu.cjs +6 -0
- package/dist/fsharp-lmsaS1LJ.js +223 -0
- package/dist/go-Tv83ayL9.js +224 -0
- package/dist/go-xVW5xrOi.cjs +6 -0
- package/dist/graphql-BH1G4Uv8.js +157 -0
- package/dist/graphql-BaJ0LkdR.cjs +6 -0
- package/dist/handlebars-8AMUT0_r.cjs +6 -0
- package/dist/handlebars-cspegSxe.js +425 -0
- package/dist/hcl-9tXVo0Oo.js +189 -0
- package/dist/hcl-BTIq68i_.cjs +6 -0
- package/dist/html-Bvlf1Z20.cjs +6 -0
- package/dist/html-zabMn0fr.js +314 -0
- package/dist/htmlMode-B3y58LIC.cjs +9 -0
- package/dist/htmlMode-jXZ-OnTX.js +1587 -0
- package/dist/index-BvnET_j2.js +132407 -0
- package/dist/index-CjGIE44E.cjs +1197 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +5 -0
- package/dist/ini-CJdCU2Im.cjs +6 -0
- package/dist/ini-DZX3aW6M.js +77 -0
- package/dist/java-Day25zBa.cjs +6 -0
- package/dist/java-Q9NjwWso.js +238 -0
- package/dist/javascript-BF91TgD3.js +76 -0
- package/dist/javascript-QgWqIxzo.cjs +6 -0
- package/dist/jsonMode-Chpjh-RM.cjs +15 -0
- package/dist/jsonMode-DD3uMliY.js +2002 -0
- package/dist/julia-BqwBsF5P.cjs +6 -0
- package/dist/julia-QQBeypPo.js +517 -0
- package/dist/kotlin-2AnhId0p.js +259 -0
- package/dist/kotlin-B4u9iQDL.cjs +6 -0
- package/dist/less-CWxTTuX7.cjs +7 -0
- package/dist/less-Daawp9Qu.js +168 -0
- package/dist/lexon-B1xVKv1m.cjs +6 -0
- package/dist/lexon-CqxA-4g1.js +163 -0
- package/dist/liquid-CsQKIvsE.cjs +6 -0
- package/dist/liquid-DxypC1q6.js +246 -0
- package/dist/lua-C9DR8JqQ.js +168 -0
- package/dist/lua-GQ1AlIpR.cjs +6 -0
- package/dist/m3-ChnU6a_2.cjs +6 -0
- package/dist/m3-ChoO2Aeo.js +216 -0
- package/dist/markdown-vGe7N__p.js +235 -0
- package/dist/markdown-yRKnCzup.cjs +6 -0
- package/dist/mdx-BvsKvd6j.cjs +6 -0
- package/dist/mdx-DZRrNJcb.js +171 -0
- package/dist/mips-B35Tctk9.js +204 -0
- package/dist/mips-DE1-KCxg.cjs +6 -0
- package/dist/monaco-worker.d.ts +2 -0
- package/dist/msdax-CKduWRE-.js +381 -0
- package/dist/msdax-D0cml5wZ.cjs +6 -0
- package/dist/mysql-D4V3ltpC.js +884 -0
- package/dist/mysql-DLWkbGoZ.cjs +6 -0
- package/dist/objective-c-CaS419yz.js +189 -0
- package/dist/objective-c-aq90HTjV.cjs +6 -0
- package/dist/pascal-CzzqMa-q.js +257 -0
- package/dist/pascal-Tx_vZ5dG.cjs +6 -0
- package/dist/pascaligo-DPbJfhBm.js +170 -0
- package/dist/pascaligo-D_Ri2CTv.cjs +6 -0
- package/dist/perl-CswrnJgZ.cjs +6 -0
- package/dist/perl-DiakDHGa.js +632 -0
- package/dist/pgsql-CCS271_e.cjs +6 -0
- package/dist/pgsql-FgzHGfbe.js +857 -0
- package/dist/php-BtenrrrR.cjs +6 -0
- package/dist/php-DeEgUIDo.js +506 -0
- package/dist/pla-BtA__bSx.js +143 -0
- package/dist/pla-DqtRVxAK.cjs +6 -0
- package/dist/postiats-CDpKZOjz.js +913 -0
- package/dist/postiats-CMjeSPtv.cjs +6 -0
- package/dist/powerquery-C4wMFtve.js +896 -0
- package/dist/powerquery-DMrlf6nl.cjs +6 -0
- package/dist/powershell-BIXcUAIq.js +245 -0
- package/dist/powershell-BzvWvXBW.cjs +6 -0
- package/dist/protobuf-BHrBiKx5.js +426 -0
- package/dist/protobuf-BkfVMs3q.cjs +7 -0
- package/dist/pug-BgHHt25K.cjs +6 -0
- package/dist/pug-D_c6Bxex.js +408 -0
- package/dist/python-CDI0D2Kf.cjs +6 -0
- package/dist/python-CXOcTmBp.js +307 -0
- package/dist/qsharp-BS_wm4zq.cjs +6 -0
- package/dist/qsharp-Bmp6Uoth.js +291 -0
- package/dist/r-Cw-pZRR6.js +249 -0
- package/dist/r-XsO4bdi0.cjs +6 -0
- package/dist/razor-CAIWGDkN.cjs +6 -0
- package/dist/razor-Do5Lpn1p.js +556 -0
- package/dist/redis-D5elYsZS.cjs +6 -0
- package/dist/redis-DSkWtKTU.js +308 -0
- package/dist/redshift-BrAReR9w.cjs +6 -0
- package/dist/redshift-G3V-UH7H.js +815 -0
- package/dist/restructuredtext-C3HS0Vuf.js +180 -0
- package/dist/restructuredtext-CzNfc37y.cjs +6 -0
- package/dist/ruby-CFRrX6F7.cjs +6 -0
- package/dist/ruby-DdxOY_t-.js +517 -0
- package/dist/rust-BgYTY-pT.cjs +6 -0
- package/dist/rust-CHLNe-uh.js +349 -0
- package/dist/sb-DjdwHjNi.cjs +6 -0
- package/dist/sb-VgZvRVjv.js +121 -0
- package/dist/scala-BEo281v6.js +376 -0
- package/dist/scala-C9e5dt2E.cjs +6 -0
- package/dist/scheme-BPzKEKRg.cjs +6 -0
- package/dist/scheme-BwtlTEx9.js +114 -0
- package/dist/scss-B_KRI23k.cjs +8 -0
- package/dist/scss-DNHJcE5b.js +268 -0
- package/dist/shell-961u9U9E.cjs +6 -0
- package/dist/shell-CYXbUHt6.js +227 -0
- package/dist/solidity-B94td9D0.js +1373 -0
- package/dist/solidity-DyAQZQb-.cjs +6 -0
- package/dist/sophia-C67C1dNJ.cjs +6 -0
- package/dist/sophia-CgOMMImk.js +205 -0
- package/dist/sparql-CmRbqkGW.js +207 -0
- package/dist/sparql-DTHixtMm.cjs +6 -0
- package/dist/sql-CX8rIh5F.cjs +6 -0
- package/dist/sql-DVsVTphc.js +859 -0
- package/dist/st-ATFa4Vu3.js +422 -0
- package/dist/st-CBQkFfzG.cjs +6 -0
- package/dist/style.css +1 -0
- package/dist/swift-K4rp2L0u.js +318 -0
- package/dist/swift-XvmCMD7s.cjs +8 -0
- package/dist/systemverilog-D0lDJRC5.cjs +6 -0
- package/dist/systemverilog-YgLuECrg.js +582 -0
- package/dist/tcl-BHcJGOmo.js +238 -0
- package/dist/tcl-Ju0vlxf3.cjs +6 -0
- package/dist/tsMode-D7bHvHeH.cjs +16 -0
- package/dist/tsMode-DiYbk3vf.js +895 -0
- package/dist/twig-B1JhL8Uy.cjs +6 -0
- package/dist/twig-sVb_x968.js +398 -0
- package/dist/types.d.ts +16 -0
- package/dist/typescript-CI6w3N2S.cjs +6 -0
- package/dist/typescript-DFdjl8Xj.js +349 -0
- package/dist/typespec-BSdcQAUL.js +123 -0
- package/dist/typespec-u6UGyzVa.cjs +6 -0
- package/dist/vb-BZywMj6s.js +378 -0
- package/dist/vb-CB1voSvV.cjs +6 -0
- package/dist/wgsl-eG2bS915.js +445 -0
- package/dist/wgsl-eXQZam6Q.cjs +303 -0
- package/dist/xml-CJndgX4z.js +101 -0
- package/dist/xml-CO5xAOVk.cjs +6 -0
- package/dist/yaml--krIkoJ8.js +212 -0
- package/dist/yaml-BYk2IWKs.cjs +6 -0
- package/package.json +73 -0
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { m as o } from "./index-BvnET_j2.js";
|
|
2
|
+
/*!-----------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
|
|
5
|
+
* Released under the MIT license
|
|
6
|
+
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
7
|
+
*-----------------------------------------------------------------------------*/
|
|
8
|
+
var a = Object.defineProperty, l = Object.getOwnPropertyDescriptor, p = Object.getOwnPropertyNames, c = Object.prototype.hasOwnProperty, g = (t, e, n, s) => {
|
|
9
|
+
if (e && typeof e == "object" || typeof e == "function")
|
|
10
|
+
for (let r of p(e))
|
|
11
|
+
!c.call(t, r) && r !== n && a(t, r, { get: () => e[r], enumerable: !(s = l(e, r)) || s.enumerable });
|
|
12
|
+
return t;
|
|
13
|
+
}, d = (t, e, n) => (g(t, e, "default"), n), i = {};
|
|
14
|
+
d(i, o);
|
|
15
|
+
var m = {
|
|
16
|
+
comments: {
|
|
17
|
+
lineComment: "#",
|
|
18
|
+
blockComment: ["'''", "'''"]
|
|
19
|
+
},
|
|
20
|
+
brackets: [
|
|
21
|
+
["{", "}"],
|
|
22
|
+
["[", "]"],
|
|
23
|
+
["(", ")"]
|
|
24
|
+
],
|
|
25
|
+
autoClosingPairs: [
|
|
26
|
+
{ open: "{", close: "}" },
|
|
27
|
+
{ open: "[", close: "]" },
|
|
28
|
+
{ open: "(", close: ")" },
|
|
29
|
+
{ open: '"', close: '"', notIn: ["string"] },
|
|
30
|
+
{ open: "'", close: "'", notIn: ["string", "comment"] }
|
|
31
|
+
],
|
|
32
|
+
surroundingPairs: [
|
|
33
|
+
{ open: "{", close: "}" },
|
|
34
|
+
{ open: "[", close: "]" },
|
|
35
|
+
{ open: "(", close: ")" },
|
|
36
|
+
{ open: '"', close: '"' },
|
|
37
|
+
{ open: "'", close: "'" }
|
|
38
|
+
],
|
|
39
|
+
onEnterRules: [
|
|
40
|
+
{
|
|
41
|
+
beforeText: new RegExp(
|
|
42
|
+
"^\\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async|match|case).*?:\\s*$"
|
|
43
|
+
),
|
|
44
|
+
action: { indentAction: i.languages.IndentAction.Indent }
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
folding: {
|
|
48
|
+
offSide: !0,
|
|
49
|
+
markers: {
|
|
50
|
+
start: new RegExp("^\\s*#region\\b"),
|
|
51
|
+
end: new RegExp("^\\s*#endregion\\b")
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}, f = {
|
|
55
|
+
defaultToken: "",
|
|
56
|
+
tokenPostfix: ".python",
|
|
57
|
+
keywords: [
|
|
58
|
+
// This section is the result of running
|
|
59
|
+
// `import keyword; for k in sorted(keyword.kwlist + keyword.softkwlist): print(" '" + k + "',")`
|
|
60
|
+
// in a Python REPL,
|
|
61
|
+
// though note that the output from Python 3 is not a strict superset of the
|
|
62
|
+
// output from Python 2.
|
|
63
|
+
"False",
|
|
64
|
+
// promoted to keyword.kwlist in Python 3
|
|
65
|
+
"None",
|
|
66
|
+
// promoted to keyword.kwlist in Python 3
|
|
67
|
+
"True",
|
|
68
|
+
// promoted to keyword.kwlist in Python 3
|
|
69
|
+
"_",
|
|
70
|
+
// new in Python 3.10
|
|
71
|
+
"and",
|
|
72
|
+
"as",
|
|
73
|
+
"assert",
|
|
74
|
+
"async",
|
|
75
|
+
// new in Python 3
|
|
76
|
+
"await",
|
|
77
|
+
// new in Python 3
|
|
78
|
+
"break",
|
|
79
|
+
"case",
|
|
80
|
+
// new in Python 3.10
|
|
81
|
+
"class",
|
|
82
|
+
"continue",
|
|
83
|
+
"def",
|
|
84
|
+
"del",
|
|
85
|
+
"elif",
|
|
86
|
+
"else",
|
|
87
|
+
"except",
|
|
88
|
+
"exec",
|
|
89
|
+
// Python 2, but not 3.
|
|
90
|
+
"finally",
|
|
91
|
+
"for",
|
|
92
|
+
"from",
|
|
93
|
+
"global",
|
|
94
|
+
"if",
|
|
95
|
+
"import",
|
|
96
|
+
"in",
|
|
97
|
+
"is",
|
|
98
|
+
"lambda",
|
|
99
|
+
"match",
|
|
100
|
+
// new in Python 3.10
|
|
101
|
+
"nonlocal",
|
|
102
|
+
// new in Python 3
|
|
103
|
+
"not",
|
|
104
|
+
"or",
|
|
105
|
+
"pass",
|
|
106
|
+
"print",
|
|
107
|
+
// Python 2, but not 3.
|
|
108
|
+
"raise",
|
|
109
|
+
"return",
|
|
110
|
+
"try",
|
|
111
|
+
"type",
|
|
112
|
+
// new in Python 3.12
|
|
113
|
+
"while",
|
|
114
|
+
"with",
|
|
115
|
+
"yield",
|
|
116
|
+
"int",
|
|
117
|
+
"float",
|
|
118
|
+
"long",
|
|
119
|
+
"complex",
|
|
120
|
+
"hex",
|
|
121
|
+
"abs",
|
|
122
|
+
"all",
|
|
123
|
+
"any",
|
|
124
|
+
"apply",
|
|
125
|
+
"basestring",
|
|
126
|
+
"bin",
|
|
127
|
+
"bool",
|
|
128
|
+
"buffer",
|
|
129
|
+
"bytearray",
|
|
130
|
+
"callable",
|
|
131
|
+
"chr",
|
|
132
|
+
"classmethod",
|
|
133
|
+
"cmp",
|
|
134
|
+
"coerce",
|
|
135
|
+
"compile",
|
|
136
|
+
"complex",
|
|
137
|
+
"delattr",
|
|
138
|
+
"dict",
|
|
139
|
+
"dir",
|
|
140
|
+
"divmod",
|
|
141
|
+
"enumerate",
|
|
142
|
+
"eval",
|
|
143
|
+
"execfile",
|
|
144
|
+
"file",
|
|
145
|
+
"filter",
|
|
146
|
+
"format",
|
|
147
|
+
"frozenset",
|
|
148
|
+
"getattr",
|
|
149
|
+
"globals",
|
|
150
|
+
"hasattr",
|
|
151
|
+
"hash",
|
|
152
|
+
"help",
|
|
153
|
+
"id",
|
|
154
|
+
"input",
|
|
155
|
+
"intern",
|
|
156
|
+
"isinstance",
|
|
157
|
+
"issubclass",
|
|
158
|
+
"iter",
|
|
159
|
+
"len",
|
|
160
|
+
"locals",
|
|
161
|
+
"list",
|
|
162
|
+
"map",
|
|
163
|
+
"max",
|
|
164
|
+
"memoryview",
|
|
165
|
+
"min",
|
|
166
|
+
"next",
|
|
167
|
+
"object",
|
|
168
|
+
"oct",
|
|
169
|
+
"open",
|
|
170
|
+
"ord",
|
|
171
|
+
"pow",
|
|
172
|
+
"print",
|
|
173
|
+
"property",
|
|
174
|
+
"reversed",
|
|
175
|
+
"range",
|
|
176
|
+
"raw_input",
|
|
177
|
+
"reduce",
|
|
178
|
+
"reload",
|
|
179
|
+
"repr",
|
|
180
|
+
"reversed",
|
|
181
|
+
"round",
|
|
182
|
+
"self",
|
|
183
|
+
"set",
|
|
184
|
+
"setattr",
|
|
185
|
+
"slice",
|
|
186
|
+
"sorted",
|
|
187
|
+
"staticmethod",
|
|
188
|
+
"str",
|
|
189
|
+
"sum",
|
|
190
|
+
"super",
|
|
191
|
+
"tuple",
|
|
192
|
+
"type",
|
|
193
|
+
"unichr",
|
|
194
|
+
"unicode",
|
|
195
|
+
"vars",
|
|
196
|
+
"xrange",
|
|
197
|
+
"zip",
|
|
198
|
+
"__dict__",
|
|
199
|
+
"__methods__",
|
|
200
|
+
"__members__",
|
|
201
|
+
"__class__",
|
|
202
|
+
"__bases__",
|
|
203
|
+
"__name__",
|
|
204
|
+
"__mro__",
|
|
205
|
+
"__subclasses__",
|
|
206
|
+
"__init__",
|
|
207
|
+
"__import__"
|
|
208
|
+
],
|
|
209
|
+
brackets: [
|
|
210
|
+
{ open: "{", close: "}", token: "delimiter.curly" },
|
|
211
|
+
{ open: "[", close: "]", token: "delimiter.bracket" },
|
|
212
|
+
{ open: "(", close: ")", token: "delimiter.parenthesis" }
|
|
213
|
+
],
|
|
214
|
+
tokenizer: {
|
|
215
|
+
root: [
|
|
216
|
+
{ include: "@whitespace" },
|
|
217
|
+
{ include: "@numbers" },
|
|
218
|
+
{ include: "@strings" },
|
|
219
|
+
[/[,:;]/, "delimiter"],
|
|
220
|
+
[/[{}\[\]()]/, "@brackets"],
|
|
221
|
+
[/@[a-zA-Z_]\w*/, "tag"],
|
|
222
|
+
[
|
|
223
|
+
/[a-zA-Z_]\w*/,
|
|
224
|
+
{
|
|
225
|
+
cases: {
|
|
226
|
+
"@keywords": "keyword",
|
|
227
|
+
"@default": "identifier"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
]
|
|
231
|
+
],
|
|
232
|
+
// Deal with white space, including single and multi-line comments
|
|
233
|
+
whitespace: [
|
|
234
|
+
[/\s+/, "white"],
|
|
235
|
+
[/(^#.*$)/, "comment"],
|
|
236
|
+
[/'''/, "string", "@endDocString"],
|
|
237
|
+
[/"""/, "string", "@endDblDocString"]
|
|
238
|
+
],
|
|
239
|
+
endDocString: [
|
|
240
|
+
[/[^']+/, "string"],
|
|
241
|
+
[/\\'/, "string"],
|
|
242
|
+
[/'''/, "string", "@popall"],
|
|
243
|
+
[/'/, "string"]
|
|
244
|
+
],
|
|
245
|
+
endDblDocString: [
|
|
246
|
+
[/[^"]+/, "string"],
|
|
247
|
+
[/\\"/, "string"],
|
|
248
|
+
[/"""/, "string", "@popall"],
|
|
249
|
+
[/"/, "string"]
|
|
250
|
+
],
|
|
251
|
+
// Recognize hex, negatives, decimals, imaginaries, longs, and scientific notation
|
|
252
|
+
numbers: [
|
|
253
|
+
[/-?0x([abcdef]|[ABCDEF]|\d)+[lL]?/, "number.hex"],
|
|
254
|
+
[/-?(\d*\.)?\d+([eE][+\-]?\d+)?[jJ]?[lL]?/, "number"]
|
|
255
|
+
],
|
|
256
|
+
// Recognize strings, including those broken across lines with \ (but not without)
|
|
257
|
+
strings: [
|
|
258
|
+
[/'$/, "string.escape", "@popall"],
|
|
259
|
+
[/f'{1,3}/, "string.escape", "@fStringBody"],
|
|
260
|
+
[/'/, "string.escape", "@stringBody"],
|
|
261
|
+
[/"$/, "string.escape", "@popall"],
|
|
262
|
+
[/f"{1,3}/, "string.escape", "@fDblStringBody"],
|
|
263
|
+
[/"/, "string.escape", "@dblStringBody"]
|
|
264
|
+
],
|
|
265
|
+
fStringBody: [
|
|
266
|
+
[/[^\\'\{\}]+$/, "string", "@popall"],
|
|
267
|
+
[/[^\\'\{\}]+/, "string"],
|
|
268
|
+
[/\{[^\}':!=]+/, "identifier", "@fStringDetail"],
|
|
269
|
+
[/\\./, "string"],
|
|
270
|
+
[/'/, "string.escape", "@popall"],
|
|
271
|
+
[/\\$/, "string"]
|
|
272
|
+
],
|
|
273
|
+
stringBody: [
|
|
274
|
+
[/[^\\']+$/, "string", "@popall"],
|
|
275
|
+
[/[^\\']+/, "string"],
|
|
276
|
+
[/\\./, "string"],
|
|
277
|
+
[/'/, "string.escape", "@popall"],
|
|
278
|
+
[/\\$/, "string"]
|
|
279
|
+
],
|
|
280
|
+
fDblStringBody: [
|
|
281
|
+
[/[^\\"\{\}]+$/, "string", "@popall"],
|
|
282
|
+
[/[^\\"\{\}]+/, "string"],
|
|
283
|
+
[/\{[^\}':!=]+/, "identifier", "@fStringDetail"],
|
|
284
|
+
[/\\./, "string"],
|
|
285
|
+
[/"/, "string.escape", "@popall"],
|
|
286
|
+
[/\\$/, "string"]
|
|
287
|
+
],
|
|
288
|
+
dblStringBody: [
|
|
289
|
+
[/[^\\"]+$/, "string", "@popall"],
|
|
290
|
+
[/[^\\"]+/, "string"],
|
|
291
|
+
[/\\./, "string"],
|
|
292
|
+
[/"/, "string.escape", "@popall"],
|
|
293
|
+
[/\\$/, "string"]
|
|
294
|
+
],
|
|
295
|
+
fStringDetail: [
|
|
296
|
+
[/[:][^}]+/, "string"],
|
|
297
|
+
[/[!][ars]/, "string"],
|
|
298
|
+
// only !a, !r, !s are supported by f-strings: https://docs.python.org/3/tutorial/inputoutput.html#formatted-string-literals
|
|
299
|
+
[/=/, "string"],
|
|
300
|
+
[/\}/, "identifier", "@pop"]
|
|
301
|
+
]
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
export {
|
|
305
|
+
m as conf,
|
|
306
|
+
f as language
|
|
307
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/*!-----------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
|
|
4
|
+
* Released under the MIT license
|
|
5
|
+
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
6
|
+
*-----------------------------------------------------------------------------*/var e={comments:{lineComment:"//"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}]},t={keywords:["namespace","open","as","operation","function","body","adjoint","newtype","controlled","if","elif","else","repeat","until","fixup","for","in","while","return","fail","within","apply","Adjoint","Controlled","Adj","Ctl","is","self","auto","distribute","invert","intrinsic","let","set","w/","new","not","and","or","use","borrow","using","borrowing","mutable","internal"],typeKeywords:["Unit","Int","BigInt","Double","Bool","String","Qubit","Result","Pauli","Range"],invalidKeywords:["abstract","base","bool","break","byte","case","catch","char","checked","class","const","continue","decimal","default","delegate","do","double","enum","event","explicit","extern","finally","fixed","float","foreach","goto","implicit","int","interface","lock","long","null","object","operator","out","override","params","private","protected","public","readonly","ref","sbyte","sealed","short","sizeof","stackalloc","static","string","struct","switch","this","throw","try","typeof","unit","ulong","unchecked","unsafe","ushort","virtual","void","volatile"],constants:["true","false","PauliI","PauliX","PauliY","PauliZ","One","Zero"],builtin:["X","Y","Z","H","HY","S","T","SWAP","CNOT","CCNOT","MultiX","R","RFrac","Rx","Ry","Rz","R1","R1Frac","Exp","ExpFrac","Measure","M","MultiM","Message","Length","Assert","AssertProb","AssertEqual"],operators:["and=","<-","->","*","*=","@","!","^","^=",":","::","..","==","...","=","=>",">",">=","<","<=","-","-=","!=","or=","%","%=","|","+","+=","?","/","/=","&&&","&&&=","^^^","^^^=",">>>",">>>=","<<<","<<<=","|||","|||=","~~~","_","w/","w/="],namespaceFollows:["namespace","open"],symbols:/[=><!~?:&|+\-*\/\^%@._]+/,escapes:/\\[\s\S]/,tokenizer:{root:[[/[a-zA-Z_$][\w$]*/,{cases:{"@namespaceFollows":{token:"keyword.$0",next:"@namespace"},"@typeKeywords":"type","@keywords":"keyword","@constants":"constant","@builtin":"keyword","@invalidKeywords":"invalid","@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]],namespace:[{include:"@whitespace"},[/[A-Za-z]\w*/,"namespace"],[/[\.=]/,"delimiter"],["","","@pop"]],whitespace:[[/[ \t\r\n]+/,"white"],[/(\/\/).*/,"comment"]]}};exports.conf=e;exports.language=t;
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
/*!-----------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
|
|
4
|
+
* Released under the MIT license
|
|
5
|
+
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
6
|
+
*-----------------------------------------------------------------------------*/
|
|
7
|
+
var e = {
|
|
8
|
+
comments: {
|
|
9
|
+
lineComment: "//"
|
|
10
|
+
},
|
|
11
|
+
brackets: [
|
|
12
|
+
["{", "}"],
|
|
13
|
+
["[", "]"],
|
|
14
|
+
["(", ")"]
|
|
15
|
+
],
|
|
16
|
+
autoClosingPairs: [
|
|
17
|
+
{ open: "{", close: "}" },
|
|
18
|
+
{ open: "[", close: "]" },
|
|
19
|
+
{ open: "(", close: ")" },
|
|
20
|
+
{ open: '"', close: '"', notIn: ["string", "comment"] }
|
|
21
|
+
],
|
|
22
|
+
surroundingPairs: [
|
|
23
|
+
{ open: "{", close: "}" },
|
|
24
|
+
{ open: "[", close: "]" },
|
|
25
|
+
{ open: "(", close: ")" },
|
|
26
|
+
{ open: '"', close: '"' }
|
|
27
|
+
]
|
|
28
|
+
}, t = {
|
|
29
|
+
// Set defaultToken to invalid to see what you do not tokenize yet
|
|
30
|
+
keywords: [
|
|
31
|
+
"namespace",
|
|
32
|
+
"open",
|
|
33
|
+
"as",
|
|
34
|
+
"operation",
|
|
35
|
+
"function",
|
|
36
|
+
"body",
|
|
37
|
+
"adjoint",
|
|
38
|
+
"newtype",
|
|
39
|
+
"controlled",
|
|
40
|
+
"if",
|
|
41
|
+
"elif",
|
|
42
|
+
"else",
|
|
43
|
+
"repeat",
|
|
44
|
+
"until",
|
|
45
|
+
"fixup",
|
|
46
|
+
"for",
|
|
47
|
+
"in",
|
|
48
|
+
"while",
|
|
49
|
+
"return",
|
|
50
|
+
"fail",
|
|
51
|
+
"within",
|
|
52
|
+
"apply",
|
|
53
|
+
"Adjoint",
|
|
54
|
+
"Controlled",
|
|
55
|
+
"Adj",
|
|
56
|
+
"Ctl",
|
|
57
|
+
"is",
|
|
58
|
+
"self",
|
|
59
|
+
"auto",
|
|
60
|
+
"distribute",
|
|
61
|
+
"invert",
|
|
62
|
+
"intrinsic",
|
|
63
|
+
"let",
|
|
64
|
+
"set",
|
|
65
|
+
"w/",
|
|
66
|
+
"new",
|
|
67
|
+
"not",
|
|
68
|
+
"and",
|
|
69
|
+
"or",
|
|
70
|
+
"use",
|
|
71
|
+
"borrow",
|
|
72
|
+
"using",
|
|
73
|
+
"borrowing",
|
|
74
|
+
"mutable",
|
|
75
|
+
"internal"
|
|
76
|
+
],
|
|
77
|
+
typeKeywords: [
|
|
78
|
+
"Unit",
|
|
79
|
+
"Int",
|
|
80
|
+
"BigInt",
|
|
81
|
+
"Double",
|
|
82
|
+
"Bool",
|
|
83
|
+
"String",
|
|
84
|
+
"Qubit",
|
|
85
|
+
"Result",
|
|
86
|
+
"Pauli",
|
|
87
|
+
"Range"
|
|
88
|
+
],
|
|
89
|
+
invalidKeywords: [
|
|
90
|
+
"abstract",
|
|
91
|
+
"base",
|
|
92
|
+
"bool",
|
|
93
|
+
"break",
|
|
94
|
+
"byte",
|
|
95
|
+
"case",
|
|
96
|
+
"catch",
|
|
97
|
+
"char",
|
|
98
|
+
"checked",
|
|
99
|
+
"class",
|
|
100
|
+
"const",
|
|
101
|
+
"continue",
|
|
102
|
+
"decimal",
|
|
103
|
+
"default",
|
|
104
|
+
"delegate",
|
|
105
|
+
"do",
|
|
106
|
+
"double",
|
|
107
|
+
"enum",
|
|
108
|
+
"event",
|
|
109
|
+
"explicit",
|
|
110
|
+
"extern",
|
|
111
|
+
"finally",
|
|
112
|
+
"fixed",
|
|
113
|
+
"float",
|
|
114
|
+
"foreach",
|
|
115
|
+
"goto",
|
|
116
|
+
"implicit",
|
|
117
|
+
"int",
|
|
118
|
+
"interface",
|
|
119
|
+
"lock",
|
|
120
|
+
"long",
|
|
121
|
+
"null",
|
|
122
|
+
"object",
|
|
123
|
+
"operator",
|
|
124
|
+
"out",
|
|
125
|
+
"override",
|
|
126
|
+
"params",
|
|
127
|
+
"private",
|
|
128
|
+
"protected",
|
|
129
|
+
"public",
|
|
130
|
+
"readonly",
|
|
131
|
+
"ref",
|
|
132
|
+
"sbyte",
|
|
133
|
+
"sealed",
|
|
134
|
+
"short",
|
|
135
|
+
"sizeof",
|
|
136
|
+
"stackalloc",
|
|
137
|
+
"static",
|
|
138
|
+
"string",
|
|
139
|
+
"struct",
|
|
140
|
+
"switch",
|
|
141
|
+
"this",
|
|
142
|
+
"throw",
|
|
143
|
+
"try",
|
|
144
|
+
"typeof",
|
|
145
|
+
"unit",
|
|
146
|
+
"ulong",
|
|
147
|
+
"unchecked",
|
|
148
|
+
"unsafe",
|
|
149
|
+
"ushort",
|
|
150
|
+
"virtual",
|
|
151
|
+
"void",
|
|
152
|
+
"volatile"
|
|
153
|
+
],
|
|
154
|
+
constants: ["true", "false", "PauliI", "PauliX", "PauliY", "PauliZ", "One", "Zero"],
|
|
155
|
+
builtin: [
|
|
156
|
+
"X",
|
|
157
|
+
"Y",
|
|
158
|
+
"Z",
|
|
159
|
+
"H",
|
|
160
|
+
"HY",
|
|
161
|
+
"S",
|
|
162
|
+
"T",
|
|
163
|
+
"SWAP",
|
|
164
|
+
"CNOT",
|
|
165
|
+
"CCNOT",
|
|
166
|
+
"MultiX",
|
|
167
|
+
"R",
|
|
168
|
+
"RFrac",
|
|
169
|
+
"Rx",
|
|
170
|
+
"Ry",
|
|
171
|
+
"Rz",
|
|
172
|
+
"R1",
|
|
173
|
+
"R1Frac",
|
|
174
|
+
"Exp",
|
|
175
|
+
"ExpFrac",
|
|
176
|
+
"Measure",
|
|
177
|
+
"M",
|
|
178
|
+
"MultiM",
|
|
179
|
+
"Message",
|
|
180
|
+
"Length",
|
|
181
|
+
"Assert",
|
|
182
|
+
"AssertProb",
|
|
183
|
+
"AssertEqual"
|
|
184
|
+
],
|
|
185
|
+
operators: [
|
|
186
|
+
"and=",
|
|
187
|
+
"<-",
|
|
188
|
+
"->",
|
|
189
|
+
"*",
|
|
190
|
+
"*=",
|
|
191
|
+
"@",
|
|
192
|
+
"!",
|
|
193
|
+
"^",
|
|
194
|
+
"^=",
|
|
195
|
+
":",
|
|
196
|
+
"::",
|
|
197
|
+
"..",
|
|
198
|
+
"==",
|
|
199
|
+
"...",
|
|
200
|
+
"=",
|
|
201
|
+
"=>",
|
|
202
|
+
">",
|
|
203
|
+
">=",
|
|
204
|
+
"<",
|
|
205
|
+
"<=",
|
|
206
|
+
"-",
|
|
207
|
+
"-=",
|
|
208
|
+
"!=",
|
|
209
|
+
"or=",
|
|
210
|
+
"%",
|
|
211
|
+
"%=",
|
|
212
|
+
"|",
|
|
213
|
+
"+",
|
|
214
|
+
"+=",
|
|
215
|
+
"?",
|
|
216
|
+
"/",
|
|
217
|
+
"/=",
|
|
218
|
+
"&&&",
|
|
219
|
+
"&&&=",
|
|
220
|
+
"^^^",
|
|
221
|
+
"^^^=",
|
|
222
|
+
">>>",
|
|
223
|
+
">>>=",
|
|
224
|
+
"<<<",
|
|
225
|
+
"<<<=",
|
|
226
|
+
"|||",
|
|
227
|
+
"|||=",
|
|
228
|
+
"~~~",
|
|
229
|
+
"_",
|
|
230
|
+
"w/",
|
|
231
|
+
"w/="
|
|
232
|
+
],
|
|
233
|
+
namespaceFollows: ["namespace", "open"],
|
|
234
|
+
symbols: /[=><!~?:&|+\-*\/\^%@._]+/,
|
|
235
|
+
escapes: /\\[\s\S]/,
|
|
236
|
+
// The main tokenizer for our languages
|
|
237
|
+
tokenizer: {
|
|
238
|
+
root: [
|
|
239
|
+
// identifiers and keywords
|
|
240
|
+
[
|
|
241
|
+
/[a-zA-Z_$][\w$]*/,
|
|
242
|
+
{
|
|
243
|
+
cases: {
|
|
244
|
+
"@namespaceFollows": {
|
|
245
|
+
token: "keyword.$0",
|
|
246
|
+
next: "@namespace"
|
|
247
|
+
},
|
|
248
|
+
"@typeKeywords": "type",
|
|
249
|
+
"@keywords": "keyword",
|
|
250
|
+
"@constants": "constant",
|
|
251
|
+
"@builtin": "keyword",
|
|
252
|
+
"@invalidKeywords": "invalid",
|
|
253
|
+
"@default": "identifier"
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
],
|
|
257
|
+
// whitespace
|
|
258
|
+
{ include: "@whitespace" },
|
|
259
|
+
// delimiters and operators
|
|
260
|
+
[/[{}()\[\]]/, "@brackets"],
|
|
261
|
+
[/@symbols/, { cases: { "@operators": "operator", "@default": "" } }],
|
|
262
|
+
// numbers
|
|
263
|
+
[/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
|
|
264
|
+
[/\d+/, "number"],
|
|
265
|
+
// delimiter: after number because of .\d floats
|
|
266
|
+
[/[;,.]/, "delimiter"],
|
|
267
|
+
// strings
|
|
268
|
+
//[/"([^"\\]|\\.)*$/, 'string.invalid' ], // non-teminated string
|
|
269
|
+
[/"/, { token: "string.quote", bracket: "@open", next: "@string" }]
|
|
270
|
+
],
|
|
271
|
+
string: [
|
|
272
|
+
[/[^\\"]+/, "string"],
|
|
273
|
+
[/@escapes/, "string.escape"],
|
|
274
|
+
[/"/, { token: "string.quote", bracket: "@close", next: "@pop" }]
|
|
275
|
+
],
|
|
276
|
+
namespace: [
|
|
277
|
+
{ include: "@whitespace" },
|
|
278
|
+
[/[A-Za-z]\w*/, "namespace"],
|
|
279
|
+
[/[\.=]/, "delimiter"],
|
|
280
|
+
["", "", "@pop"]
|
|
281
|
+
],
|
|
282
|
+
whitespace: [
|
|
283
|
+
[/[ \t\r\n]+/, "white"],
|
|
284
|
+
[/(\/\/).*/, "comment"]
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
export {
|
|
289
|
+
e as conf,
|
|
290
|
+
t as language
|
|
291
|
+
};
|