zs_library 0.4.8 → 0.4.9

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 (116) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.js +11245 -6
  3. package/package.json +146 -146
  4. package/dist/apl-DzB7vleG.js +0 -77
  5. package/dist/asciiarmor-GBg_dTix.js +0 -35
  6. package/dist/asn1-C3znSLx9.js +0 -96
  7. package/dist/asterisk-DlqRFsge.js +0 -272
  8. package/dist/brainfuck-BRsrPeoO.js +0 -35
  9. package/dist/clike-BvRdj3ii.js +0 -621
  10. package/dist/clojure-DoHCnq3P.js +0 -801
  11. package/dist/cmake-lga2BQKc.js +0 -29
  12. package/dist/cobol-CoUZEClC.js +0 -73
  13. package/dist/coffeescript-DtzhVgPb.js +0 -180
  14. package/dist/commonlisp-Dczl5pgK.js +0 -76
  15. package/dist/crystal-CGcK8mnw.js +0 -218
  16. package/dist/css-BSROsPdq.js +0 -1561
  17. package/dist/cypher-DtSMl1Mv.js +0 -69
  18. package/dist/d-Dvhr70b-.js +0 -128
  19. package/dist/diff-CGwDp7kO.js +0 -19
  20. package/dist/dockerfile-comEO-T6.js +0 -195
  21. package/dist/dtd-CCHJ68ra.js +0 -85
  22. package/dist/dylan-DuvcMu5H.js +0 -235
  23. package/dist/ebnf-40BT7kIS.js +0 -79
  24. package/dist/ecl-D1uoNQJW.js +0 -122
  25. package/dist/eiffel-5pGo0kXa.js +0 -111
  26. package/dist/elm-BaiVOLJD.js +0 -109
  27. package/dist/erlang-CkzodiGe.js +0 -488
  28. package/dist/factor-BOXOAn_M.js +0 -66
  29. package/dist/fcl-BpnTn_eU.js +0 -104
  30. package/dist/forth-DErAeAEb.js +0 -61
  31. package/dist/fortran-D2-6KpzO.js +0 -443
  32. package/dist/gas-DyEPANLH.js +0 -184
  33. package/dist/gherkin-Drt_srgO.js +0 -35
  34. package/dist/groovy-BMVfw_nf.js +0 -147
  35. package/dist/haskell-hWhKnZO1.js +0 -376
  36. package/dist/haxe-B1MRfS0p.js +0 -360
  37. package/dist/http-DmgKxj-g.js +0 -45
  38. package/dist/idl-DqZ86h3r.js +0 -948
  39. package/dist/index-5dj8r7GK.js +0 -266
  40. package/dist/index-BTXiadLB.js +0 -309
  41. package/dist/index-BlC4-BmN.js +0 -72
  42. package/dist/index-BrFeP3fX.js +0 -244
  43. package/dist/index-Bto4OncH.js +0 -539
  44. package/dist/index-Bvv7YkGe.js +0 -136
  45. package/dist/index-Bx4MkRG_.js +0 -76
  46. package/dist/index-CVOhQMF3.js +0 -608
  47. package/dist/index-CecD8NGL.js +0 -228472
  48. package/dist/index-CmoZmAhh.js +0 -289
  49. package/dist/index-DE3hmKbB.js +0 -135
  50. package/dist/index-DF7XjAxV.js +0 -94
  51. package/dist/index-DcChItCb.js +0 -157
  52. package/dist/index-Dl5DpQ2k.js +0 -342
  53. package/dist/index-Dpbxeq5U.js +0 -59
  54. package/dist/index-gpJmCEdM.js +0 -99
  55. package/dist/index-udH8R_K0.js +0 -300
  56. package/dist/javascript-BvuVDFxD.js +0 -691
  57. package/dist/jinja2-sU0UaYnG.js +0 -155
  58. package/dist/julia-3_lRZPrK.js +0 -242
  59. package/dist/livescript-BeDiX_lv.js +0 -273
  60. package/dist/lua-DsgFLpii.js +0 -218
  61. package/dist/mathematica-1GSq-6KQ.js +0 -36
  62. package/dist/mbox-agttEgFX.js +0 -77
  63. package/dist/mirc-0mTi20sq.js +0 -73
  64. package/dist/mllike-Cn3QD1L6.js +0 -273
  65. package/dist/modelica-zXUsSMFb.js +0 -94
  66. package/dist/mscgen-CjqYDKLG.js +0 -105
  67. package/dist/mumps-o2cuacx9.js +0 -26
  68. package/dist/nginx-BwTpvSVN.js +0 -90
  69. package/dist/nsis-BuRdhAu4.js +0 -63
  70. package/dist/ntriples-DrgMTIhT.js +0 -80
  71. package/dist/octave-Cxdtf9mO.js +0 -144
  72. package/dist/oz-DFmTw-qE.js +0 -152
  73. package/dist/pascal-DXxn4Ogv.js +0 -78
  74. package/dist/perl-C73cx1ym.js +0 -916
  75. package/dist/pig-Bb8sMbk0.js +0 -55
  76. package/dist/powershell-DxmufwKU.js +0 -250
  77. package/dist/properties-C4fhBR7T.js +0 -27
  78. package/dist/protobuf-Eqae3kep.js +0 -50
  79. package/dist/pug-Cdoid33I.js +0 -249
  80. package/dist/puppet-BH84QZvC.js +0 -46
  81. package/dist/python-D32-_XsH.js +0 -314
  82. package/dist/q-CDvEpNHY.js +0 -84
  83. package/dist/r-D9TtEI-G.js +0 -105
  84. package/dist/rpm-Ckejt31K.js +0 -58
  85. package/dist/ruby-gRVA_lpr.js +0 -229
  86. package/dist/sas-Cetv6MtF.js +0 -106
  87. package/dist/scheme-BpAxUIwV.js +0 -125
  88. package/dist/shell-DmARhv5h.js +0 -183
  89. package/dist/sieve-DJENs6f1.js +0 -73
  90. package/dist/simple-mode-B0kVDhR7.js +0 -89
  91. package/dist/smalltalk-CtRR6guu.js +0 -49
  92. package/dist/solr-ZVIJNGhC.js +0 -42
  93. package/dist/sparql-Cg1WYQva.js +0 -198
  94. package/dist/spreadsheet-Bi94Lk_2.js +0 -50
  95. package/dist/sql-BLhvp4JJ.js +0 -283
  96. package/dist/stex-DuReG47O.js +0 -130
  97. package/dist/stylus-D5QpSSbb.js +0 -251
  98. package/dist/swift-CZplZXOW.js +0 -231
  99. package/dist/tcl-COiqjz-O.js +0 -82
  100. package/dist/textile-BIDpYsbD.js +0 -296
  101. package/dist/tiddlywiki-C4woD_uK.js +0 -156
  102. package/dist/tiki-Ddj0Z2aQ.js +0 -182
  103. package/dist/toml-Byr0PaXO.js +0 -50
  104. package/dist/troff-BEvN8lSw.js +0 -36
  105. package/dist/ttcn-CyeSpuPS.js +0 -124
  106. package/dist/ttcn-cfg-C4JBLVfg.js +0 -89
  107. package/dist/turtle-8qSCc9Tc.js +0 -81
  108. package/dist/vb-BOJI7cFm.js +0 -75
  109. package/dist/vbscript-Cu6iG9pw.js +0 -325
  110. package/dist/velocity-BEpFYT7L.js +0 -97
  111. package/dist/verilog-BBxq08Rh.js +0 -264
  112. package/dist/vhdl-B0tZHMGi.js +0 -107
  113. package/dist/webidl-CW91NtvY.js +0 -156
  114. package/dist/xquery-DzC9wL36.js +0 -423
  115. package/dist/yacas-lKwNB4DM.js +0 -74
  116. package/dist/z80-Bq0fiCqy.js +0 -62
@@ -1,69 +0,0 @@
1
- import "./index.css";
2
- var l = function(n) {
3
- return new RegExp("^(?:" + n.join("|") + ")$", "i");
4
- }, p = function(n) {
5
- i = null;
6
- var e = n.next();
7
- if (e === '"')
8
- return n.match(/^.*?"/), "string";
9
- if (e === "'")
10
- return n.match(/^.*?'/), "string";
11
- if (/[{}\(\),\.;\[\]]/.test(e))
12
- return i = e, "punctuation";
13
- if (e === "/" && n.eat("/"))
14
- return n.skipToEnd(), "comment";
15
- if (u.test(e))
16
- return n.eatWhile(u), null;
17
- if (n.eatWhile(/[_\w\d]/), n.eat(":"))
18
- return n.eatWhile(/[\w\d_\-]/), "atom";
19
- var t = n.current();
20
- return d.test(t) ? "builtin" : f.test(t) ? "def" : h.test(t) || x.test(t) ? "keyword" : "variable";
21
- }, o = function(n, e, t) {
22
- return n.context = {
23
- prev: n.context,
24
- indent: n.indent,
25
- col: t,
26
- type: e
27
- };
28
- }, c = function(n) {
29
- return n.indent = n.context.indent, n.context = n.context.prev;
30
- }, i, d = l(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "keys", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "reverse", "right", "round", "rtrim", "shortestPath", "sign", "sin", "size", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "toString", "trim", "type", "upper"]), f = l(["all", "and", "any", "contains", "exists", "has", "in", "none", "not", "or", "single", "xor"]), h = l(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "detach", "distinct", "drop", "else", "end", "ends", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "join", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "starts", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with", "call", "yield"]), x = l(["access", "active", "assign", "all", "alter", "as", "catalog", "change", "copy", "create", "constraint", "constraints", "current", "database", "databases", "dbms", "default", "deny", "drop", "element", "elements", "exists", "from", "grant", "graph", "graphs", "if", "index", "indexes", "label", "labels", "management", "match", "name", "names", "new", "node", "nodes", "not", "of", "on", "or", "password", "populated", "privileges", "property", "read", "relationship", "relationships", "remove", "replace", "required", "revoke", "role", "roles", "set", "show", "start", "status", "stop", "suspended", "to", "traverse", "type", "types", "user", "users", "with", "write"]), u = /[*+\-<>=&|~%^]/;
31
- const v = {
32
- name: "cypher",
33
- startState: function() {
34
- return {
35
- tokenize: p,
36
- context: null,
37
- indent: 0,
38
- col: 0
39
- };
40
- },
41
- token: function(n, e) {
42
- if (n.sol() && (e.context && e.context.align == null && (e.context.align = !1), e.indent = n.indentation()), n.eatSpace())
43
- return null;
44
- var t = e.tokenize(n, e);
45
- if (t !== "comment" && e.context && e.context.align == null && e.context.type !== "pattern" && (e.context.align = !0), i === "(")
46
- o(e, ")", n.column());
47
- else if (i === "[")
48
- o(e, "]", n.column());
49
- else if (i === "{")
50
- o(e, "}", n.column());
51
- else if (/[\]\}\)]/.test(i)) {
52
- for (; e.context && e.context.type === "pattern"; )
53
- c(e);
54
- e.context && i === e.context.type && c(e);
55
- } else i === "." && 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()));
56
- return t;
57
- },
58
- indent: function(n, e, t) {
59
- var a = e && e.charAt(0), r = n.context;
60
- if (/[\]\}]/.test(a))
61
- for (; r && r.type === "pattern"; )
62
- r = r.prev;
63
- var s = r && a === r.type;
64
- return r ? r.type === "keywords" ? null : r.align ? r.col + (s ? 0 : 1) : r.indent + (s ? 0 : t.unit) : 0;
65
- }
66
- };
67
- export {
68
- v as cypher
69
- };
@@ -1,128 +0,0 @@
1
- import "./index.css";
2
- function c(e) {
3
- for (var n = {}, t = e.split(" "), i = 0; i < t.length; ++i) n[t[i]] = !0;
4
- return n;
5
- }
6
- var s = "body catch class do else enum for foreach foreach_reverse if in interface mixin out scope struct switch try union unittest version while with";
7
- const l = {
8
- keywords: c("abstract alias align asm assert auto break case cast cdouble cent cfloat const continue debug default delegate delete deprecated export extern final finally function goto immutable import inout invariant is lazy macro module new nothrow override package pragma private protected public pure ref return shared short static super synchronized template this throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters " + s),
9
- blockKeywords: c(s),
10
- builtin: c("bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte ucent uint ulong ushort wchar wstring void size_t sizediff_t"),
11
- atoms: c("exit failure success true false null"),
12
- hooks: {
13
- "@": function(e, n) {
14
- return e.eatWhile(/[\w\$_]/), "meta";
15
- }
16
- }
17
- };
18
- var w = l.statementIndentUnit, v = l.keywords, x = l.builtin, d = l.blockKeywords, g = l.atoms, p = l.hooks, _ = l.multiLineStrings, h = /[+\-*&%=<>!?|\/]/, o;
19
- function m(e, n) {
20
- var t = e.next();
21
- if (p[t]) {
22
- var i = p[t](e, n);
23
- if (i !== !1) return i;
24
- }
25
- if (t == '"' || t == "'" || t == "`")
26
- return n.tokenize = z(t), n.tokenize(e, n);
27
- if (/[\[\]{}\(\),;\:\.]/.test(t))
28
- return o = t, null;
29
- if (/\d/.test(t))
30
- return e.eatWhile(/[\w\.]/), "number";
31
- if (t == "/") {
32
- if (e.eat("+"))
33
- return n.tokenize = k, k(e, n);
34
- if (e.eat("*"))
35
- return n.tokenize = y, y(e, n);
36
- if (e.eat("/"))
37
- return e.skipToEnd(), "comment";
38
- }
39
- if (h.test(t))
40
- return e.eatWhile(h), "operator";
41
- e.eatWhile(/[\w\$_\xa1-\uffff]/);
42
- var r = e.current();
43
- return v.propertyIsEnumerable(r) ? (d.propertyIsEnumerable(r) && (o = "newstatement"), "keyword") : x.propertyIsEnumerable(r) ? (d.propertyIsEnumerable(r) && (o = "newstatement"), "builtin") : g.propertyIsEnumerable(r) ? "atom" : "variable";
44
- }
45
- function z(e) {
46
- return function(n, t) {
47
- for (var i = !1, r, u = !1; (r = n.next()) != null; ) {
48
- if (r == e && !i) {
49
- u = !0;
50
- break;
51
- }
52
- i = !i && r == "\\";
53
- }
54
- return (u || !(i || _)) && (t.tokenize = null), "string";
55
- };
56
- }
57
- function y(e, n) {
58
- for (var t = !1, i; i = e.next(); ) {
59
- if (i == "/" && t) {
60
- n.tokenize = null;
61
- break;
62
- }
63
- t = i == "*";
64
- }
65
- return "comment";
66
- }
67
- function k(e, n) {
68
- for (var t = !1, i; i = e.next(); ) {
69
- if (i == "/" && t) {
70
- n.tokenize = null;
71
- break;
72
- }
73
- t = i == "+";
74
- }
75
- return "comment";
76
- }
77
- function b(e, n, t, i, r) {
78
- this.indented = e, this.column = n, this.type = t, this.align = i, this.prev = r;
79
- }
80
- function f(e, n, t) {
81
- var i = e.indented;
82
- return e.context && e.context.type == "statement" && (i = e.context.indented), e.context = new b(i, n, t, null, e.context);
83
- }
84
- function a(e) {
85
- var n = e.context.type;
86
- return (n == ")" || n == "]" || n == "}") && (e.indented = e.context.indented), e.context = e.context.prev;
87
- }
88
- const I = {
89
- name: "d",
90
- startState: function(e) {
91
- return {
92
- tokenize: null,
93
- context: new b(-e, 0, "top", !1),
94
- indented: 0,
95
- startOfLine: !0
96
- };
97
- },
98
- token: function(e, n) {
99
- var t = n.context;
100
- if (e.sol() && (t.align == null && (t.align = !1), n.indented = e.indentation(), n.startOfLine = !0), e.eatSpace()) return null;
101
- o = null;
102
- var i = (n.tokenize || m)(e, n);
103
- if (i == "comment" || i == "meta") return i;
104
- if (t.align == null && (t.align = !0), (o == ";" || o == ":" || o == ",") && t.type == "statement") a(n);
105
- else if (o == "{") f(n, e.column(), "}");
106
- else if (o == "[") f(n, e.column(), "]");
107
- else if (o == "(") f(n, e.column(), ")");
108
- else if (o == "}") {
109
- for (; t.type == "statement"; ) t = a(n);
110
- for (t.type == "}" && (t = a(n)); t.type == "statement"; ) t = a(n);
111
- } else o == t.type ? a(n) : ((t.type == "}" || t.type == "top") && o != ";" || t.type == "statement" && o == "newstatement") && f(n, e.column(), "statement");
112
- return n.startOfLine = !1, i;
113
- },
114
- indent: function(e, n, t) {
115
- if (e.tokenize != m && e.tokenize != null) return null;
116
- var i = e.context, r = n && n.charAt(0);
117
- i.type == "statement" && r == "}" && (i = i.prev);
118
- var u = r == i.type;
119
- return i.type == "statement" ? i.indented + (r == "{" ? 0 : w || t.unit) : i.align ? i.column + (u ? 0 : 1) : i.indented + (u ? 0 : t.unit);
120
- },
121
- languageData: {
122
- indentOnInput: /^\s*[{}]$/,
123
- commentTokens: { line: "//", block: { open: "/*", close: "*/" } }
124
- }
125
- };
126
- export {
127
- I as d
128
- };
@@ -1,19 +0,0 @@
1
- import "./index.css";
2
- var o = {
3
- "+": "inserted",
4
- "-": "deleted",
5
- "@": "meta"
6
- };
7
- const p = {
8
- name: "diff",
9
- token: function(n) {
10
- var e = n.string.search(/[\t ]+?$/);
11
- if (!n.sol() || e === 0)
12
- return n.skipToEnd(), ("error " + (o[n.string.charAt(0)] || "")).replace(/ $/, "");
13
- var i = o[n.peek()] || n.skipToEnd();
14
- return e === -1 ? n.skipToEnd() : n.pos = e, i;
15
- }
16
- };
17
- export {
18
- p as diff
19
- };
@@ -1,195 +0,0 @@
1
- import "./index.css";
2
- import { s as o } from "./simple-mode-B0kVDhR7.js";
3
- var e = "from", s = new RegExp("^(\\s*)\\b(" + e + ")\\b", "i"), n = ["run", "cmd", "entrypoint", "shell"], l = new RegExp("^(\\s*)(" + n.join("|") + ")(\\s+\\[)", "i"), t = "expose", x = new RegExp("^(\\s*)(" + t + ")(\\s+)", "i"), g = [
4
- "arg",
5
- "from",
6
- "maintainer",
7
- "label",
8
- "env",
9
- "add",
10
- "copy",
11
- "volume",
12
- "user",
13
- "workdir",
14
- "onbuild",
15
- "stopsignal",
16
- "healthcheck",
17
- "shell"
18
- ], u = [e, t].concat(n).concat(g), r = "(" + u.join("|") + ")", a = new RegExp("^(\\s*)" + r + "(\\s*)(#.*)?$", "i"), k = new RegExp("^(\\s*)" + r + "(\\s+)", "i");
19
- const p = o({
20
- start: [
21
- // Block comment: This is a line starting with a comment
22
- {
23
- regex: /^\s*#.*$/,
24
- sol: !0,
25
- token: "comment"
26
- },
27
- {
28
- regex: s,
29
- token: [null, "keyword"],
30
- sol: !0,
31
- next: "from"
32
- },
33
- // Highlight an instruction without any arguments (for convenience)
34
- {
35
- regex: a,
36
- token: [null, "keyword", null, "error"],
37
- sol: !0
38
- },
39
- {
40
- regex: l,
41
- token: [null, "keyword", null],
42
- sol: !0,
43
- next: "array"
44
- },
45
- {
46
- regex: x,
47
- token: [null, "keyword", null],
48
- sol: !0,
49
- next: "expose"
50
- },
51
- // Highlight an instruction followed by arguments
52
- {
53
- regex: k,
54
- token: [null, "keyword", null],
55
- sol: !0,
56
- next: "arguments"
57
- },
58
- {
59
- regex: /./,
60
- token: null
61
- }
62
- ],
63
- from: [
64
- {
65
- regex: /\s*$/,
66
- token: null,
67
- next: "start"
68
- },
69
- {
70
- // Line comment without instruction arguments is an error
71
- regex: /(\s*)(#.*)$/,
72
- token: [null, "error"],
73
- next: "start"
74
- },
75
- {
76
- regex: /(\s*\S+\s+)(as)/i,
77
- token: [null, "keyword"],
78
- next: "start"
79
- },
80
- // Fail safe return to start
81
- {
82
- token: null,
83
- next: "start"
84
- }
85
- ],
86
- single: [
87
- {
88
- regex: /(?:[^\\']|\\.)/,
89
- token: "string"
90
- },
91
- {
92
- regex: /'/,
93
- token: "string",
94
- pop: !0
95
- }
96
- ],
97
- double: [
98
- {
99
- regex: /(?:[^\\"]|\\.)/,
100
- token: "string"
101
- },
102
- {
103
- regex: /"/,
104
- token: "string",
105
- pop: !0
106
- }
107
- ],
108
- array: [
109
- {
110
- regex: /\]/,
111
- token: null,
112
- next: "start"
113
- },
114
- {
115
- regex: /"(?:[^\\"]|\\.)*"?/,
116
- token: "string"
117
- }
118
- ],
119
- expose: [
120
- {
121
- regex: /\d+$/,
122
- token: "number",
123
- next: "start"
124
- },
125
- {
126
- regex: /[^\d]+$/,
127
- token: null,
128
- next: "start"
129
- },
130
- {
131
- regex: /\d+/,
132
- token: "number"
133
- },
134
- {
135
- regex: /[^\d]+/,
136
- token: null
137
- },
138
- // Fail safe return to start
139
- {
140
- token: null,
141
- next: "start"
142
- }
143
- ],
144
- arguments: [
145
- {
146
- regex: /^\s*#.*$/,
147
- sol: !0,
148
- token: "comment"
149
- },
150
- {
151
- regex: /"(?:[^\\"]|\\.)*"?$/,
152
- token: "string",
153
- next: "start"
154
- },
155
- {
156
- regex: /"/,
157
- token: "string",
158
- push: "double"
159
- },
160
- {
161
- regex: /'(?:[^\\']|\\.)*'?$/,
162
- token: "string",
163
- next: "start"
164
- },
165
- {
166
- regex: /'/,
167
- token: "string",
168
- push: "single"
169
- },
170
- {
171
- regex: /[^#"']+[\\`]$/,
172
- token: null
173
- },
174
- {
175
- regex: /[^#"']+$/,
176
- token: null,
177
- next: "start"
178
- },
179
- {
180
- regex: /[^#"']+/,
181
- token: null
182
- },
183
- // Fail safe return to start
184
- {
185
- token: null,
186
- next: "start"
187
- }
188
- ],
189
- languageData: {
190
- commentTokens: { line: "#" }
191
- }
192
- });
193
- export {
194
- p as dockerFile
195
- };
@@ -1,85 +0,0 @@
1
- import "./index.css";
2
- var u;
3
- function r(e, n) {
4
- return u = n, e;
5
- }
6
- function t(e, n) {
7
- var i = e.next();
8
- if (i == "<" && e.eat("!")) {
9
- if (e.eatWhile(/[\-]/))
10
- return n.tokenize = o, o(e, n);
11
- if (e.eatWhile(/[\w]/)) return r("keyword", "doindent");
12
- } else {
13
- if (i == "<" && e.eat("?"))
14
- return n.tokenize = a("meta", "?>"), r("meta", i);
15
- if (i == "#" && e.eatWhile(/[\w]/)) return r("atom", "tag");
16
- if (i == "|") return r("keyword", "separator");
17
- if (i.match(/[\(\)\[\]\-\.,\+\?>]/)) return r(null, i);
18
- if (i.match(/[\[\]]/)) return r("rule", i);
19
- if (i == '"' || i == "'")
20
- return n.tokenize = k(i), n.tokenize(e, n);
21
- if (e.eatWhile(/[a-zA-Z\?\+\d]/)) {
22
- var l = e.current();
23
- return l.substr(l.length - 1, l.length).match(/\?|\+/) !== null && e.backUp(1), r("tag", "tag");
24
- } else return i == "%" || i == "*" ? r("number", "number") : (e.eatWhile(/[\w\\\-_%.{,]/), r(null, null));
25
- }
26
- }
27
- function o(e, n) {
28
- for (var i = 0, l; (l = e.next()) != null; ) {
29
- if (i >= 2 && l == ">") {
30
- n.tokenize = t;
31
- break;
32
- }
33
- i = l == "-" ? i + 1 : 0;
34
- }
35
- return r("comment", "comment");
36
- }
37
- function k(e) {
38
- return function(n, i) {
39
- for (var l = !1, c; (c = n.next()) != null; ) {
40
- if (c == e && !l) {
41
- i.tokenize = t;
42
- break;
43
- }
44
- l = !l && c == "\\";
45
- }
46
- return r("string", "tag");
47
- };
48
- }
49
- function a(e, n) {
50
- return function(i, l) {
51
- for (; !i.eol(); ) {
52
- if (i.match(n)) {
53
- l.tokenize = t;
54
- break;
55
- }
56
- i.next();
57
- }
58
- return e;
59
- };
60
- }
61
- const h = {
62
- name: "dtd",
63
- startState: function() {
64
- return {
65
- tokenize: t,
66
- baseIndent: 0,
67
- stack: []
68
- };
69
- },
70
- token: function(e, n) {
71
- if (e.eatSpace()) return null;
72
- var i = n.tokenize(e, n), l = n.stack[n.stack.length - 1];
73
- return e.current() == "[" || u === "doindent" || u == "[" ? n.stack.push("rule") : u === "endtag" ? n.stack[n.stack.length - 1] = "endtag" : e.current() == "]" || u == "]" || u == ">" && l == "rule" ? n.stack.pop() : u == "[" && n.stack.push("["), i;
74
- },
75
- indent: function(e, n, i) {
76
- var l = e.stack.length;
77
- return n.charAt(0) === "]" ? l-- : n.substr(n.length - 1, n.length) === ">" && (n.substr(0, 1) === "<" || u == "doindent" && n.length > 1 || (u == "doindent" ? l-- : u == ">" && n.length > 1 || u == "tag" && n !== ">" || (u == "tag" && e.stack[e.stack.length - 1] == "rule" ? l-- : u == "tag" ? l++ : n === ">" && e.stack[e.stack.length - 1] == "rule" && u === ">" ? l-- : n === ">" && e.stack[e.stack.length - 1] == "rule" || (n.substr(0, 1) !== "<" && n.substr(0, 1) === ">" ? l = l - 1 : n === ">" || (l = l - 1)))), (u == null || u == "]") && l--), e.baseIndent + l * i.unit;
78
- },
79
- languageData: {
80
- indentOnInput: /^\s*[\]>]$/
81
- }
82
- };
83
- export {
84
- h as dtd
85
- };