zs_library 0.4.6 → 0.4.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.
Files changed (118) hide show
  1. package/dist/apl-DzB7vleG.js +77 -0
  2. package/dist/asciiarmor-GBg_dTix.js +35 -0
  3. package/dist/asn1-C3znSLx9.js +96 -0
  4. package/dist/asterisk-DlqRFsge.js +272 -0
  5. package/dist/brainfuck-BRsrPeoO.js +35 -0
  6. package/dist/clike-BvRdj3ii.js +621 -0
  7. package/dist/clojure-DoHCnq3P.js +801 -0
  8. package/dist/cmake-lga2BQKc.js +29 -0
  9. package/dist/cobol-CoUZEClC.js +73 -0
  10. package/dist/coffeescript-DtzhVgPb.js +180 -0
  11. package/dist/commonlisp-Dczl5pgK.js +76 -0
  12. package/dist/crystal-CGcK8mnw.js +218 -0
  13. package/dist/css-BSROsPdq.js +1561 -0
  14. package/dist/cypher-DtSMl1Mv.js +69 -0
  15. package/dist/d-Dvhr70b-.js +128 -0
  16. package/dist/diff-CGwDp7kO.js +19 -0
  17. package/dist/dockerfile-comEO-T6.js +195 -0
  18. package/dist/dtd-CCHJ68ra.js +85 -0
  19. package/dist/dylan-DuvcMu5H.js +235 -0
  20. package/dist/ebnf-40BT7kIS.js +79 -0
  21. package/dist/ecl-D1uoNQJW.js +122 -0
  22. package/dist/eiffel-5pGo0kXa.js +111 -0
  23. package/dist/elm-BaiVOLJD.js +109 -0
  24. package/dist/erlang-CkzodiGe.js +488 -0
  25. package/dist/factor-BOXOAn_M.js +66 -0
  26. package/dist/fcl-BpnTn_eU.js +104 -0
  27. package/dist/forth-DErAeAEb.js +61 -0
  28. package/dist/fortran-D2-6KpzO.js +443 -0
  29. package/dist/gas-DyEPANLH.js +184 -0
  30. package/dist/gherkin-Drt_srgO.js +35 -0
  31. package/dist/groovy-BMVfw_nf.js +147 -0
  32. package/dist/haskell-hWhKnZO1.js +376 -0
  33. package/dist/haxe-B1MRfS0p.js +360 -0
  34. package/dist/http-DmgKxj-g.js +45 -0
  35. package/dist/idl-DqZ86h3r.js +948 -0
  36. package/dist/index-5dj8r7GK.js +266 -0
  37. package/dist/index-BTXiadLB.js +309 -0
  38. package/dist/index-BlC4-BmN.js +72 -0
  39. package/dist/index-BrFeP3fX.js +244 -0
  40. package/dist/index-Bto4OncH.js +539 -0
  41. package/dist/index-Bvv7YkGe.js +136 -0
  42. package/dist/index-Bx4MkRG_.js +76 -0
  43. package/dist/index-CVOhQMF3.js +608 -0
  44. package/dist/index-CecD8NGL.js +228472 -0
  45. package/dist/index-CmoZmAhh.js +289 -0
  46. package/dist/index-DE3hmKbB.js +135 -0
  47. package/dist/index-DF7XjAxV.js +94 -0
  48. package/dist/index-DcChItCb.js +157 -0
  49. package/dist/index-Dl5DpQ2k.js +342 -0
  50. package/dist/index-Dpbxeq5U.js +59 -0
  51. package/dist/index-gpJmCEdM.js +99 -0
  52. package/dist/index-udH8R_K0.js +300 -0
  53. package/dist/{zs_library.css → index.css} +1 -1
  54. package/dist/index.js +9 -0
  55. package/dist/javascript-BvuVDFxD.js +691 -0
  56. package/dist/jinja2-sU0UaYnG.js +155 -0
  57. package/dist/julia-3_lRZPrK.js +242 -0
  58. package/dist/livescript-BeDiX_lv.js +273 -0
  59. package/dist/lua-DsgFLpii.js +218 -0
  60. package/dist/mathematica-1GSq-6KQ.js +36 -0
  61. package/dist/mbox-agttEgFX.js +77 -0
  62. package/dist/mirc-0mTi20sq.js +73 -0
  63. package/dist/mllike-Cn3QD1L6.js +273 -0
  64. package/dist/modelica-zXUsSMFb.js +94 -0
  65. package/dist/mscgen-CjqYDKLG.js +105 -0
  66. package/dist/mumps-o2cuacx9.js +26 -0
  67. package/dist/nginx-BwTpvSVN.js +90 -0
  68. package/dist/nsis-BuRdhAu4.js +63 -0
  69. package/dist/ntriples-DrgMTIhT.js +80 -0
  70. package/dist/octave-Cxdtf9mO.js +144 -0
  71. package/dist/oz-DFmTw-qE.js +152 -0
  72. package/dist/pascal-DXxn4Ogv.js +78 -0
  73. package/dist/perl-C73cx1ym.js +916 -0
  74. package/dist/pig-Bb8sMbk0.js +55 -0
  75. package/dist/powershell-DxmufwKU.js +250 -0
  76. package/dist/properties-C4fhBR7T.js +27 -0
  77. package/dist/protobuf-Eqae3kep.js +50 -0
  78. package/dist/pug-Cdoid33I.js +249 -0
  79. package/dist/puppet-BH84QZvC.js +46 -0
  80. package/dist/python-D32-_XsH.js +314 -0
  81. package/dist/q-CDvEpNHY.js +84 -0
  82. package/dist/r-D9TtEI-G.js +105 -0
  83. package/dist/rpm-Ckejt31K.js +58 -0
  84. package/dist/ruby-gRVA_lpr.js +229 -0
  85. package/dist/sas-Cetv6MtF.js +106 -0
  86. package/dist/scheme-BpAxUIwV.js +125 -0
  87. package/dist/shell-DmARhv5h.js +183 -0
  88. package/dist/sieve-DJENs6f1.js +73 -0
  89. package/dist/simple-mode-B0kVDhR7.js +89 -0
  90. package/dist/smalltalk-CtRR6guu.js +49 -0
  91. package/dist/solr-ZVIJNGhC.js +42 -0
  92. package/dist/sparql-Cg1WYQva.js +198 -0
  93. package/dist/spreadsheet-Bi94Lk_2.js +50 -0
  94. package/dist/sql-BLhvp4JJ.js +283 -0
  95. package/dist/stex-DuReG47O.js +130 -0
  96. package/dist/stylus-D5QpSSbb.js +251 -0
  97. package/dist/swift-CZplZXOW.js +231 -0
  98. package/dist/tcl-COiqjz-O.js +82 -0
  99. package/dist/textile-BIDpYsbD.js +296 -0
  100. package/dist/tiddlywiki-C4woD_uK.js +156 -0
  101. package/dist/tiki-Ddj0Z2aQ.js +182 -0
  102. package/dist/toml-Byr0PaXO.js +50 -0
  103. package/dist/troff-BEvN8lSw.js +36 -0
  104. package/dist/ttcn-CyeSpuPS.js +124 -0
  105. package/dist/ttcn-cfg-C4JBLVfg.js +89 -0
  106. package/dist/turtle-8qSCc9Tc.js +81 -0
  107. package/dist/vb-BOJI7cFm.js +75 -0
  108. package/dist/vbscript-Cu6iG9pw.js +325 -0
  109. package/dist/velocity-BEpFYT7L.js +97 -0
  110. package/dist/verilog-BBxq08Rh.js +264 -0
  111. package/dist/vhdl-B0tZHMGi.js +107 -0
  112. package/dist/webidl-CW91NtvY.js +156 -0
  113. package/dist/xquery-DzC9wL36.js +423 -0
  114. package/dist/yacas-lKwNB4DM.js +74 -0
  115. package/dist/z80-Bq0fiCqy.js +62 -0
  116. package/package.json +146 -146
  117. package/dist/index.es.js +0 -10618
  118. package/dist/index.umd.js +0 -701
@@ -0,0 +1,155 @@
1
+ import "./index.css";
2
+ var l = [
3
+ "and",
4
+ "as",
5
+ "block",
6
+ "endblock",
7
+ "by",
8
+ "cycle",
9
+ "debug",
10
+ "else",
11
+ "elif",
12
+ "extends",
13
+ "filter",
14
+ "endfilter",
15
+ "firstof",
16
+ "do",
17
+ "for",
18
+ "endfor",
19
+ "if",
20
+ "endif",
21
+ "ifchanged",
22
+ "endifchanged",
23
+ "ifequal",
24
+ "endifequal",
25
+ "ifnotequal",
26
+ "set",
27
+ "raw",
28
+ "endraw",
29
+ "endifnotequal",
30
+ "in",
31
+ "include",
32
+ "load",
33
+ "not",
34
+ "now",
35
+ "or",
36
+ "parsed",
37
+ "regroup",
38
+ "reversed",
39
+ "spaceless",
40
+ "call",
41
+ "endcall",
42
+ "macro",
43
+ "endmacro",
44
+ "endspaceless",
45
+ "ssi",
46
+ "templatetag",
47
+ "openblock",
48
+ "closeblock",
49
+ "openvariable",
50
+ "closevariable",
51
+ "without",
52
+ "context",
53
+ "openbrace",
54
+ "closebrace",
55
+ "opencomment",
56
+ "closecomment",
57
+ "widthratio",
58
+ "url",
59
+ "with",
60
+ "endwith",
61
+ "get_current_language",
62
+ "trans",
63
+ "endtrans",
64
+ "noop",
65
+ "blocktrans",
66
+ "endblocktrans",
67
+ "get_available_languages",
68
+ "get_current_language_bidi",
69
+ "pluralize",
70
+ "autoescape",
71
+ "endautoescape"
72
+ ], c = /^[+\-*&%=<>!?|~^]/, f = /^[:\[\(\{]/, o = ["true", "false"], r = /^(\d[+\-\*\/])?\d+(\.\d+)?/;
73
+ l = new RegExp("((" + l.join(")|(") + "))\\b");
74
+ o = new RegExp("((" + o.join(")|(") + "))\\b");
75
+ function u(n, e) {
76
+ var i = n.peek();
77
+ if (e.incomment)
78
+ return n.skipTo("#}") ? (n.eatWhile(/\#|}/), e.incomment = !1) : n.skipToEnd(), "comment";
79
+ if (e.intag) {
80
+ if (e.operator) {
81
+ if (e.operator = !1, n.match(o))
82
+ return "atom";
83
+ if (n.match(r))
84
+ return "number";
85
+ }
86
+ if (e.sign) {
87
+ if (e.sign = !1, n.match(o))
88
+ return "atom";
89
+ if (n.match(r))
90
+ return "number";
91
+ }
92
+ if (e.instring)
93
+ return i == e.instring && (e.instring = !1), n.next(), "string";
94
+ if (i == "'" || i == '"')
95
+ return e.instring = i, n.next(), "string";
96
+ if (e.inbraces > 0 && i == ")")
97
+ n.next(), e.inbraces--;
98
+ else if (i == "(")
99
+ n.next(), e.inbraces++;
100
+ else if (e.inbrackets > 0 && i == "]")
101
+ n.next(), e.inbrackets--;
102
+ else if (i == "[")
103
+ n.next(), e.inbrackets++;
104
+ else {
105
+ if (!e.lineTag && (n.match(e.intag + "}") || n.eat("-") && n.match(e.intag + "}")))
106
+ return e.intag = !1, "tag";
107
+ if (n.match(c))
108
+ return e.operator = !0, "operator";
109
+ if (n.match(f))
110
+ e.sign = !0;
111
+ else {
112
+ if (n.column() == 1 && e.lineTag && n.match(l))
113
+ return "keyword";
114
+ if (n.eat(" ") || n.sol()) {
115
+ if (n.match(l))
116
+ return "keyword";
117
+ if (n.match(o))
118
+ return "atom";
119
+ if (n.match(r))
120
+ return "number";
121
+ n.sol() && n.next();
122
+ } else
123
+ n.next();
124
+ }
125
+ }
126
+ return "variable";
127
+ } else if (n.eat("{")) {
128
+ if (n.eat("#"))
129
+ return e.incomment = !0, n.skipTo("#}") ? (n.eatWhile(/\#|}/), e.incomment = !1) : n.skipToEnd(), "comment";
130
+ if (i = n.eat(/\{|%/))
131
+ return e.intag = i, e.inbraces = 0, e.inbrackets = 0, i == "{" && (e.intag = "}"), n.eat("-"), "tag";
132
+ } else if (n.eat("#")) {
133
+ if (n.peek() == "#")
134
+ return n.skipToEnd(), "comment";
135
+ if (!n.eol())
136
+ return e.intag = !0, e.lineTag = !0, e.inbraces = 0, e.inbrackets = 0, "tag";
137
+ }
138
+ n.next();
139
+ }
140
+ const g = {
141
+ name: "jinja2",
142
+ startState: function() {
143
+ return { tokenize: u, inbrackets: 0, inbraces: 0 };
144
+ },
145
+ token: function(n, e) {
146
+ var i = e.tokenize(n, e);
147
+ return n.eol() && e.lineTag && !e.instring && e.inbraces == 0 && e.inbrackets == 0 && (e.intag = !1, e.lineTag = !1), i;
148
+ },
149
+ languageData: {
150
+ commentTokens: { block: { open: "{#", close: "#}", line: "##" } }
151
+ }
152
+ };
153
+ export {
154
+ g as jinja2
155
+ };
@@ -0,0 +1,242 @@
1
+ import "./index.css";
2
+ function o(e, n, i) {
3
+ return typeof i > "u" && (i = ""), typeof n > "u" && (n = "\\b"), new RegExp("^" + i + "((" + e.join(")|(") + "))" + n);
4
+ }
5
+ var v = "\\\\[0-7]{1,3}", k = "\\\\x[A-Fa-f0-9]{1,2}", F = `\\\\[abefnrtv0%?'"\\\\]`, g = "([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])", a = [
6
+ "[<>]:",
7
+ "[<>=]=",
8
+ "<<=?",
9
+ ">>>?=?",
10
+ "=>",
11
+ "--?>",
12
+ "<--[->]?",
13
+ "\\/\\/",
14
+ "\\.{2,3}",
15
+ "[\\.\\\\%*+\\-<>!\\/^|&]=?",
16
+ "\\?",
17
+ "\\$",
18
+ "~",
19
+ ":"
20
+ ], b = o([
21
+ "[<>]:",
22
+ "[<>=]=",
23
+ "[!=]==",
24
+ "<<=?",
25
+ ">>>?=?",
26
+ "=>?",
27
+ "--?>",
28
+ "<--[->]?",
29
+ "\\/\\/",
30
+ "[\\\\%*+\\-<>!\\/^|&\\u00F7\\u22BB]=?",
31
+ "\\?",
32
+ "\\$",
33
+ "~",
34
+ ":",
35
+ "\\u00D7",
36
+ "\\u2208",
37
+ "\\u2209",
38
+ "\\u220B",
39
+ "\\u220C",
40
+ "\\u2218",
41
+ "\\u221A",
42
+ "\\u221B",
43
+ "\\u2229",
44
+ "\\u222A",
45
+ "\\u2260",
46
+ "\\u2264",
47
+ "\\u2265",
48
+ "\\u2286",
49
+ "\\u2288",
50
+ "\\u228A",
51
+ "\\u22C5",
52
+ "\\b(in|isa)\\b(?!.?\\()"
53
+ ], ""), y = /^[;,()[\]{}]/, m = /^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/, x = o([v, k, F, g], "'"), z = [
54
+ "begin",
55
+ "function",
56
+ "type",
57
+ "struct",
58
+ "immutable",
59
+ "let",
60
+ "macro",
61
+ "for",
62
+ "while",
63
+ "quote",
64
+ "if",
65
+ "else",
66
+ "elseif",
67
+ "try",
68
+ "finally",
69
+ "catch",
70
+ "do"
71
+ ], A = ["end", "else", "elseif", "catch", "finally"], p = [
72
+ "if",
73
+ "else",
74
+ "elseif",
75
+ "while",
76
+ "for",
77
+ "begin",
78
+ "let",
79
+ "end",
80
+ "do",
81
+ "try",
82
+ "catch",
83
+ "finally",
84
+ "return",
85
+ "break",
86
+ "continue",
87
+ "global",
88
+ "local",
89
+ "const",
90
+ "export",
91
+ "import",
92
+ "importall",
93
+ "using",
94
+ "function",
95
+ "where",
96
+ "macro",
97
+ "module",
98
+ "baremodule",
99
+ "struct",
100
+ "type",
101
+ "mutable",
102
+ "immutable",
103
+ "quote",
104
+ "typealias",
105
+ "abstract",
106
+ "primitive",
107
+ "bitstype"
108
+ ], h = ["true", "false", "nothing", "NaN", "Inf"], E = o(z), C = o(A), _ = o(p), w = o(h), D = /^@[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/, T = /^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/, P = /^(`|([_A-Za-z\u00A1-\uFFFF]*"("")?))/, B = o(a, "", "@"), G = o(a, "", ":");
109
+ function t(e) {
110
+ return e.nestedArrays > 0;
111
+ }
112
+ function S(e) {
113
+ return e.nestedGenerators > 0;
114
+ }
115
+ function l(e, n) {
116
+ return typeof n > "u" && (n = 0), e.scopes.length <= n ? null : e.scopes[e.scopes.length - (n + 1)];
117
+ }
118
+ function f(e, n) {
119
+ if (e.match("#=", !1))
120
+ return n.tokenize = I, n.tokenize(e, n);
121
+ var i = n.leavingExpr;
122
+ if (e.sol() && (i = !1), n.leavingExpr = !1, i && e.match(/^'+/))
123
+ return "operator";
124
+ if (e.match(/\.{4,}/))
125
+ return "error";
126
+ if (e.match(/\.{1,3}/))
127
+ return "operator";
128
+ if (e.eatSpace())
129
+ return null;
130
+ var r = e.peek();
131
+ if (r === "#")
132
+ return e.skipToEnd(), "comment";
133
+ if (r === "[" && (n.scopes.push("["), n.nestedArrays++), r === "(" && (n.scopes.push("("), n.nestedGenerators++), t(n) && r === "]") {
134
+ for (; n.scopes.length && l(n) !== "["; )
135
+ n.scopes.pop();
136
+ n.scopes.pop(), n.nestedArrays--, n.leavingExpr = !0;
137
+ }
138
+ if (S(n) && r === ")") {
139
+ for (; n.scopes.length && l(n) !== "("; )
140
+ n.scopes.pop();
141
+ n.scopes.pop(), n.nestedGenerators--, n.leavingExpr = !0;
142
+ }
143
+ if (t(n)) {
144
+ if (n.lastToken == "end" && e.match(":"))
145
+ return "operator";
146
+ if (e.match("end"))
147
+ return "number";
148
+ }
149
+ var u;
150
+ if ((u = e.match(E, !1)) && n.scopes.push(u[0]), e.match(C, !1) && n.scopes.pop(), e.match(/^::(?![:\$])/))
151
+ return n.tokenize = $, n.tokenize(e, n);
152
+ if (!i && (e.match(T) || e.match(G)))
153
+ return "builtin";
154
+ if (e.match(b))
155
+ return "operator";
156
+ if (e.match(/^\.?\d/, !1)) {
157
+ var s = RegExp(/^im\b/), c = !1;
158
+ if (e.match(/^0x\.[0-9a-f_]+p[\+\-]?[_\d]+/i) && (c = !0), e.match(/^0x[0-9a-f_]+/i) && (c = !0), e.match(/^0b[01_]+/i) && (c = !0), e.match(/^0o[0-7_]+/i) && (c = !0), e.match(/^(?:(?:\d[_\d]*)?\.(?!\.)(?:\d[_\d]*)?|\d[_\d]*\.(?!\.)(?:\d[_\d]*))?([Eef][\+\-]?[_\d]+)?/i) && (c = !0), e.match(/^\d[_\d]*(e[\+\-]?\d+)?/i) && (c = !0), c)
159
+ return e.match(s), n.leavingExpr = !0, "number";
160
+ }
161
+ if (e.match("'"))
162
+ return n.tokenize = O, n.tokenize(e, n);
163
+ if (e.match(P))
164
+ return n.tokenize = Z(e.current()), n.tokenize(e, n);
165
+ if (e.match(D) || e.match(B))
166
+ return "meta";
167
+ if (e.match(y))
168
+ return null;
169
+ if (e.match(_))
170
+ return "keyword";
171
+ if (e.match(w))
172
+ return "builtin";
173
+ var d = n.isDefinition || n.lastToken == "function" || n.lastToken == "macro" || n.lastToken == "type" || n.lastToken == "struct" || n.lastToken == "immutable";
174
+ return e.match(m) ? d ? e.peek() === "." ? (n.isDefinition = !0, "variable") : (n.isDefinition = !1, "def") : (n.leavingExpr = !0, "variable") : (e.next(), "error");
175
+ }
176
+ function $(e, n) {
177
+ return e.match(/.*?(?=[,;{}()=\s]|$)/), e.match("{") ? n.nestedParameters++ : e.match("}") && n.nestedParameters > 0 && n.nestedParameters--, n.nestedParameters > 0 ? e.match(/.*?(?={|})/) || e.next() : n.nestedParameters == 0 && (n.tokenize = f), "builtin";
178
+ }
179
+ function I(e, n) {
180
+ return e.match("#=") && n.nestedComments++, e.match(/.*?(?=(#=|=#))/) || e.skipToEnd(), e.match("=#") && (n.nestedComments--, n.nestedComments == 0 && (n.tokenize = f)), "comment";
181
+ }
182
+ function O(e, n) {
183
+ var i = !1, r;
184
+ if (e.match(x))
185
+ i = !0;
186
+ else if (r = e.match(/\\u([a-f0-9]{1,4})(?=')/i)) {
187
+ var u = parseInt(r[1], 16);
188
+ (u <= 55295 || u >= 57344) && (i = !0, e.next());
189
+ } else if (r = e.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)) {
190
+ var u = parseInt(r[1], 16);
191
+ u <= 1114111 && (i = !0, e.next());
192
+ }
193
+ return i ? (n.leavingExpr = !0, n.tokenize = f, "string") : (e.match(/^[^']+(?=')/) || e.skipToEnd(), e.match("'") && (n.tokenize = f), "error");
194
+ }
195
+ function Z(e) {
196
+ e.substr(-3) === '"""' ? e = '"""' : e.substr(-1) === '"' && (e = '"');
197
+ function n(i, r) {
198
+ if (i.eat("\\"))
199
+ i.next();
200
+ else {
201
+ if (i.match(e))
202
+ return r.tokenize = f, r.leavingExpr = !0, "string";
203
+ i.eat(/[`"]/);
204
+ }
205
+ return i.eatWhile(/[^\\`"]/), "string";
206
+ }
207
+ return n;
208
+ }
209
+ const R = {
210
+ name: "julia",
211
+ startState: function() {
212
+ return {
213
+ tokenize: f,
214
+ scopes: [],
215
+ lastToken: null,
216
+ leavingExpr: !1,
217
+ isDefinition: !1,
218
+ nestedArrays: 0,
219
+ nestedComments: 0,
220
+ nestedGenerators: 0,
221
+ nestedParameters: 0,
222
+ firstParenPos: -1
223
+ };
224
+ },
225
+ token: function(e, n) {
226
+ var i = n.tokenize(e, n), r = e.current();
227
+ return r && i && (n.lastToken = r), i;
228
+ },
229
+ indent: function(e, n, i) {
230
+ var r = 0;
231
+ return (n === "]" || n === ")" || /^end\b/.test(n) || /^else/.test(n) || /^catch\b/.test(n) || /^elseif\b/.test(n) || /^finally/.test(n)) && (r = -1), (e.scopes.length + r) * i.unit;
232
+ },
233
+ languageData: {
234
+ indentOnInput: /^\s*(end|else|catch|finally)\b$/,
235
+ commentTokens: { line: "#", block: { open: "#=", close: "=#" } },
236
+ closeBrackets: { brackets: ["(", "[", "{", '"'] },
237
+ autocomplete: p.concat(h)
238
+ }
239
+ };
240
+ export {
241
+ R as julia
242
+ };
@@ -0,0 +1,273 @@
1
+ import "./index.css";
2
+ var f = function(e, n) {
3
+ var g = n.next || "start";
4
+ {
5
+ n.next = n.next;
6
+ var k = x[g];
7
+ if (k.splice) {
8
+ for (var l = 0; l < k.length; ++l) {
9
+ var t = k[l];
10
+ if (t.regex && e.match(t.regex))
11
+ return n.next = t.next || n.next, t.token;
12
+ }
13
+ return e.next(), "error";
14
+ }
15
+ if (e.match(t = x[g]))
16
+ return t.regex && e.match(t.regex) ? (n.next = t.next, t.token) : (e.next(), "error");
17
+ }
18
+ return e.next(), "error";
19
+ }, s = "(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*", p = RegExp("(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*" + s + ")?))\\s*$"), r = "(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))", o = {
20
+ token: "string",
21
+ regex: ".+"
22
+ }, x = {
23
+ start: [
24
+ {
25
+ token: "docComment",
26
+ regex: "/\\*",
27
+ next: "comment"
28
+ },
29
+ {
30
+ token: "comment",
31
+ regex: "#.*"
32
+ },
33
+ {
34
+ token: "keyword",
35
+ regex: "(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)" + r
36
+ },
37
+ {
38
+ token: "atom",
39
+ regex: "(?:true|false|yes|no|on|off|null|void|undefined)" + r
40
+ },
41
+ {
42
+ token: "invalid",
43
+ regex: "(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)" + r
44
+ },
45
+ {
46
+ token: "className.standard",
47
+ regex: "(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)" + r
48
+ },
49
+ {
50
+ token: "variableName.function.standard",
51
+ regex: "(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)" + r
52
+ },
53
+ {
54
+ token: "variableName.standard",
55
+ regex: "(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)" + r
56
+ },
57
+ {
58
+ token: "variableName",
59
+ regex: s + "\\s*:(?![:=])"
60
+ },
61
+ {
62
+ token: "variableName",
63
+ regex: s
64
+ },
65
+ {
66
+ token: "operatorKeyword",
67
+ regex: "(?:\\.{3}|\\s+\\?)"
68
+ },
69
+ {
70
+ token: "keyword",
71
+ regex: "(?:@+|::|\\.\\.)",
72
+ next: "key"
73
+ },
74
+ {
75
+ token: "operatorKeyword",
76
+ regex: "\\.\\s*",
77
+ next: "key"
78
+ },
79
+ {
80
+ token: "string",
81
+ regex: "\\\\\\S[^\\s,;)}\\]]*"
82
+ },
83
+ {
84
+ token: "docString",
85
+ regex: "'''",
86
+ next: "qdoc"
87
+ },
88
+ {
89
+ token: "docString",
90
+ regex: '"""',
91
+ next: "qqdoc"
92
+ },
93
+ {
94
+ token: "string",
95
+ regex: "'",
96
+ next: "qstring"
97
+ },
98
+ {
99
+ token: "string",
100
+ regex: '"',
101
+ next: "qqstring"
102
+ },
103
+ {
104
+ token: "string",
105
+ regex: "`",
106
+ next: "js"
107
+ },
108
+ {
109
+ token: "string",
110
+ regex: "<\\[",
111
+ next: "words"
112
+ },
113
+ {
114
+ token: "regexp",
115
+ regex: "//",
116
+ next: "heregex"
117
+ },
118
+ {
119
+ token: "regexp",
120
+ regex: "\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}",
121
+ next: "key"
122
+ },
123
+ {
124
+ token: "number",
125
+ regex: "(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)"
126
+ },
127
+ {
128
+ token: "paren",
129
+ regex: "[({[]"
130
+ },
131
+ {
132
+ token: "paren",
133
+ regex: "[)}\\]]",
134
+ next: "key"
135
+ },
136
+ {
137
+ token: "operatorKeyword",
138
+ regex: "\\S+"
139
+ },
140
+ {
141
+ token: "content",
142
+ regex: "\\s+"
143
+ }
144
+ ],
145
+ heregex: [
146
+ {
147
+ token: "regexp",
148
+ regex: ".*?//[gimy$?]{0,4}",
149
+ next: "start"
150
+ },
151
+ {
152
+ token: "regexp",
153
+ regex: "\\s*#{"
154
+ },
155
+ {
156
+ token: "comment",
157
+ regex: "\\s+(?:#.*)?"
158
+ },
159
+ {
160
+ token: "regexp",
161
+ regex: "\\S+"
162
+ }
163
+ ],
164
+ key: [
165
+ {
166
+ token: "operatorKeyword",
167
+ regex: "[.?@!]+"
168
+ },
169
+ {
170
+ token: "variableName",
171
+ regex: s,
172
+ next: "start"
173
+ },
174
+ {
175
+ token: "content",
176
+ regex: "",
177
+ next: "start"
178
+ }
179
+ ],
180
+ comment: [
181
+ {
182
+ token: "docComment",
183
+ regex: ".*?\\*/",
184
+ next: "start"
185
+ },
186
+ {
187
+ token: "docComment",
188
+ regex: ".+"
189
+ }
190
+ ],
191
+ qdoc: [
192
+ {
193
+ token: "string",
194
+ regex: ".*?'''",
195
+ next: "key"
196
+ },
197
+ o
198
+ ],
199
+ qqdoc: [
200
+ {
201
+ token: "string",
202
+ regex: '.*?"""',
203
+ next: "key"
204
+ },
205
+ o
206
+ ],
207
+ qstring: [
208
+ {
209
+ token: "string",
210
+ regex: "[^\\\\']*(?:\\\\.[^\\\\']*)*'",
211
+ next: "key"
212
+ },
213
+ o
214
+ ],
215
+ qqstring: [
216
+ {
217
+ token: "string",
218
+ regex: '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
219
+ next: "key"
220
+ },
221
+ o
222
+ ],
223
+ js: [
224
+ {
225
+ token: "string",
226
+ regex: "[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",
227
+ next: "key"
228
+ },
229
+ o
230
+ ],
231
+ words: [
232
+ {
233
+ token: "string",
234
+ regex: ".*?\\]>",
235
+ next: "key"
236
+ },
237
+ o
238
+ ]
239
+ };
240
+ for (var d in x) {
241
+ var a = x[d];
242
+ if (a.splice)
243
+ for (var i = 0, u = a.length; i < u; ++i) {
244
+ var c = a[i];
245
+ typeof c.regex == "string" && (x[d][i].regex = new RegExp("^" + c.regex));
246
+ }
247
+ else typeof c.regex == "string" && (x[d].regex = new RegExp("^" + a.regex));
248
+ }
249
+ const m = {
250
+ name: "livescript",
251
+ startState: function() {
252
+ return {
253
+ next: "start",
254
+ lastToken: { style: null, indent: 0, content: "" }
255
+ };
256
+ },
257
+ token: function(e, n) {
258
+ for (; e.pos == e.start; )
259
+ var g = f(e, n);
260
+ return n.lastToken = {
261
+ style: g,
262
+ indent: e.indentation(),
263
+ content: e.current()
264
+ }, g.replace(/\./g, " ");
265
+ },
266
+ indent: function(e) {
267
+ var n = e.lastToken.indent;
268
+ return e.lastToken.content.match(p) && (n += 2), n;
269
+ }
270
+ };
271
+ export {
272
+ m as liveScript
273
+ };