@milkdown/crepe 7.3.3
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/LICENSE +21 -0
- package/README.md +11 -0
- package/lib/apl-p0IPP13W.js +76 -0
- package/lib/asciiarmor-lJsBxlJJ.js +34 -0
- package/lib/asn1-Q9v1zIy5.js +102 -0
- package/lib/asterisk-foNkeTjy.js +273 -0
- package/lib/brainfuck-0XqyXpNS.js +35 -0
- package/lib/clike-ak6Z6Yhe.js +639 -0
- package/lib/clojure-iYO8U8Sg.js +810 -0
- package/lib/clsx-7d8NmkQq.js +21 -0
- package/lib/cmake-SVzjkxV_.js +28 -0
- package/lib/cobol-APHEnAOX.js +74 -0
- package/lib/coffeescript-KqQa0SYG.js +182 -0
- package/lib/commonlisp-bwqNqR5V.js +79 -0
- package/lib/core/crepe.d.ts +21 -0
- package/lib/core/crepe.d.ts.map +1 -0
- package/lib/core/index.d.ts +3 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/slice.d.ts +12 -0
- package/lib/core/slice.d.ts.map +1 -0
- package/lib/crystal-BViWuDpA.js +217 -0
- package/lib/css-KHXHXfXg.js +1572 -0
- package/lib/cypher-XpTt4zQ3.js +69 -0
- package/lib/d-fLig6yqY.js +139 -0
- package/lib/diff-WoKGLpy6.js +18 -0
- package/lib/dockerfile-u6f6Vw2s.js +194 -0
- package/lib/dtd-SIJRUW6K.js +91 -0
- package/lib/dylan-4HCLhpWP.js +238 -0
- package/lib/ebnf-h_0lged5.js +77 -0
- package/lib/ecl-Lf4FF0lf.js +133 -0
- package/lib/eiffel-qlw8KUyf.js +112 -0
- package/lib/elm-QRnB3zXs.js +108 -0
- package/lib/erlang-fyVKb7eK.js +488 -0
- package/lib/factor-BEeN4upY.js +65 -0
- package/lib/fcl-lRek3hEb.js +106 -0
- package/lib/feature/block-edit/handle/component.d.ts +9 -0
- package/lib/feature/block-edit/handle/component.d.ts.map +1 -0
- package/lib/feature/block-edit/handle/index.d.ts +12 -0
- package/lib/feature/block-edit/handle/index.d.ts.map +1 -0
- package/lib/feature/block-edit/index.d.ts +3 -0
- package/lib/feature/block-edit/index.d.ts.map +1 -0
- package/lib/feature/block-edit/menu/component.d.ts +14 -0
- package/lib/feature/block-edit/menu/component.d.ts.map +1 -0
- package/lib/feature/block-edit/menu/config.d.ts +21 -0
- package/lib/feature/block-edit/menu/config.d.ts.map +1 -0
- package/lib/feature/block-edit/menu/icons.d.ts +14 -0
- package/lib/feature/block-edit/menu/icons.d.ts.map +1 -0
- package/lib/feature/block-edit/menu/index.d.ts +9 -0
- package/lib/feature/block-edit/menu/index.d.ts.map +1 -0
- package/lib/feature/code-mirror/index.d.ts +3 -0
- package/lib/feature/code-mirror/index.d.ts.map +1 -0
- package/lib/feature/gap-cursor/index.d.ts +3 -0
- package/lib/feature/gap-cursor/index.d.ts.map +1 -0
- package/lib/feature/image-block/index.d.ts +3 -0
- package/lib/feature/image-block/index.d.ts.map +1 -0
- package/lib/feature/index.d.ts +18 -0
- package/lib/feature/index.d.ts.map +1 -0
- package/lib/feature/link-tooltip/consts.d.ts +5 -0
- package/lib/feature/link-tooltip/consts.d.ts.map +1 -0
- package/lib/feature/link-tooltip/index.d.ts +3 -0
- package/lib/feature/link-tooltip/index.d.ts.map +1 -0
- package/lib/feature/list-item/consts.d.ts +2 -0
- package/lib/feature/list-item/consts.d.ts.map +1 -0
- package/lib/feature/list-item/index.d.ts +3 -0
- package/lib/feature/list-item/index.d.ts.map +1 -0
- package/lib/feature/placeholder/index.d.ts +10 -0
- package/lib/feature/placeholder/index.d.ts.map +1 -0
- package/lib/feature/shared.d.ts +3 -0
- package/lib/feature/shared.d.ts.map +1 -0
- package/lib/feature/toolbar/component.d.ts +13 -0
- package/lib/feature/toolbar/component.d.ts.map +1 -0
- package/lib/feature/toolbar/consts.d.ts +5 -0
- package/lib/feature/toolbar/consts.d.ts.map +1 -0
- package/lib/feature/toolbar/index.d.ts +3 -0
- package/lib/feature/toolbar/index.d.ts.map +1 -0
- package/lib/forth-ua2bRd8T.js +60 -0
- package/lib/fortran-WnF7znuN.js +443 -0
- package/lib/gas-wowve1o7.js +183 -0
- package/lib/gherkin-m7GIChu3.js +34 -0
- package/lib/go-th443Dhb.js +158 -0
- package/lib/groovy-tR4RiZnc.js +161 -0
- package/lib/haskell-jxVBofv5.js +375 -0
- package/lib/haxe-kWPI2tq3.js +390 -0
- package/lib/hooks-82sqkbtE.js +21 -0
- package/lib/http-3GIFWUlG.js +45 -0
- package/lib/icons-HYkfuR-O.js +50 -0
- package/lib/idl-PvpMZg-l.js +947 -0
- package/lib/index-0RbcZMbq.js +8 -0
- package/lib/index-4afXjFMY.js +517 -0
- package/lib/index-7MeyepDG.js +78 -0
- package/lib/index-7QgQq3x3.js +551 -0
- package/lib/index-7pgP6qYs.js +107 -0
- package/lib/index-8DvtgRVa.js +19511 -0
- package/lib/index-8Gg-jEP4.js +288 -0
- package/lib/index-8S8qcncB.js +507 -0
- package/lib/index-9A_GmGh4.js +1039 -0
- package/lib/index-EJJfYLzA.js +928 -0
- package/lib/index-Eg39w5kL.js +984 -0
- package/lib/index-FIk_7oPb.js +168 -0
- package/lib/index-LlbrXb_n.js +368 -0
- package/lib/index-MovKtgMG.js +121 -0
- package/lib/index-N9GtIS4X.js +64 -0
- package/lib/index-Pwn25-kf.js +8 -0
- package/lib/index-SdFSDosa.js +1295 -0
- package/lib/index-W5Th22-Z.js +1744 -0
- package/lib/index-XiXSFLmI.js +20975 -0
- package/lib/index-bknOViGv.js +47 -0
- package/lib/index-bkuIUPFS.js +275 -0
- package/lib/index-jPA8J9Eo.js +8 -0
- package/lib/index-lsG76a9s.js +552 -0
- package/lib/index-oTRzPo3B.js +146 -0
- package/lib/index-rrf6_6DC.js +317 -0
- package/lib/index-vJbZIHYF.js +81 -0
- package/lib/index-vPRh55CO.js +137 -0
- package/lib/index-vxy63hib.js +323 -0
- package/lib/index-wn1_LgCS.js +99 -0
- package/lib/index-xHADmDT3.js +12 -0
- package/lib/index-yt2EpMtv.js +141 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.es.js +7 -0
- package/lib/javascript-8ZHqHagw.js +758 -0
- package/lib/jinja2-vsOFe0qD.js +154 -0
- package/lib/julia-dlp_pbN1.js +241 -0
- package/lib/livescript-Gf5R-LT6.js +273 -0
- package/lib/lua-c5Y_JsBp.js +221 -0
- package/lib/mathematica-iiGTGmUs.js +35 -0
- package/lib/mbox-ZJh86H8B.js +78 -0
- package/lib/meta-tAGyVRPE.js +511 -0
- package/lib/mirc-i0qkCa0y.js +73 -0
- package/lib/mllike-Dy551fZW.js +275 -0
- package/lib/modelica-n6tGqUT9.js +94 -0
- package/lib/mscgen-aKSbB7D9.js +104 -0
- package/lib/mumps-lNiKA6sp.js +25 -0
- package/lib/nginx--YmuCfDj.js +93 -0
- package/lib/nsis-zhS8iA09.js +62 -0
- package/lib/ntriples-E3jQl3MC.js +79 -0
- package/lib/octave-EQvkGIeG.js +144 -0
- package/lib/oz-W2cpqFf6.js +152 -0
- package/lib/pascal-lCh6ouNZ.js +79 -0
- package/lib/perl-PxEQBX0B.js +915 -0
- package/lib/pig-Y_bNcrzS.js +56 -0
- package/lib/powershell-GaQP-TZr.js +249 -0
- package/lib/properties-mbRyn54L.js +26 -0
- package/lib/prosemirror-noTDkx-k.js +4 -0
- package/lib/protobuf-8CJideyJ.js +49 -0
- package/lib/puppet-ABBaChNZ.js +45 -0
- package/lib/python-sKdHg3Ka.js +321 -0
- package/lib/q-_1yG40Nm.js +89 -0
- package/lib/r-Ziz56bHT.js +108 -0
- package/lib/rpm-ORjGOHaQ.js +57 -0
- package/lib/ruby-jlbYq0dT.js +233 -0
- package/lib/sas-2n7xeUuO.js +107 -0
- package/lib/schema-tKk3m1fu.js +62 -0
- package/lib/scheme-XCs-NPeU.js +126 -0
- package/lib/shell-0_1Um7Dq.js +184 -0
- package/lib/sieve-7uyJD1x1.js +73 -0
- package/lib/simple-mode--HIzBxba.js +95 -0
- package/lib/smalltalk-PEFzrlQ-.js +48 -0
- package/lib/solr-BLBaHahN.js +41 -0
- package/lib/sparql-4F9ZWf1b.js +204 -0
- package/lib/spreadsheet-SGSo6blj.js +49 -0
- package/lib/sql-tebLBzN0.js +291 -0
- package/lib/stex-SFJcFGOO.js +130 -0
- package/lib/stylus-rwwWYWFm.js +256 -0
- package/lib/swift-eorJ0tCv.js +238 -0
- package/lib/tcl-IwXMB8U4.js +82 -0
- package/lib/textile-ok2VyjwC.js +299 -0
- package/lib/theme/classic/index.d.ts +3 -0
- package/lib/theme/classic/index.d.ts.map +1 -0
- package/lib/theme/classic-dark/index.d.ts +3 -0
- package/lib/theme/classic-dark/index.d.ts.map +1 -0
- package/lib/theme/headless/index.d.ts +3 -0
- package/lib/theme/headless/index.d.ts.map +1 -0
- package/lib/theme/index.d.ts +8 -0
- package/lib/theme/index.d.ts.map +1 -0
- package/lib/theme/shared.d.ts +3 -0
- package/lib/theme/shared.d.ts.map +1 -0
- package/lib/tiddlywiki-DLhz8_pc.js +156 -0
- package/lib/tiki-DFAqFElY.js +183 -0
- package/lib/tippy.esm-MZ2vxByW.js +1813 -0
- package/lib/toml-ryxpTZEV.js +49 -0
- package/lib/tooltip-plugin-gcwyQdiT.js +119 -0
- package/lib/troff-ZzZyvNct.js +36 -0
- package/lib/ttcn-6gvkqqpW.js +136 -0
- package/lib/ttcn-cfg-oSu-Dq5C.js +98 -0
- package/lib/turtle-10ofr5au.js +87 -0
- package/lib/use-css-light-dom-EKWZDmbJ.js +82 -0
- package/lib/utils/index.d.ts +4 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/vb-a6n6fzrD.js +74 -0
- package/lib/vbscript-dgvo8jPt.js +324 -0
- package/lib/velocity-CBncCrwO.js +97 -0
- package/lib/verilog-KlcACt6C.js +271 -0
- package/lib/vhdl-NMd7Gf35.js +117 -0
- package/lib/webidl-z1UE5DN_.js +160 -0
- package/lib/xquery-hDt5jWTp.js +431 -0
- package/lib/yacas-ftgh_qwr.js +74 -0
- package/lib/yaml-DnNTfjXK.js +53 -0
- package/lib/z80-dA1PqWe1.js +62 -0
- package/package.json +87 -0
- package/src/core/crepe.ts +98 -0
- package/src/core/index.ts +4 -0
- package/src/core/slice.ts +44 -0
- package/src/feature/block-edit/handle/component.ts +68 -0
- package/src/feature/block-edit/handle/index.ts +81 -0
- package/src/feature/block-edit/index.ts +17 -0
- package/src/feature/block-edit/menu/component.ts +210 -0
- package/src/feature/block-edit/menu/config.ts +335 -0
- package/src/feature/block-edit/menu/icons.ts +171 -0
- package/src/feature/block-edit/menu/index.ts +113 -0
- package/src/feature/block-edit/style.css +126 -0
- package/src/feature/code-mirror/index.ts +60 -0
- package/src/feature/code-mirror/style.css +159 -0
- package/src/feature/gap-cursor/index.ts +31 -0
- package/src/feature/image-block/index.ts +59 -0
- package/src/feature/image-block/style.css +215 -0
- package/src/feature/index.ts +66 -0
- package/src/feature/link-tooltip/consts.ts +47 -0
- package/src/feature/link-tooltip/index.ts +22 -0
- package/src/feature/link-tooltip/style.css +107 -0
- package/src/feature/list-item/consts.ts +15 -0
- package/src/feature/list-item/index.ts +30 -0
- package/src/feature/list-item/style.css +23 -0
- package/src/feature/placeholder/index.ts +87 -0
- package/src/feature/placeholder/style.css +9 -0
- package/src/feature/shared.ts +4 -0
- package/src/feature/toolbar/component.ts +101 -0
- package/src/feature/toolbar/consts.ts +26 -0
- package/src/feature/toolbar/index.ts +92 -0
- package/src/feature/toolbar/style.css +37 -0
- package/src/index.ts +5 -0
- package/src/theme/classic/index.ts +12 -0
- package/src/theme/classic/style.css +192 -0
- package/src/theme/classic-dark/index.ts +12 -0
- package/src/theme/classic-dark/style.css +197 -0
- package/src/theme/headless/index.ts +9 -0
- package/src/theme/index.ts +26 -0
- package/src/theme/shared.ts +4 -0
- package/src/utils/index.ts +12 -0
- package/src/vite-env.d.ts +2 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
var u = "error";
|
|
2
|
+
function o(e) {
|
|
3
|
+
return new RegExp("^((" + e.join(")|(") + "))\\b", "i");
|
|
4
|
+
}
|
|
5
|
+
var b = new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"), k = new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"), x = new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"), m = new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"), I = new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"), R = new RegExp("^[_A-Za-z][_A-Za-z0-9]*"), a = ["class", "module", "sub", "enum", "select", "while", "if", "function", "get", "set", "property", "try", "structure", "synclock", "using", "with"], f = ["else", "elseif", "case", "catch", "finally"], h = ["next", "loop"], s = ["and", "andalso", "or", "orelse", "xor", "in", "not", "is", "isnot", "like"], O = o(s), v = ["#const", "#else", "#elseif", "#end", "#if", "#region", "addhandler", "addressof", "alias", "as", "byref", "byval", "cbool", "cbyte", "cchar", "cdate", "cdbl", "cdec", "cint", "clng", "cobj", "compare", "const", "continue", "csbyte", "cshort", "csng", "cstr", "cuint", "culng", "cushort", "declare", "default", "delegate", "dim", "directcast", "each", "erase", "error", "event", "exit", "explicit", "false", "for", "friend", "gettype", "goto", "handles", "implements", "imports", "infer", "inherits", "interface", "isfalse", "istrue", "lib", "me", "mod", "mustinherit", "mustoverride", "my", "mybase", "myclass", "namespace", "narrowing", "new", "nothing", "notinheritable", "notoverridable", "of", "off", "on", "operator", "option", "optional", "out", "overloads", "overridable", "overrides", "paramarray", "partial", "private", "protected", "public", "raiseevent", "readonly", "redim", "removehandler", "resume", "return", "shadows", "shared", "static", "step", "stop", "strict", "then", "throw", "to", "true", "trycast", "typeof", "until", "until", "when", "widening", "withevents", "writeonly"], p = ["object", "boolean", "char", "string", "byte", "sbyte", "short", "ushort", "int16", "uint16", "integer", "uinteger", "int32", "uint32", "long", "ulong", "int64", "uint64", "decimal", "single", "double", "float", "date", "datetime", "intptr", "uintptr"], z = o(v), E = o(p), C = '"', S = o(a), g = o(f), y = o(h), w = o(["end"]), T = o(["do"]);
|
|
6
|
+
function l(e, n) {
|
|
7
|
+
n.currentIndent++;
|
|
8
|
+
}
|
|
9
|
+
function c(e, n) {
|
|
10
|
+
n.currentIndent--;
|
|
11
|
+
}
|
|
12
|
+
function d(e, n) {
|
|
13
|
+
if (e.eatSpace())
|
|
14
|
+
return null;
|
|
15
|
+
var i = e.peek();
|
|
16
|
+
if (i === "'")
|
|
17
|
+
return e.skipToEnd(), "comment";
|
|
18
|
+
if (e.match(/^((&H)|(&O))?[0-9\.a-f]/i, !1)) {
|
|
19
|
+
var r = !1;
|
|
20
|
+
if ((e.match(/^\d*\.\d+F?/i) || e.match(/^\d+\.\d*F?/) || e.match(/^\.\d+F?/)) && (r = !0), r)
|
|
21
|
+
return e.eat(/J/i), "number";
|
|
22
|
+
var t = !1;
|
|
23
|
+
if (e.match(/^&H[0-9a-f]+/i) || e.match(/^&O[0-7]+/i) ? t = !0 : e.match(/^[1-9]\d*F?/) ? (e.eat(/J/i), t = !0) : e.match(/^0(?![\dx])/i) && (t = !0), t)
|
|
24
|
+
return e.eat(/L/i), "number";
|
|
25
|
+
}
|
|
26
|
+
return e.match(C) ? (n.tokenize = F(e.current()), n.tokenize(e, n)) : e.match(I) || e.match(m) ? null : e.match(x) || e.match(b) || e.match(O) ? "operator" : e.match(k) ? null : e.match(T) ? (l(e, n), n.doInCurrentLine = !0, "keyword") : e.match(S) ? (n.doInCurrentLine ? n.doInCurrentLine = !1 : l(e, n), "keyword") : e.match(g) ? "keyword" : e.match(w) ? (c(e, n), c(e, n), "keyword") : e.match(y) ? (c(e, n), "keyword") : e.match(E) || e.match(z) ? "keyword" : e.match(R) ? "variable" : (e.next(), u);
|
|
27
|
+
}
|
|
28
|
+
function F(e) {
|
|
29
|
+
var n = e.length == 1, i = "string";
|
|
30
|
+
return function(r, t) {
|
|
31
|
+
for (; !r.eol(); ) {
|
|
32
|
+
if (r.eatWhile(/[^'"]/), r.match(e))
|
|
33
|
+
return t.tokenize = d, i;
|
|
34
|
+
r.eat(/['"]/);
|
|
35
|
+
}
|
|
36
|
+
return n && (t.tokenize = d), i;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function K(e, n) {
|
|
40
|
+
var i = n.tokenize(e, n), r = e.current();
|
|
41
|
+
if (r === ".")
|
|
42
|
+
return i = n.tokenize(e, n), i === "variable" ? "variable" : u;
|
|
43
|
+
var t = "[({".indexOf(r);
|
|
44
|
+
return t !== -1 && l(e, n), t = "])}".indexOf(r), t !== -1 && c(e, n) ? u : i;
|
|
45
|
+
}
|
|
46
|
+
const L = {
|
|
47
|
+
name: "vb",
|
|
48
|
+
startState: function() {
|
|
49
|
+
return {
|
|
50
|
+
tokenize: d,
|
|
51
|
+
lastToken: null,
|
|
52
|
+
currentIndent: 0,
|
|
53
|
+
nextLineIndent: 0,
|
|
54
|
+
doInCurrentLine: !1
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
token: function(e, n) {
|
|
58
|
+
e.sol() && (n.currentIndent += n.nextLineIndent, n.nextLineIndent = 0, n.doInCurrentLine = 0);
|
|
59
|
+
var i = K(e, n);
|
|
60
|
+
return n.lastToken = { style: i, content: e.current() }, i;
|
|
61
|
+
},
|
|
62
|
+
indent: function(e, n, i) {
|
|
63
|
+
var r = n.replace(/^\s+|\s+$/g, "");
|
|
64
|
+
return r.match(y) || r.match(w) || r.match(g) ? i.unit * (e.currentIndent - 1) : e.currentIndent < 0 ? 0 : e.currentIndent * i.unit;
|
|
65
|
+
},
|
|
66
|
+
languageData: {
|
|
67
|
+
closeBrackets: { brackets: ["(", "[", "{", '"'] },
|
|
68
|
+
commentTokens: { line: "'" },
|
|
69
|
+
autocomplete: a.concat(f).concat(h).concat(s).concat(v).concat(p)
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
export {
|
|
73
|
+
L as vb
|
|
74
|
+
};
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
function p(h) {
|
|
2
|
+
var v = "error";
|
|
3
|
+
function i(e) {
|
|
4
|
+
return new RegExp("^((" + e.join(")|(") + "))\\b", "i");
|
|
5
|
+
}
|
|
6
|
+
var y = new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"), g = new RegExp("^((<>)|(<=)|(>=))"), m = new RegExp("^[\\.,]"), w = new RegExp("^[\\(\\)]"), k = new RegExp("^[A-Za-z][_A-Za-z0-9]*"), x = ["class", "sub", "select", "while", "if", "function", "property", "with", "for"], C = ["else", "elseif", "case"], I = ["next", "loop", "wend"], S = i(["and", "or", "not", "xor", "is", "mod", "eqv", "imp"]), O = [
|
|
7
|
+
"dim",
|
|
8
|
+
"redim",
|
|
9
|
+
"then",
|
|
10
|
+
"until",
|
|
11
|
+
"randomize",
|
|
12
|
+
"byval",
|
|
13
|
+
"byref",
|
|
14
|
+
"new",
|
|
15
|
+
"property",
|
|
16
|
+
"exit",
|
|
17
|
+
"in",
|
|
18
|
+
"const",
|
|
19
|
+
"private",
|
|
20
|
+
"public",
|
|
21
|
+
"get",
|
|
22
|
+
"set",
|
|
23
|
+
"let",
|
|
24
|
+
"stop",
|
|
25
|
+
"on error resume next",
|
|
26
|
+
"on error goto 0",
|
|
27
|
+
"option explicit",
|
|
28
|
+
"call",
|
|
29
|
+
"me"
|
|
30
|
+
], D = ["true", "false", "nothing", "empty", "null"], R = [
|
|
31
|
+
"abs",
|
|
32
|
+
"array",
|
|
33
|
+
"asc",
|
|
34
|
+
"atn",
|
|
35
|
+
"cbool",
|
|
36
|
+
"cbyte",
|
|
37
|
+
"ccur",
|
|
38
|
+
"cdate",
|
|
39
|
+
"cdbl",
|
|
40
|
+
"chr",
|
|
41
|
+
"cint",
|
|
42
|
+
"clng",
|
|
43
|
+
"cos",
|
|
44
|
+
"csng",
|
|
45
|
+
"cstr",
|
|
46
|
+
"date",
|
|
47
|
+
"dateadd",
|
|
48
|
+
"datediff",
|
|
49
|
+
"datepart",
|
|
50
|
+
"dateserial",
|
|
51
|
+
"datevalue",
|
|
52
|
+
"day",
|
|
53
|
+
"escape",
|
|
54
|
+
"eval",
|
|
55
|
+
"execute",
|
|
56
|
+
"exp",
|
|
57
|
+
"filter",
|
|
58
|
+
"formatcurrency",
|
|
59
|
+
"formatdatetime",
|
|
60
|
+
"formatnumber",
|
|
61
|
+
"formatpercent",
|
|
62
|
+
"getlocale",
|
|
63
|
+
"getobject",
|
|
64
|
+
"getref",
|
|
65
|
+
"hex",
|
|
66
|
+
"hour",
|
|
67
|
+
"inputbox",
|
|
68
|
+
"instr",
|
|
69
|
+
"instrrev",
|
|
70
|
+
"int",
|
|
71
|
+
"fix",
|
|
72
|
+
"isarray",
|
|
73
|
+
"isdate",
|
|
74
|
+
"isempty",
|
|
75
|
+
"isnull",
|
|
76
|
+
"isnumeric",
|
|
77
|
+
"isobject",
|
|
78
|
+
"join",
|
|
79
|
+
"lbound",
|
|
80
|
+
"lcase",
|
|
81
|
+
"left",
|
|
82
|
+
"len",
|
|
83
|
+
"loadpicture",
|
|
84
|
+
"log",
|
|
85
|
+
"ltrim",
|
|
86
|
+
"rtrim",
|
|
87
|
+
"trim",
|
|
88
|
+
"maths",
|
|
89
|
+
"mid",
|
|
90
|
+
"minute",
|
|
91
|
+
"month",
|
|
92
|
+
"monthname",
|
|
93
|
+
"msgbox",
|
|
94
|
+
"now",
|
|
95
|
+
"oct",
|
|
96
|
+
"replace",
|
|
97
|
+
"rgb",
|
|
98
|
+
"right",
|
|
99
|
+
"rnd",
|
|
100
|
+
"round",
|
|
101
|
+
"scriptengine",
|
|
102
|
+
"scriptenginebuildversion",
|
|
103
|
+
"scriptenginemajorversion",
|
|
104
|
+
"scriptengineminorversion",
|
|
105
|
+
"second",
|
|
106
|
+
"setlocale",
|
|
107
|
+
"sgn",
|
|
108
|
+
"sin",
|
|
109
|
+
"space",
|
|
110
|
+
"split",
|
|
111
|
+
"sqr",
|
|
112
|
+
"strcomp",
|
|
113
|
+
"string",
|
|
114
|
+
"strreverse",
|
|
115
|
+
"tan",
|
|
116
|
+
"time",
|
|
117
|
+
"timer",
|
|
118
|
+
"timeserial",
|
|
119
|
+
"timevalue",
|
|
120
|
+
"typename",
|
|
121
|
+
"ubound",
|
|
122
|
+
"ucase",
|
|
123
|
+
"unescape",
|
|
124
|
+
"vartype",
|
|
125
|
+
"weekday",
|
|
126
|
+
"weekdayname",
|
|
127
|
+
"year"
|
|
128
|
+
], E = [
|
|
129
|
+
"vbBlack",
|
|
130
|
+
"vbRed",
|
|
131
|
+
"vbGreen",
|
|
132
|
+
"vbYellow",
|
|
133
|
+
"vbBlue",
|
|
134
|
+
"vbMagenta",
|
|
135
|
+
"vbCyan",
|
|
136
|
+
"vbWhite",
|
|
137
|
+
"vbBinaryCompare",
|
|
138
|
+
"vbTextCompare",
|
|
139
|
+
"vbSunday",
|
|
140
|
+
"vbMonday",
|
|
141
|
+
"vbTuesday",
|
|
142
|
+
"vbWednesday",
|
|
143
|
+
"vbThursday",
|
|
144
|
+
"vbFriday",
|
|
145
|
+
"vbSaturday",
|
|
146
|
+
"vbUseSystemDayOfWeek",
|
|
147
|
+
"vbFirstJan1",
|
|
148
|
+
"vbFirstFourDays",
|
|
149
|
+
"vbFirstFullWeek",
|
|
150
|
+
"vbGeneralDate",
|
|
151
|
+
"vbLongDate",
|
|
152
|
+
"vbShortDate",
|
|
153
|
+
"vbLongTime",
|
|
154
|
+
"vbShortTime",
|
|
155
|
+
"vbObjectError",
|
|
156
|
+
"vbOKOnly",
|
|
157
|
+
"vbOKCancel",
|
|
158
|
+
"vbAbortRetryIgnore",
|
|
159
|
+
"vbYesNoCancel",
|
|
160
|
+
"vbYesNo",
|
|
161
|
+
"vbRetryCancel",
|
|
162
|
+
"vbCritical",
|
|
163
|
+
"vbQuestion",
|
|
164
|
+
"vbExclamation",
|
|
165
|
+
"vbInformation",
|
|
166
|
+
"vbDefaultButton1",
|
|
167
|
+
"vbDefaultButton2",
|
|
168
|
+
"vbDefaultButton3",
|
|
169
|
+
"vbDefaultButton4",
|
|
170
|
+
"vbApplicationModal",
|
|
171
|
+
"vbSystemModal",
|
|
172
|
+
"vbOK",
|
|
173
|
+
"vbCancel",
|
|
174
|
+
"vbAbort",
|
|
175
|
+
"vbRetry",
|
|
176
|
+
"vbIgnore",
|
|
177
|
+
"vbYes",
|
|
178
|
+
"vbNo",
|
|
179
|
+
"vbCr",
|
|
180
|
+
"VbCrLf",
|
|
181
|
+
"vbFormFeed",
|
|
182
|
+
"vbLf",
|
|
183
|
+
"vbNewLine",
|
|
184
|
+
"vbNullChar",
|
|
185
|
+
"vbNullString",
|
|
186
|
+
"vbTab",
|
|
187
|
+
"vbVerticalTab",
|
|
188
|
+
"vbUseDefault",
|
|
189
|
+
"vbTrue",
|
|
190
|
+
"vbFalse",
|
|
191
|
+
"vbEmpty",
|
|
192
|
+
"vbNull",
|
|
193
|
+
"vbInteger",
|
|
194
|
+
"vbLong",
|
|
195
|
+
"vbSingle",
|
|
196
|
+
"vbDouble",
|
|
197
|
+
"vbCurrency",
|
|
198
|
+
"vbDate",
|
|
199
|
+
"vbString",
|
|
200
|
+
"vbObject",
|
|
201
|
+
"vbError",
|
|
202
|
+
"vbBoolean",
|
|
203
|
+
"vbVariant",
|
|
204
|
+
"vbDataObject",
|
|
205
|
+
"vbDecimal",
|
|
206
|
+
"vbByte",
|
|
207
|
+
"vbArray"
|
|
208
|
+
], a = ["WScript", "err", "debug", "RegExp"], L = ["description", "firstindex", "global", "helpcontext", "helpfile", "ignorecase", "length", "number", "pattern", "source", "value", "count"], T = ["clear", "execute", "raise", "replace", "test", "write", "writeline", "close", "open", "state", "eof", "update", "addnew", "end", "createobject", "quit"], j = ["server", "response", "request", "session", "application"], F = [
|
|
209
|
+
"buffer",
|
|
210
|
+
"cachecontrol",
|
|
211
|
+
"charset",
|
|
212
|
+
"contenttype",
|
|
213
|
+
"expires",
|
|
214
|
+
"expiresabsolute",
|
|
215
|
+
"isclientconnected",
|
|
216
|
+
"pics",
|
|
217
|
+
"status",
|
|
218
|
+
//response
|
|
219
|
+
"clientcertificate",
|
|
220
|
+
"cookies",
|
|
221
|
+
"form",
|
|
222
|
+
"querystring",
|
|
223
|
+
"servervariables",
|
|
224
|
+
"totalbytes",
|
|
225
|
+
//request
|
|
226
|
+
"contents",
|
|
227
|
+
"staticobjects",
|
|
228
|
+
//application
|
|
229
|
+
"codepage",
|
|
230
|
+
"lcid",
|
|
231
|
+
"sessionid",
|
|
232
|
+
"timeout",
|
|
233
|
+
//session
|
|
234
|
+
"scripttimeout"
|
|
235
|
+
], B = [
|
|
236
|
+
"addheader",
|
|
237
|
+
"appendtolog",
|
|
238
|
+
"binarywrite",
|
|
239
|
+
"end",
|
|
240
|
+
"flush",
|
|
241
|
+
"redirect",
|
|
242
|
+
//response
|
|
243
|
+
"binaryread",
|
|
244
|
+
//request
|
|
245
|
+
"remove",
|
|
246
|
+
"removeall",
|
|
247
|
+
"lock",
|
|
248
|
+
"unlock",
|
|
249
|
+
//application
|
|
250
|
+
"abandon",
|
|
251
|
+
//session
|
|
252
|
+
"getlasterror",
|
|
253
|
+
"htmlencode",
|
|
254
|
+
"mappath",
|
|
255
|
+
"transfer",
|
|
256
|
+
"urlencode"
|
|
257
|
+
], c = T.concat(L);
|
|
258
|
+
a = a.concat(E), h.isASP && (a = a.concat(j), c = c.concat(B, F));
|
|
259
|
+
var W = i(O), z = i(D), A = i(R), K = i(a), N = i(c), M = '"', P = i(x), b = i(C), d = i(I), s = i(["end"]), q = i(["do"]), V = i(["on error resume next", "exit"]), Y = i(["rem"]);
|
|
260
|
+
function f(e, n) {
|
|
261
|
+
n.currentIndent++;
|
|
262
|
+
}
|
|
263
|
+
function u(e, n) {
|
|
264
|
+
n.currentIndent--;
|
|
265
|
+
}
|
|
266
|
+
function l(e, n) {
|
|
267
|
+
if (e.eatSpace())
|
|
268
|
+
return null;
|
|
269
|
+
var r = e.peek();
|
|
270
|
+
if (r === "'" || e.match(Y))
|
|
271
|
+
return e.skipToEnd(), "comment";
|
|
272
|
+
if (e.match(/^((&H)|(&O))?[0-9\.]/i, !1) && !e.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i, !1)) {
|
|
273
|
+
var t = !1;
|
|
274
|
+
if ((e.match(/^\d*\.\d+/i) || e.match(/^\d+\.\d*/) || e.match(/^\.\d+/)) && (t = !0), t)
|
|
275
|
+
return e.eat(/J/i), "number";
|
|
276
|
+
var o = !1;
|
|
277
|
+
if (e.match(/^&H[0-9a-f]+/i) || e.match(/^&O[0-7]+/i) ? o = !0 : e.match(/^[1-9]\d*F?/) ? (e.eat(/J/i), o = !0) : e.match(/^0(?![\dx])/i) && (o = !0), o)
|
|
278
|
+
return e.eat(/L/i), "number";
|
|
279
|
+
}
|
|
280
|
+
return e.match(M) ? (n.tokenize = _(e.current()), n.tokenize(e, n)) : e.match(g) || e.match(y) || e.match(S) ? "operator" : e.match(m) ? null : e.match(w) ? "bracket" : e.match(V) ? (n.doInCurrentLine = !0, "keyword") : e.match(q) ? (f(e, n), n.doInCurrentLine = !0, "keyword") : e.match(P) ? (n.doInCurrentLine ? n.doInCurrentLine = !1 : f(e, n), "keyword") : e.match(b) ? "keyword" : e.match(s) ? (u(e, n), u(e, n), "keyword") : e.match(d) ? (n.doInCurrentLine ? n.doInCurrentLine = !1 : u(e, n), "keyword") : e.match(W) ? "keyword" : e.match(z) ? "atom" : e.match(N) ? "variableName.special" : e.match(A) || e.match(K) ? "builtin" : e.match(k) ? "variable" : (e.next(), v);
|
|
281
|
+
}
|
|
282
|
+
function _(e) {
|
|
283
|
+
var n = e.length == 1, r = "string";
|
|
284
|
+
return function(t, o) {
|
|
285
|
+
for (; !t.eol(); ) {
|
|
286
|
+
if (t.eatWhile(/[^'"]/), t.match(e))
|
|
287
|
+
return o.tokenize = l, r;
|
|
288
|
+
t.eat(/['"]/);
|
|
289
|
+
}
|
|
290
|
+
return n && (o.tokenize = l), r;
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
function H(e, n) {
|
|
294
|
+
var r = n.tokenize(e, n), t = e.current();
|
|
295
|
+
return t === "." ? (r = n.tokenize(e, n), t = e.current(), r && (r.substr(0, 8) === "variable" || r === "builtin" || r === "keyword") ? ((r === "builtin" || r === "keyword") && (r = "variable"), c.indexOf(t.substr(1)) > -1 && (r = "keyword"), r) : v) : r;
|
|
296
|
+
}
|
|
297
|
+
return {
|
|
298
|
+
name: "vbscript",
|
|
299
|
+
startState: function() {
|
|
300
|
+
return {
|
|
301
|
+
tokenize: l,
|
|
302
|
+
lastToken: null,
|
|
303
|
+
currentIndent: 0,
|
|
304
|
+
nextLineIndent: 0,
|
|
305
|
+
doInCurrentLine: !1,
|
|
306
|
+
ignoreKeyword: !1
|
|
307
|
+
};
|
|
308
|
+
},
|
|
309
|
+
token: function(e, n) {
|
|
310
|
+
e.sol() && (n.currentIndent += n.nextLineIndent, n.nextLineIndent = 0, n.doInCurrentLine = 0);
|
|
311
|
+
var r = H(e, n);
|
|
312
|
+
return n.lastToken = { style: r, content: e.current() }, r === null && (r = null), r;
|
|
313
|
+
},
|
|
314
|
+
indent: function(e, n, r) {
|
|
315
|
+
var t = n.replace(/^\s+|\s+$/g, "");
|
|
316
|
+
return t.match(d) || t.match(s) || t.match(b) ? r.unit * (e.currentIndent - 1) : e.currentIndent < 0 ? 0 : e.currentIndent * r.unit;
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
const J = p({}), U = p({ isASP: !0 });
|
|
321
|
+
export {
|
|
322
|
+
J as vbScript,
|
|
323
|
+
U as vbScriptASP
|
|
324
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
function u(n) {
|
|
2
|
+
for (var e = {}, i = n.split(" "), r = 0; r < i.length; ++r)
|
|
3
|
+
e[i[r]] = !0;
|
|
4
|
+
return e;
|
|
5
|
+
}
|
|
6
|
+
var s = u("#end #else #break #stop #[[ #]] #{end} #{else} #{break} #{stop}"), a = u("#if #elseif #foreach #set #include #parse #macro #define #evaluate #{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"), c = u("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent.count $foreach.parent.hasNext $foreach.parent.first $foreach.parent.last $foreach.parent $velocityCount $!bodyContent $bodyContent"), k = /[+\-*&%=<>!?:\/|]/;
|
|
7
|
+
function o(n, e, i) {
|
|
8
|
+
return e.tokenize = i, i(n, e);
|
|
9
|
+
}
|
|
10
|
+
function t(n, e) {
|
|
11
|
+
var i = e.beforeParams;
|
|
12
|
+
e.beforeParams = !1;
|
|
13
|
+
var r = n.next();
|
|
14
|
+
if (r == "'" && !e.inString && e.inParams)
|
|
15
|
+
return e.lastTokenWasBuiltin = !1, o(n, e, p(r));
|
|
16
|
+
if (r == '"') {
|
|
17
|
+
if (e.lastTokenWasBuiltin = !1, e.inString)
|
|
18
|
+
return e.inString = !1, "string";
|
|
19
|
+
if (e.inParams)
|
|
20
|
+
return o(n, e, p(r));
|
|
21
|
+
} else {
|
|
22
|
+
if (/[\[\]{}\(\),;\.]/.test(r))
|
|
23
|
+
return r == "(" && i ? e.inParams = !0 : r == ")" && (e.inParams = !1, e.lastTokenWasBuiltin = !0), null;
|
|
24
|
+
if (/\d/.test(r))
|
|
25
|
+
return e.lastTokenWasBuiltin = !1, n.eatWhile(/[\w\.]/), "number";
|
|
26
|
+
if (r == "#" && n.eat("*"))
|
|
27
|
+
return e.lastTokenWasBuiltin = !1, o(n, e, h);
|
|
28
|
+
if (r == "#" && n.match(/ *\[ *\[/))
|
|
29
|
+
return e.lastTokenWasBuiltin = !1, o(n, e, b);
|
|
30
|
+
if (r == "#" && n.eat("#"))
|
|
31
|
+
return e.lastTokenWasBuiltin = !1, n.skipToEnd(), "comment";
|
|
32
|
+
if (r == "$")
|
|
33
|
+
return n.eat("!"), n.eatWhile(/[\w\d\$_\.{}-]/), c && c.propertyIsEnumerable(n.current()) ? "keyword" : (e.lastTokenWasBuiltin = !0, e.beforeParams = !0, "builtin");
|
|
34
|
+
if (k.test(r))
|
|
35
|
+
return e.lastTokenWasBuiltin = !1, n.eatWhile(k), "operator";
|
|
36
|
+
n.eatWhile(/[\w\$_{}@]/);
|
|
37
|
+
var l = n.current();
|
|
38
|
+
return s && s.propertyIsEnumerable(l) ? "keyword" : a && a.propertyIsEnumerable(l) || n.current().match(/^#@?[a-z0-9_]+ *$/i) && n.peek() == "(" && !(a && a.propertyIsEnumerable(l.toLowerCase())) ? (e.beforeParams = !0, e.lastTokenWasBuiltin = !1, "keyword") : e.inString ? (e.lastTokenWasBuiltin = !1, "string") : n.pos > l.length && n.string.charAt(n.pos - l.length - 1) == "." && e.lastTokenWasBuiltin ? "builtin" : (e.lastTokenWasBuiltin = !1, null);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function p(n) {
|
|
42
|
+
return function(e, i) {
|
|
43
|
+
for (var r = !1, l, f = !1; (l = e.next()) != null; ) {
|
|
44
|
+
if (l == n && !r) {
|
|
45
|
+
f = !0;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
if (n == '"' && e.peek() == "$" && !r) {
|
|
49
|
+
i.inString = !0, f = !0;
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
r = !r && l == "\\";
|
|
53
|
+
}
|
|
54
|
+
return f && (i.tokenize = t), "string";
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function h(n, e) {
|
|
58
|
+
for (var i = !1, r; r = n.next(); ) {
|
|
59
|
+
if (r == "#" && i) {
|
|
60
|
+
e.tokenize = t;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
i = r == "*";
|
|
64
|
+
}
|
|
65
|
+
return "comment";
|
|
66
|
+
}
|
|
67
|
+
function b(n, e) {
|
|
68
|
+
for (var i = 0, r; r = n.next(); ) {
|
|
69
|
+
if (r == "#" && i == 2) {
|
|
70
|
+
e.tokenize = t;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
r == "]" ? i++ : r != " " && (i = 0);
|
|
74
|
+
}
|
|
75
|
+
return "meta";
|
|
76
|
+
}
|
|
77
|
+
const W = {
|
|
78
|
+
name: "velocity",
|
|
79
|
+
startState: function() {
|
|
80
|
+
return {
|
|
81
|
+
tokenize: t,
|
|
82
|
+
beforeParams: !1,
|
|
83
|
+
inParams: !1,
|
|
84
|
+
inString: !1,
|
|
85
|
+
lastTokenWasBuiltin: !1
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
token: function(n, e) {
|
|
89
|
+
return n.eatSpace() ? null : e.tokenize(n, e);
|
|
90
|
+
},
|
|
91
|
+
languageData: {
|
|
92
|
+
commentTokens: { line: "##", block: { open: "#*", close: "*#" } }
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
export {
|
|
96
|
+
W as velocity
|
|
97
|
+
};
|