@aiao/code-editor 0.0.7 → 0.0.8
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/apl-B2DGVGxc.js +76 -0
- package/dist/asciiarmor-2LVJmxlE.js +34 -0
- package/dist/asn1-jKiBa2Ya.js +95 -0
- package/dist/asterisk-DS281yxp.js +271 -0
- package/dist/brainfuck-C_p9pTT8.js +34 -0
- package/dist/clike-BMALKCNj.js +620 -0
- package/dist/clojure-CCKyeQKf.js +800 -0
- package/dist/cmake-CuaCgAKt.js +28 -0
- package/dist/cobol-BlTKFDRj.js +72 -0
- package/dist/coffeescript-BVCvwO8I.js +179 -0
- package/dist/commonlisp-D_kxz07b.js +75 -0
- package/dist/crystal-D309uH6_.js +217 -0
- package/dist/css-BkF-NPzE.js +1553 -0
- package/dist/cypher-BMq4Fwjl.js +68 -0
- package/dist/d-BZcgY6La.js +127 -0
- package/dist/diff-Cg9d_RX2.js +18 -0
- package/dist/dockerfile-DFX8bq9N.js +194 -0
- package/dist/dtd-CtLokQ-U.js +84 -0
- package/dist/dylan-QYeExnWK.js +234 -0
- package/dist/ebnf-DUPDuY4r.js +78 -0
- package/dist/ecl-CiXN-g_D.js +121 -0
- package/dist/eiffel-yQhjl4T1.js +110 -0
- package/dist/elm-CNT9vbN0.js +108 -0
- package/dist/erlang-CFOYdy9e.js +487 -0
- package/dist/factor-Clf6BoVk.js +65 -0
- package/dist/fcl-CPC2WYrI.js +103 -0
- package/dist/forth-BmxRyE9S.js +60 -0
- package/dist/fortran-9bvPyrOW.js +442 -0
- package/dist/gas-cpmYfFX2.js +183 -0
- package/dist/gherkin-CJuwpceU.js +34 -0
- package/dist/groovy-DZeT_VM-.js +146 -0
- package/dist/haskell-CxiO_7JL.js +375 -0
- package/dist/haxe-70NVW1pR.js +359 -0
- package/dist/http-D9LttvKF.js +44 -0
- package/dist/idl-B6TRFYjl.js +947 -0
- package/dist/index-BMiCCEB1.js +309 -0
- package/dist/index-BNuasEBW.js +94 -0
- package/dist/index-Bg1KDWyt.js +290 -0
- package/dist/index-BuVm7ZG6.js +1305 -0
- package/dist/index-BvS1cnHq.js +613 -0
- package/dist/index-C44L0DmY.js +138 -0
- package/dist/index-C71CZfUx.js +247 -0
- package/dist/index-CQ6JWNwi.js +566 -0
- package/dist/index-CpRVx97-.js +342 -0
- package/dist/index-CqvQj6d-.js +270 -0
- package/dist/index-CrbQBmWq.js +157 -0
- package/dist/index-CzovO10m.js +302 -0
- package/dist/index-D0BZOY-S.js +101 -0
- package/dist/index-D0svJS59.js +555 -0
- package/dist/index-D93XVMi1.js +136 -0
- package/dist/index-DEB5VK0f.js +252 -0
- package/dist/index-DIaXGPFp.js +12936 -0
- package/dist/index-Dp8osI_J.js +960 -0
- package/dist/index-Ds4AioqO.js +1918 -0
- package/dist/index-Dy-OpkyQ.js +76 -0
- package/dist/index-Dyi9rNIT.js +391 -0
- package/dist/index-ZJkjD9tT.js +74 -0
- package/dist/index-qH2lMs0G.js +945 -0
- package/dist/index-srIksFxX.js +59 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -1
- package/dist/javascript-DOuB9oqA.js +691 -0
- package/dist/julia-DpvXAuO6.js +241 -0
- package/dist/languages.d.ts +18 -0
- package/dist/languages.d.ts.map +1 -0
- package/dist/livescript-CanGTf8u.js +272 -0
- package/dist/lua-XplVlWi_.js +217 -0
- package/dist/mathematica-jaRHnSxC.js +35 -0
- package/dist/mbox-BctzC1hL.js +76 -0
- package/dist/mirc-CFBPAOaF.js +72 -0
- package/dist/mllike-BSnXJBGA.js +272 -0
- package/dist/modelica-vUgVs--1.js +93 -0
- package/dist/mscgen-Cpl0NYLN.js +104 -0
- package/dist/mumps-CQoS1kWX.js +25 -0
- package/dist/nginx-zDPm3Z74.js +89 -0
- package/dist/nsis-BCLyjY7m.js +62 -0
- package/dist/ntriples-CsNjv2QF.js +79 -0
- package/dist/octave-C8PmmSRH.js +143 -0
- package/dist/oz-Ce8aN8oE.js +151 -0
- package/dist/pascal-De0D6mP7.js +77 -0
- package/dist/perl-B4bSCe1C.js +915 -0
- package/dist/pig-D24Z8EXi.js +54 -0
- package/dist/powershell-DkYVfTzP.js +249 -0
- package/dist/properties-Dn9wna3M.js +26 -0
- package/dist/protobuf-BPIjwpzm.js +49 -0
- package/dist/pug-TGXr6c5j.js +248 -0
- package/dist/puppet-nyd4dhjf.js +45 -0
- package/dist/python-BkR3uSy8.js +313 -0
- package/dist/q-DyHZGnqm.js +86 -0
- package/dist/r-LKEuhEGI.js +104 -0
- package/dist/rpm-IznJm2Xc.js +57 -0
- package/dist/ruby-CcYfvIk6.js +228 -0
- package/dist/sas-7E8yHoCW.js +105 -0
- package/dist/scheme-DjibxsNh.js +124 -0
- package/dist/shell-C0C2sNA_.js +182 -0
- package/dist/sieve-Bwz7vjP5.js +72 -0
- package/dist/simple-mode-mNVtnu0l.js +89 -0
- package/dist/smalltalk-Bhddl2pB.js +48 -0
- package/dist/solr-BNlsLglM.js +41 -0
- package/dist/sparql-FarWu_Gb.js +197 -0
- package/dist/spreadsheet-C-cy4P5N.js +49 -0
- package/dist/sql-CfG5lQ3l.js +282 -0
- package/dist/stex-Du4h4KAU.js +129 -0
- package/dist/stylus-CAdqWld3.js +250 -0
- package/dist/swift-DSxqR9R6.js +230 -0
- package/dist/tcl-xfoLljhY.js +81 -0
- package/dist/textile-D1AWE-pc.js +295 -0
- package/dist/tiddlywiki-5wqsXtSk.js +155 -0
- package/dist/tiki-__Kn3CeS.js +181 -0
- package/dist/toml-DWAmxCjl.js +58 -0
- package/dist/troff-D2UO-fKf.js +35 -0
- package/dist/ttcn-Bsa4sfRm.js +123 -0
- package/dist/ttcn-cfg-Bac_acMi.js +88 -0
- package/dist/turtle-xwJUxoPV.js +80 -0
- package/dist/vb-c2kQGd6-.js +74 -0
- package/dist/vbscript-1f_Dhg5H.js +324 -0
- package/dist/velocity-DJd0pTTC.js +96 -0
- package/dist/verilog-CiS1jyi5.js +262 -0
- package/dist/vhdl-T9HkrbI2.js +106 -0
- package/dist/webidl-CjfDENEo.js +155 -0
- package/dist/xquery-Ct6lEb4B.js +422 -0
- package/dist/yacas-C0absKBh.js +73 -0
- package/dist/z80-Pki2zAjW.js +61 -0
- package/package.json +14 -8
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
function l(n) {
|
|
2
|
+
for (var e = {}, i = n.split(" "), r = 0; r < i.length; ++r) e[i[r]] = !0;
|
|
3
|
+
return e;
|
|
4
|
+
}
|
|
5
|
+
var f = l("if elsif else stop require"), p = l("true false not");
|
|
6
|
+
function t(n, e) {
|
|
7
|
+
var i = n.next();
|
|
8
|
+
if (i == "/" && n.eat("*"))
|
|
9
|
+
return e.tokenize = o, o(n, e);
|
|
10
|
+
if (i === "#")
|
|
11
|
+
return n.skipToEnd(), "comment";
|
|
12
|
+
if (i == '"')
|
|
13
|
+
return e.tokenize = d(i), e.tokenize(n, e);
|
|
14
|
+
if (i == "(")
|
|
15
|
+
return e._indent.push("("), e._indent.push("{"), null;
|
|
16
|
+
if (i === "{")
|
|
17
|
+
return e._indent.push("{"), null;
|
|
18
|
+
if (i == ")" && (e._indent.pop(), e._indent.pop()), i === "}")
|
|
19
|
+
return e._indent.pop(), null;
|
|
20
|
+
if (i == "," || i == ";" || /[{}\(\),;]/.test(i))
|
|
21
|
+
return null;
|
|
22
|
+
if (/\d/.test(i))
|
|
23
|
+
return n.eatWhile(/[\d]/), n.eat(/[KkMmGg]/), "number";
|
|
24
|
+
if (i == ":")
|
|
25
|
+
return n.eatWhile(/[a-zA-Z_]/), n.eatWhile(/[a-zA-Z0-9_]/), "operator";
|
|
26
|
+
n.eatWhile(/\w/);
|
|
27
|
+
var r = n.current();
|
|
28
|
+
return r == "text" && n.eat(":") ? (e.tokenize = k, "string") : f.propertyIsEnumerable(r) ? "keyword" : p.propertyIsEnumerable(r) ? "atom" : null;
|
|
29
|
+
}
|
|
30
|
+
function k(n, e) {
|
|
31
|
+
return e._multiLineString = !0, n.sol() ? (n.next() == "." && n.eol() && (e._multiLineString = !1, e.tokenize = t), "string") : (n.eatSpace(), n.peek() == "#" ? (n.skipToEnd(), "comment") : (n.skipToEnd(), "string"));
|
|
32
|
+
}
|
|
33
|
+
function o(n, e) {
|
|
34
|
+
for (var i = !1, r; (r = n.next()) != null; ) {
|
|
35
|
+
if (i && r == "/") {
|
|
36
|
+
e.tokenize = t;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
i = r == "*";
|
|
40
|
+
}
|
|
41
|
+
return "comment";
|
|
42
|
+
}
|
|
43
|
+
function d(n) {
|
|
44
|
+
return function(e, i) {
|
|
45
|
+
for (var r = !1, u; (u = e.next()) != null && !(u == n && !r); )
|
|
46
|
+
r = !r && u == "\\";
|
|
47
|
+
return r || (i.tokenize = t), "string";
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const c = {
|
|
51
|
+
name: "sieve",
|
|
52
|
+
startState: function(n) {
|
|
53
|
+
return {
|
|
54
|
+
tokenize: t,
|
|
55
|
+
baseIndent: n || 0,
|
|
56
|
+
_indent: []
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
token: function(n, e) {
|
|
60
|
+
return n.eatSpace() ? null : (e.tokenize || t)(n, e);
|
|
61
|
+
},
|
|
62
|
+
indent: function(n, e, i) {
|
|
63
|
+
var r = n._indent.length;
|
|
64
|
+
return e && e[0] == "}" && r--, r < 0 && (r = 0), r * i.unit;
|
|
65
|
+
},
|
|
66
|
+
languageData: {
|
|
67
|
+
indentOnInput: /^\s*\}$/
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
c as sieve
|
|
72
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
function k(n) {
|
|
2
|
+
c(n, "start");
|
|
3
|
+
var i = {}, e = n.languageData || {}, p = !1;
|
|
4
|
+
for (var d in n) if (d != e && n.hasOwnProperty(d))
|
|
5
|
+
for (var u = i[d] = [], r = n[d], t = 0; t < r.length; t++) {
|
|
6
|
+
var f = r[t];
|
|
7
|
+
u.push(new s(f, n)), (f.indent || f.dedent) && (p = !0);
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
name: e.name,
|
|
11
|
+
startState: function() {
|
|
12
|
+
return { state: "start", pending: null, indent: p ? [] : null };
|
|
13
|
+
},
|
|
14
|
+
copyState: function(o) {
|
|
15
|
+
var g = { state: o.state, pending: o.pending, indent: o.indent && o.indent.slice(0) };
|
|
16
|
+
return o.stack && (g.stack = o.stack.slice(0)), g;
|
|
17
|
+
},
|
|
18
|
+
token: l(i),
|
|
19
|
+
indent: x(i, e),
|
|
20
|
+
mergeTokens: e.mergeTokens,
|
|
21
|
+
languageData: e
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function c(n, i) {
|
|
25
|
+
if (!n.hasOwnProperty(i))
|
|
26
|
+
throw new Error("Undefined state " + i + " in simple mode");
|
|
27
|
+
}
|
|
28
|
+
function h(n, i) {
|
|
29
|
+
if (!n) return /(?:)/;
|
|
30
|
+
var e = "";
|
|
31
|
+
return n instanceof RegExp ? (n.ignoreCase && (e = "i"), n.unicode && (e += "u"), n = n.source) : n = String(n), new RegExp("^(?:" + n + ")", e);
|
|
32
|
+
}
|
|
33
|
+
function a(n) {
|
|
34
|
+
if (!n) return null;
|
|
35
|
+
if (n.apply) return n;
|
|
36
|
+
if (typeof n == "string") return n.replace(/\./g, " ");
|
|
37
|
+
for (var i = [], e = 0; e < n.length; e++)
|
|
38
|
+
i.push(n[e] && n[e].replace(/\./g, " "));
|
|
39
|
+
return i;
|
|
40
|
+
}
|
|
41
|
+
function s(n, i) {
|
|
42
|
+
(n.next || n.push) && c(i, n.next || n.push), this.regex = h(n.regex), this.token = a(n.token), this.data = n;
|
|
43
|
+
}
|
|
44
|
+
function l(n) {
|
|
45
|
+
return function(i, e) {
|
|
46
|
+
if (e.pending) {
|
|
47
|
+
var p = e.pending.shift();
|
|
48
|
+
return e.pending.length == 0 && (e.pending = null), i.pos += p.text.length, p.token;
|
|
49
|
+
}
|
|
50
|
+
for (var d = n[e.state], u = 0; u < d.length; u++) {
|
|
51
|
+
var r = d[u], t = (!r.data.sol || i.sol()) && i.match(r.regex);
|
|
52
|
+
if (t) {
|
|
53
|
+
r.data.next ? e.state = r.data.next : r.data.push ? ((e.stack || (e.stack = [])).push(e.state), e.state = r.data.push) : r.data.pop && e.stack && e.stack.length && (e.state = e.stack.pop()), r.data.indent && e.indent.push(i.indentation() + i.indentUnit), r.data.dedent && e.indent.pop();
|
|
54
|
+
var f = r.token;
|
|
55
|
+
if (f && f.apply && (f = f(t)), t.length > 2 && r.token && typeof r.token != "string") {
|
|
56
|
+
e.pending = [];
|
|
57
|
+
for (var o = 2; o < t.length; o++)
|
|
58
|
+
t[o] && e.pending.push({ text: t[o], token: r.token[o - 1] });
|
|
59
|
+
return i.backUp(t[0].length - (t[1] ? t[1].length : 0)), f[0];
|
|
60
|
+
} else return f && f.join ? f[0] : f;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return i.next(), null;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function x(n, i) {
|
|
67
|
+
return function(e, p) {
|
|
68
|
+
if (e.indent == null || i.dontIndentStates && i.dontIndentStates.indexOf(e.state) > -1)
|
|
69
|
+
return null;
|
|
70
|
+
var d = e.indent.length - 1, u = n[e.state];
|
|
71
|
+
n: for (; ; ) {
|
|
72
|
+
for (var r = 0; r < u.length; r++) {
|
|
73
|
+
var t = u[r];
|
|
74
|
+
if (t.data.dedent && t.data.dedentIfLineStart !== !1) {
|
|
75
|
+
var f = t.regex.exec(p);
|
|
76
|
+
if (f && f[0]) {
|
|
77
|
+
d--, (t.next || t.push) && (u = n[t.next || t.push]), p = p.slice(f[0].length);
|
|
78
|
+
continue n;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
return d < 0 ? 0 : e.indent[d];
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
export {
|
|
88
|
+
k as s
|
|
89
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var o = /[+\-\/\\*~<>=@%|&?!.,:;^]/, p = /true|false|nil|self|super|thisContext/, l = function(e, n) {
|
|
2
|
+
this.next = e, this.parent = n;
|
|
3
|
+
}, r = function(e, n, t) {
|
|
4
|
+
this.name = e, this.context = n, this.eos = t;
|
|
5
|
+
}, c = function() {
|
|
6
|
+
this.context = new l(h, null), this.expectVariable = !0, this.indentation = 0, this.userIndentationDelta = 0;
|
|
7
|
+
};
|
|
8
|
+
c.prototype.userIndent = function(e, n) {
|
|
9
|
+
this.userIndentationDelta = e > 0 ? e / n - this.indentation : 0;
|
|
10
|
+
};
|
|
11
|
+
var h = function(e, n, t) {
|
|
12
|
+
var i = new r(null, n, !1), a = e.next();
|
|
13
|
+
return a === '"' ? i = u(e, new l(u, n)) : a === "'" ? i = s(e, new l(s, n)) : a === "#" ? e.peek() === "'" ? (e.next(), i = f(e, new l(f, n))) : e.eatWhile(/[^\s.{}\[\]()]/) ? i.name = "string.special" : i.name = "meta" : a === "$" ? (e.next() === "<" && (e.eatWhile(/[^\s>]/), e.next()), i.name = "string.special") : a === "|" && t.expectVariable ? i.context = new l(x, n) : /[\[\]{}()]/.test(a) ? (i.name = "bracket", i.eos = /[\[{(]/.test(a), a === "[" ? t.indentation++ : a === "]" && (t.indentation = Math.max(0, t.indentation - 1))) : o.test(a) ? (e.eatWhile(o), i.name = "operator", i.eos = a !== ";") : /\d/.test(a) ? (e.eatWhile(/[\w\d]/), i.name = "number") : /[\w_]/.test(a) ? (e.eatWhile(/[\w\d_]/), i.name = t.expectVariable ? p.test(e.current()) ? "keyword" : "variable" : null) : i.eos = t.expectVariable, i;
|
|
14
|
+
}, u = function(e, n) {
|
|
15
|
+
return e.eatWhile(/[^"]/), new r("comment", e.eat('"') ? n.parent : n, !0);
|
|
16
|
+
}, s = function(e, n) {
|
|
17
|
+
return e.eatWhile(/[^']/), new r("string", e.eat("'") ? n.parent : n, !1);
|
|
18
|
+
}, f = function(e, n) {
|
|
19
|
+
return e.eatWhile(/[^']/), new r("string.special", e.eat("'") ? n.parent : n, !1);
|
|
20
|
+
}, x = function(e, n) {
|
|
21
|
+
var t = new r(null, n, !1), i = e.next();
|
|
22
|
+
return i === "|" ? (t.context = n.parent, t.eos = !0) : (e.eatWhile(/[^|]/), t.name = "variable"), t;
|
|
23
|
+
};
|
|
24
|
+
const d = {
|
|
25
|
+
name: "smalltalk",
|
|
26
|
+
startState: function() {
|
|
27
|
+
return new c();
|
|
28
|
+
},
|
|
29
|
+
token: function(e, n) {
|
|
30
|
+
if (n.userIndent(e.indentation(), e.indentUnit), e.eatSpace())
|
|
31
|
+
return null;
|
|
32
|
+
var t = n.context.next(e, n.context, n);
|
|
33
|
+
return n.context = t.context, n.expectVariable = t.eos, t.name;
|
|
34
|
+
},
|
|
35
|
+
blankLine: function(e, n) {
|
|
36
|
+
e.userIndent(0, n);
|
|
37
|
+
},
|
|
38
|
+
indent: function(e, n, t) {
|
|
39
|
+
var i = e.context.next === h && n && n.charAt(0) === "]" ? -1 : e.userIndentationDelta;
|
|
40
|
+
return (e.indentation + i) * t.unit;
|
|
41
|
+
},
|
|
42
|
+
languageData: {
|
|
43
|
+
indentOnInput: /^\s*\]$/
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
d as smalltalk
|
|
48
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var u = /[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}\"\\]/, f = /[\|\!\+\-\*\?\~\^\&]/, l = /^(OR|AND|NOT|TO)$/;
|
|
2
|
+
function k(n) {
|
|
3
|
+
return parseFloat(n).toString() === n;
|
|
4
|
+
}
|
|
5
|
+
function a(n) {
|
|
6
|
+
return function(e, r) {
|
|
7
|
+
for (var t = !1, o; (o = e.next()) != null && !(o == n && !t); )
|
|
8
|
+
t = !t && o == "\\";
|
|
9
|
+
return t || (r.tokenize = i), "string";
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function c(n) {
|
|
13
|
+
return function(e, r) {
|
|
14
|
+
return n == "|" ? e.eat(/\|/) : n == "&" && e.eat(/\&/), r.tokenize = i, "operator";
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function s(n) {
|
|
18
|
+
return function(e, r) {
|
|
19
|
+
for (var t = n; (n = e.peek()) && n.match(u) != null; )
|
|
20
|
+
t += e.next();
|
|
21
|
+
return r.tokenize = i, l.test(t) ? "operator" : k(t) ? "number" : e.peek() == ":" ? "propertyName" : "string";
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function i(n, e) {
|
|
25
|
+
var r = n.next();
|
|
26
|
+
return r == '"' ? e.tokenize = a(r) : f.test(r) ? e.tokenize = c(r) : u.test(r) && (e.tokenize = s(r)), e.tokenize != i ? e.tokenize(n, e) : null;
|
|
27
|
+
}
|
|
28
|
+
const p = {
|
|
29
|
+
name: "solr",
|
|
30
|
+
startState: function() {
|
|
31
|
+
return {
|
|
32
|
+
tokenize: i
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
token: function(n, e) {
|
|
36
|
+
return n.eatSpace() ? null : e.tokenize(n, e);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
p as solr
|
|
41
|
+
};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
var u;
|
|
2
|
+
function s(n) {
|
|
3
|
+
return new RegExp("^(?:" + n.join("|") + ")$", "i");
|
|
4
|
+
}
|
|
5
|
+
var d = s([
|
|
6
|
+
"str",
|
|
7
|
+
"lang",
|
|
8
|
+
"langmatches",
|
|
9
|
+
"datatype",
|
|
10
|
+
"bound",
|
|
11
|
+
"sameterm",
|
|
12
|
+
"isiri",
|
|
13
|
+
"isuri",
|
|
14
|
+
"iri",
|
|
15
|
+
"uri",
|
|
16
|
+
"bnode",
|
|
17
|
+
"count",
|
|
18
|
+
"sum",
|
|
19
|
+
"min",
|
|
20
|
+
"max",
|
|
21
|
+
"avg",
|
|
22
|
+
"sample",
|
|
23
|
+
"group_concat",
|
|
24
|
+
"rand",
|
|
25
|
+
"abs",
|
|
26
|
+
"ceil",
|
|
27
|
+
"floor",
|
|
28
|
+
"round",
|
|
29
|
+
"concat",
|
|
30
|
+
"substr",
|
|
31
|
+
"strlen",
|
|
32
|
+
"replace",
|
|
33
|
+
"ucase",
|
|
34
|
+
"lcase",
|
|
35
|
+
"encode_for_uri",
|
|
36
|
+
"contains",
|
|
37
|
+
"strstarts",
|
|
38
|
+
"strends",
|
|
39
|
+
"strbefore",
|
|
40
|
+
"strafter",
|
|
41
|
+
"year",
|
|
42
|
+
"month",
|
|
43
|
+
"day",
|
|
44
|
+
"hours",
|
|
45
|
+
"minutes",
|
|
46
|
+
"seconds",
|
|
47
|
+
"timezone",
|
|
48
|
+
"tz",
|
|
49
|
+
"now",
|
|
50
|
+
"uuid",
|
|
51
|
+
"struuid",
|
|
52
|
+
"md5",
|
|
53
|
+
"sha1",
|
|
54
|
+
"sha256",
|
|
55
|
+
"sha384",
|
|
56
|
+
"sha512",
|
|
57
|
+
"coalesce",
|
|
58
|
+
"if",
|
|
59
|
+
"strlang",
|
|
60
|
+
"strdt",
|
|
61
|
+
"isnumeric",
|
|
62
|
+
"regex",
|
|
63
|
+
"exists",
|
|
64
|
+
"isblank",
|
|
65
|
+
"isliteral",
|
|
66
|
+
"a",
|
|
67
|
+
"bind"
|
|
68
|
+
]), F = s([
|
|
69
|
+
"base",
|
|
70
|
+
"prefix",
|
|
71
|
+
"select",
|
|
72
|
+
"distinct",
|
|
73
|
+
"reduced",
|
|
74
|
+
"construct",
|
|
75
|
+
"describe",
|
|
76
|
+
"ask",
|
|
77
|
+
"from",
|
|
78
|
+
"named",
|
|
79
|
+
"where",
|
|
80
|
+
"order",
|
|
81
|
+
"limit",
|
|
82
|
+
"offset",
|
|
83
|
+
"filter",
|
|
84
|
+
"optional",
|
|
85
|
+
"graph",
|
|
86
|
+
"by",
|
|
87
|
+
"asc",
|
|
88
|
+
"desc",
|
|
89
|
+
"as",
|
|
90
|
+
"having",
|
|
91
|
+
"undef",
|
|
92
|
+
"values",
|
|
93
|
+
"group",
|
|
94
|
+
"minus",
|
|
95
|
+
"in",
|
|
96
|
+
"not",
|
|
97
|
+
"service",
|
|
98
|
+
"silent",
|
|
99
|
+
"using",
|
|
100
|
+
"insert",
|
|
101
|
+
"delete",
|
|
102
|
+
"union",
|
|
103
|
+
"true",
|
|
104
|
+
"false",
|
|
105
|
+
"with",
|
|
106
|
+
"data",
|
|
107
|
+
"copy",
|
|
108
|
+
"to",
|
|
109
|
+
"move",
|
|
110
|
+
"add",
|
|
111
|
+
"create",
|
|
112
|
+
"drop",
|
|
113
|
+
"clear",
|
|
114
|
+
"load",
|
|
115
|
+
"into"
|
|
116
|
+
]), x = /[*+\-<>=&|\^\/!\?]/, a = "[A-Za-z_\\-0-9]", h = new RegExp("[A-Za-z]"), g = new RegExp("((" + a + "|\\.)*(" + a + "))?:");
|
|
117
|
+
function p(n, e) {
|
|
118
|
+
var t = n.next();
|
|
119
|
+
if (u = null, t == "$" || t == "?")
|
|
120
|
+
return t == "?" && n.match(/\s/, !1) ? "operator" : (n.match(/^[A-Za-z0-9_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][A-Za-z0-9_\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]*/), "variableName.local");
|
|
121
|
+
if (t == "<" && !n.match(/^[\s\u00a0=]/, !1))
|
|
122
|
+
return n.match(/^[^\s\u00a0>]*>?/), "atom";
|
|
123
|
+
if (t == '"' || t == "'")
|
|
124
|
+
return e.tokenize = v(t), e.tokenize(n, e);
|
|
125
|
+
if (/[{}\(\),\.;\[\]]/.test(t))
|
|
126
|
+
return u = t, "bracket";
|
|
127
|
+
if (t == "#")
|
|
128
|
+
return n.skipToEnd(), "comment";
|
|
129
|
+
if (x.test(t))
|
|
130
|
+
return "operator";
|
|
131
|
+
if (t == ":")
|
|
132
|
+
return f(n), "atom";
|
|
133
|
+
if (t == "@")
|
|
134
|
+
return n.eatWhile(/[a-z\d\-]/i), "meta";
|
|
135
|
+
if (h.test(t) && n.match(g))
|
|
136
|
+
return f(n), "atom";
|
|
137
|
+
n.eatWhile(/[_\w\d]/);
|
|
138
|
+
var i = n.current();
|
|
139
|
+
return d.test(i) ? "builtin" : F.test(i) ? "keyword" : "variable";
|
|
140
|
+
}
|
|
141
|
+
function f(n) {
|
|
142
|
+
n.match(/(\.(?=[\w_\-\\%])|[:\w_-]|\\[-\\_~.!$&'()*+,;=/?#@%]|%[a-f\d][a-f\d])+/i);
|
|
143
|
+
}
|
|
144
|
+
function v(n) {
|
|
145
|
+
return function(e, t) {
|
|
146
|
+
for (var i = !1, r; (r = e.next()) != null; ) {
|
|
147
|
+
if (r == n && !i) {
|
|
148
|
+
t.tokenize = p;
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
i = !i && r == "\\";
|
|
152
|
+
}
|
|
153
|
+
return "string";
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function o(n, e, t) {
|
|
157
|
+
n.context = { prev: n.context, indent: n.indent, col: t, type: e };
|
|
158
|
+
}
|
|
159
|
+
function c(n) {
|
|
160
|
+
n.indent = n.context.indent, n.context = n.context.prev;
|
|
161
|
+
}
|
|
162
|
+
const m = {
|
|
163
|
+
name: "sparql",
|
|
164
|
+
startState: function() {
|
|
165
|
+
return {
|
|
166
|
+
tokenize: p,
|
|
167
|
+
context: null,
|
|
168
|
+
indent: 0,
|
|
169
|
+
col: 0
|
|
170
|
+
};
|
|
171
|
+
},
|
|
172
|
+
token: function(n, e) {
|
|
173
|
+
if (n.sol() && (e.context && e.context.align == null && (e.context.align = !1), e.indent = n.indentation()), n.eatSpace()) return null;
|
|
174
|
+
var t = e.tokenize(n, e);
|
|
175
|
+
if (t != "comment" && e.context && e.context.align == null && e.context.type != "pattern" && (e.context.align = !0), u == "(") o(e, ")", n.column());
|
|
176
|
+
else if (u == "[") o(e, "]", n.column());
|
|
177
|
+
else if (u == "{") o(e, "}", n.column());
|
|
178
|
+
else if (/[\]\}\)]/.test(u)) {
|
|
179
|
+
for (; e.context && e.context.type == "pattern"; ) c(e);
|
|
180
|
+
e.context && u == e.context.type && (c(e), u == "}" && e.context && e.context.type == "pattern" && c(e));
|
|
181
|
+
} else u == "." && e.context && e.context.type == "pattern" ? c(e) : /atom|string|variable/.test(t) && e.context && (/[\}\]]/.test(e.context.type) ? o(e, "pattern", n.column()) : e.context.type == "pattern" && !e.context.align && (e.context.align = !0, e.context.col = n.column()));
|
|
182
|
+
return t;
|
|
183
|
+
},
|
|
184
|
+
indent: function(n, e, t) {
|
|
185
|
+
var i = e && e.charAt(0), r = n.context;
|
|
186
|
+
if (/[\]\}]/.test(i))
|
|
187
|
+
for (; r && r.type == "pattern"; ) r = r.prev;
|
|
188
|
+
var l = r && i == r.type;
|
|
189
|
+
return r ? r.type == "pattern" ? r.col : r.align ? r.col + (l ? 0 : 1) : r.indent + (l ? 0 : t.unit) : 0;
|
|
190
|
+
},
|
|
191
|
+
languageData: {
|
|
192
|
+
commentTokens: { line: "#" }
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
export {
|
|
196
|
+
m as sparql
|
|
197
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const i = {
|
|
2
|
+
name: "spreadsheet",
|
|
3
|
+
startState: function() {
|
|
4
|
+
return {
|
|
5
|
+
stringType: null,
|
|
6
|
+
stack: []
|
|
7
|
+
};
|
|
8
|
+
},
|
|
9
|
+
token: function(e, n) {
|
|
10
|
+
if (e) {
|
|
11
|
+
switch (n.stack.length === 0 && (e.peek() == '"' || e.peek() == "'") && (n.stringType = e.peek(), e.next(), n.stack.unshift("string")), n.stack[0]) {
|
|
12
|
+
case "string":
|
|
13
|
+
for (; n.stack[0] === "string" && !e.eol(); )
|
|
14
|
+
e.peek() === n.stringType ? (e.next(), n.stack.shift()) : e.peek() === "\\" ? (e.next(), e.next()) : e.match(/^.[^\\\"\']*/);
|
|
15
|
+
return "string";
|
|
16
|
+
case "characterClass":
|
|
17
|
+
for (; n.stack[0] === "characterClass" && !e.eol(); )
|
|
18
|
+
e.match(/^[^\]\\]+/) || e.match(/^\\./) || n.stack.shift();
|
|
19
|
+
return "operator";
|
|
20
|
+
}
|
|
21
|
+
var c = e.peek();
|
|
22
|
+
switch (c) {
|
|
23
|
+
case "[":
|
|
24
|
+
return e.next(), n.stack.unshift("characterClass"), "bracket";
|
|
25
|
+
case ":":
|
|
26
|
+
return e.next(), "operator";
|
|
27
|
+
case "\\":
|
|
28
|
+
return e.match(/\\[a-z]+/) ? "string.special" : (e.next(), "atom");
|
|
29
|
+
case ".":
|
|
30
|
+
case ",":
|
|
31
|
+
case ";":
|
|
32
|
+
case "*":
|
|
33
|
+
case "-":
|
|
34
|
+
case "+":
|
|
35
|
+
case "^":
|
|
36
|
+
case "<":
|
|
37
|
+
case "/":
|
|
38
|
+
case "=":
|
|
39
|
+
return e.next(), "atom";
|
|
40
|
+
case "$":
|
|
41
|
+
return e.next(), "builtin";
|
|
42
|
+
}
|
|
43
|
+
return e.match(/\d+/) ? e.match(/^\w+/) ? "error" : "number" : e.match(/^[a-zA-Z_]\w*/) ? e.match(/(?=[\(.])/, !1) ? "keyword" : "variable" : ["[", "]", "(", ")", "{", "}"].indexOf(c) != -1 ? (e.next(), "bracket") : (e.eatSpace() || e.next(), null);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
i as spreadsheet
|
|
49
|
+
};
|