@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.
Files changed (125) hide show
  1. package/dist/apl-B2DGVGxc.js +76 -0
  2. package/dist/asciiarmor-2LVJmxlE.js +34 -0
  3. package/dist/asn1-jKiBa2Ya.js +95 -0
  4. package/dist/asterisk-DS281yxp.js +271 -0
  5. package/dist/brainfuck-C_p9pTT8.js +34 -0
  6. package/dist/clike-BMALKCNj.js +620 -0
  7. package/dist/clojure-CCKyeQKf.js +800 -0
  8. package/dist/cmake-CuaCgAKt.js +28 -0
  9. package/dist/cobol-BlTKFDRj.js +72 -0
  10. package/dist/coffeescript-BVCvwO8I.js +179 -0
  11. package/dist/commonlisp-D_kxz07b.js +75 -0
  12. package/dist/crystal-D309uH6_.js +217 -0
  13. package/dist/css-BkF-NPzE.js +1553 -0
  14. package/dist/cypher-BMq4Fwjl.js +68 -0
  15. package/dist/d-BZcgY6La.js +127 -0
  16. package/dist/diff-Cg9d_RX2.js +18 -0
  17. package/dist/dockerfile-DFX8bq9N.js +194 -0
  18. package/dist/dtd-CtLokQ-U.js +84 -0
  19. package/dist/dylan-QYeExnWK.js +234 -0
  20. package/dist/ebnf-DUPDuY4r.js +78 -0
  21. package/dist/ecl-CiXN-g_D.js +121 -0
  22. package/dist/eiffel-yQhjl4T1.js +110 -0
  23. package/dist/elm-CNT9vbN0.js +108 -0
  24. package/dist/erlang-CFOYdy9e.js +487 -0
  25. package/dist/factor-Clf6BoVk.js +65 -0
  26. package/dist/fcl-CPC2WYrI.js +103 -0
  27. package/dist/forth-BmxRyE9S.js +60 -0
  28. package/dist/fortran-9bvPyrOW.js +442 -0
  29. package/dist/gas-cpmYfFX2.js +183 -0
  30. package/dist/gherkin-CJuwpceU.js +34 -0
  31. package/dist/groovy-DZeT_VM-.js +146 -0
  32. package/dist/haskell-CxiO_7JL.js +375 -0
  33. package/dist/haxe-70NVW1pR.js +359 -0
  34. package/dist/http-D9LttvKF.js +44 -0
  35. package/dist/idl-B6TRFYjl.js +947 -0
  36. package/dist/index-BMiCCEB1.js +309 -0
  37. package/dist/index-BNuasEBW.js +94 -0
  38. package/dist/index-Bg1KDWyt.js +290 -0
  39. package/dist/index-BuVm7ZG6.js +1305 -0
  40. package/dist/index-BvS1cnHq.js +613 -0
  41. package/dist/index-C44L0DmY.js +138 -0
  42. package/dist/index-C71CZfUx.js +247 -0
  43. package/dist/index-CQ6JWNwi.js +566 -0
  44. package/dist/index-CpRVx97-.js +342 -0
  45. package/dist/index-CqvQj6d-.js +270 -0
  46. package/dist/index-CrbQBmWq.js +157 -0
  47. package/dist/index-CzovO10m.js +302 -0
  48. package/dist/index-D0BZOY-S.js +101 -0
  49. package/dist/index-D0svJS59.js +555 -0
  50. package/dist/index-D93XVMi1.js +136 -0
  51. package/dist/index-DEB5VK0f.js +252 -0
  52. package/dist/index-DIaXGPFp.js +12936 -0
  53. package/dist/index-Dp8osI_J.js +960 -0
  54. package/dist/index-Ds4AioqO.js +1918 -0
  55. package/dist/index-Dy-OpkyQ.js +76 -0
  56. package/dist/index-Dyi9rNIT.js +391 -0
  57. package/dist/index-ZJkjD9tT.js +74 -0
  58. package/dist/index-qH2lMs0G.js +945 -0
  59. package/dist/index-srIksFxX.js +59 -0
  60. package/dist/index.d.ts +1 -0
  61. package/dist/index.d.ts.map +1 -1
  62. package/dist/index.js +19 -1
  63. package/dist/javascript-DOuB9oqA.js +691 -0
  64. package/dist/julia-DpvXAuO6.js +241 -0
  65. package/dist/languages.d.ts +18 -0
  66. package/dist/languages.d.ts.map +1 -0
  67. package/dist/livescript-CanGTf8u.js +272 -0
  68. package/dist/lua-XplVlWi_.js +217 -0
  69. package/dist/mathematica-jaRHnSxC.js +35 -0
  70. package/dist/mbox-BctzC1hL.js +76 -0
  71. package/dist/mirc-CFBPAOaF.js +72 -0
  72. package/dist/mllike-BSnXJBGA.js +272 -0
  73. package/dist/modelica-vUgVs--1.js +93 -0
  74. package/dist/mscgen-Cpl0NYLN.js +104 -0
  75. package/dist/mumps-CQoS1kWX.js +25 -0
  76. package/dist/nginx-zDPm3Z74.js +89 -0
  77. package/dist/nsis-BCLyjY7m.js +62 -0
  78. package/dist/ntriples-CsNjv2QF.js +79 -0
  79. package/dist/octave-C8PmmSRH.js +143 -0
  80. package/dist/oz-Ce8aN8oE.js +151 -0
  81. package/dist/pascal-De0D6mP7.js +77 -0
  82. package/dist/perl-B4bSCe1C.js +915 -0
  83. package/dist/pig-D24Z8EXi.js +54 -0
  84. package/dist/powershell-DkYVfTzP.js +249 -0
  85. package/dist/properties-Dn9wna3M.js +26 -0
  86. package/dist/protobuf-BPIjwpzm.js +49 -0
  87. package/dist/pug-TGXr6c5j.js +248 -0
  88. package/dist/puppet-nyd4dhjf.js +45 -0
  89. package/dist/python-BkR3uSy8.js +313 -0
  90. package/dist/q-DyHZGnqm.js +86 -0
  91. package/dist/r-LKEuhEGI.js +104 -0
  92. package/dist/rpm-IznJm2Xc.js +57 -0
  93. package/dist/ruby-CcYfvIk6.js +228 -0
  94. package/dist/sas-7E8yHoCW.js +105 -0
  95. package/dist/scheme-DjibxsNh.js +124 -0
  96. package/dist/shell-C0C2sNA_.js +182 -0
  97. package/dist/sieve-Bwz7vjP5.js +72 -0
  98. package/dist/simple-mode-mNVtnu0l.js +89 -0
  99. package/dist/smalltalk-Bhddl2pB.js +48 -0
  100. package/dist/solr-BNlsLglM.js +41 -0
  101. package/dist/sparql-FarWu_Gb.js +197 -0
  102. package/dist/spreadsheet-C-cy4P5N.js +49 -0
  103. package/dist/sql-CfG5lQ3l.js +282 -0
  104. package/dist/stex-Du4h4KAU.js +129 -0
  105. package/dist/stylus-CAdqWld3.js +250 -0
  106. package/dist/swift-DSxqR9R6.js +230 -0
  107. package/dist/tcl-xfoLljhY.js +81 -0
  108. package/dist/textile-D1AWE-pc.js +295 -0
  109. package/dist/tiddlywiki-5wqsXtSk.js +155 -0
  110. package/dist/tiki-__Kn3CeS.js +181 -0
  111. package/dist/toml-DWAmxCjl.js +58 -0
  112. package/dist/troff-D2UO-fKf.js +35 -0
  113. package/dist/ttcn-Bsa4sfRm.js +123 -0
  114. package/dist/ttcn-cfg-Bac_acMi.js +88 -0
  115. package/dist/turtle-xwJUxoPV.js +80 -0
  116. package/dist/vb-c2kQGd6-.js +74 -0
  117. package/dist/vbscript-1f_Dhg5H.js +324 -0
  118. package/dist/velocity-DJd0pTTC.js +96 -0
  119. package/dist/verilog-CiS1jyi5.js +262 -0
  120. package/dist/vhdl-T9HkrbI2.js +106 -0
  121. package/dist/webidl-CjfDENEo.js +155 -0
  122. package/dist/xquery-Ct6lEb4B.js +422 -0
  123. package/dist/yacas-C0absKBh.js +73 -0
  124. package/dist/z80-Pki2zAjW.js +61 -0
  125. package/package.json +14 -8
@@ -0,0 +1,295 @@
1
+ var f = {
2
+ addition: "inserted",
3
+ attributes: "propertyName",
4
+ bold: "strong",
5
+ cite: "keyword",
6
+ code: "monospace",
7
+ definitionList: "list",
8
+ deletion: "deleted",
9
+ div: "punctuation",
10
+ em: "emphasis",
11
+ footnote: "variable",
12
+ footCite: "qualifier",
13
+ header: "heading",
14
+ html: "comment",
15
+ image: "atom",
16
+ italic: "emphasis",
17
+ link: "link",
18
+ linkDefinition: "link",
19
+ list1: "list",
20
+ list2: "list.special",
21
+ list3: "list",
22
+ notextile: "string.special",
23
+ pre: "operator",
24
+ p: "content",
25
+ quote: "bracket",
26
+ span: "quote",
27
+ specialChar: "character",
28
+ strong: "strong",
29
+ sub: "content.special",
30
+ sup: "content.special",
31
+ table: "variableName.special",
32
+ tableHeading: "operator"
33
+ };
34
+ function h(i, e) {
35
+ e.mode = r.newLayout, e.tableHeading = !1, e.layoutType === "definitionList" && e.spanningLayout && i.match(l("definitionListEnd"), !1) && (e.spanningLayout = !1);
36
+ }
37
+ function s(i, e, n) {
38
+ if (n === "_")
39
+ return i.eat("_") ? a(i, e, "italic", /__/, 2) : a(i, e, "em", /_/, 1);
40
+ if (n === "*")
41
+ return i.eat("*") ? a(i, e, "bold", /\*\*/, 2) : a(i, e, "strong", /\*/, 1);
42
+ if (n === "[")
43
+ return i.match(/\d+\]/) && (e.footCite = !0), u(e);
44
+ if (n === "(") {
45
+ var o = i.match(/^(r|tm|c)\)/);
46
+ if (o)
47
+ return f.specialChar;
48
+ }
49
+ if (n === "<" && i.match(/(\w+)[^>]+>[^<]+<\/\1>/))
50
+ return f.html;
51
+ if (n === "?" && i.eat("?"))
52
+ return a(i, e, "cite", /\?\?/, 2);
53
+ if (n === "=" && i.eat("="))
54
+ return a(i, e, "notextile", /==/, 2);
55
+ if (n === "-" && !i.eat("-"))
56
+ return a(i, e, "deletion", /-/, 1);
57
+ if (n === "+")
58
+ return a(i, e, "addition", /\+/, 1);
59
+ if (n === "~")
60
+ return a(i, e, "sub", /~/, 1);
61
+ if (n === "^")
62
+ return a(i, e, "sup", /\^/, 1);
63
+ if (n === "%")
64
+ return a(i, e, "span", /%/, 1);
65
+ if (n === "@")
66
+ return a(i, e, "code", /@/, 1);
67
+ if (n === "!") {
68
+ var c = a(i, e, "image", /(?:\([^\)]+\))?!/, 1);
69
+ return i.match(/^:\S+/), c;
70
+ }
71
+ return u(e);
72
+ }
73
+ function a(i, e, n, o, c) {
74
+ var d = i.pos > c ? i.string.charAt(i.pos - c - 1) : null, p = i.peek();
75
+ if (e[n]) {
76
+ if ((!p || /\W/.test(p)) && d && /\S/.test(d)) {
77
+ var y = u(e);
78
+ return e[n] = !1, y;
79
+ }
80
+ } else (!d || /\W/.test(d)) && p && /\S/.test(p) && i.match(new RegExp("^.*\\S" + o.source + "(?:\\W|$)"), !1) && (e[n] = !0, e.mode = r.attributes);
81
+ return u(e);
82
+ }
83
+ function u(i) {
84
+ var e = b(i);
85
+ if (e) return e;
86
+ var n = [];
87
+ return i.layoutType && n.push(f[i.layoutType]), n = n.concat(g(
88
+ i,
89
+ "addition",
90
+ "bold",
91
+ "cite",
92
+ "code",
93
+ "deletion",
94
+ "em",
95
+ "footCite",
96
+ "image",
97
+ "italic",
98
+ "link",
99
+ "span",
100
+ "strong",
101
+ "sub",
102
+ "sup",
103
+ "table",
104
+ "tableHeading"
105
+ )), i.layoutType === "header" && n.push(f.header + "-" + i.header), n.length ? n.join(" ") : null;
106
+ }
107
+ function b(i) {
108
+ var e = i.layoutType;
109
+ switch (e) {
110
+ case "notextile":
111
+ case "code":
112
+ case "pre":
113
+ return f[e];
114
+ default:
115
+ return i.notextile ? f.notextile + (e ? " " + f[e] : "") : null;
116
+ }
117
+ }
118
+ function g(i) {
119
+ for (var e = [], n = 1; n < arguments.length; ++n)
120
+ i[arguments[n]] && e.push(f[arguments[n]]);
121
+ return e;
122
+ }
123
+ function m(i) {
124
+ var e = i.spanningLayout, n = i.layoutType;
125
+ for (var o in i) i.hasOwnProperty(o) && delete i[o];
126
+ i.mode = r.newLayout, e && (i.layoutType = n, i.spanningLayout = !0);
127
+ }
128
+ var t = {
129
+ cache: {},
130
+ single: {
131
+ bc: "bc",
132
+ bq: "bq",
133
+ definitionList: /- .*?:=+/,
134
+ definitionListEnd: /.*=:\s*$/,
135
+ div: "div",
136
+ drawTable: /\|.*\|/,
137
+ foot: /fn\d+/,
138
+ header: /h[1-6]/,
139
+ html: /\s*<(?:\/)?(\w+)(?:[^>]+)?>(?:[^<]+<\/\1>)?/,
140
+ link: /[^"]+":\S/,
141
+ linkDefinition: /\[[^\s\]]+\]\S+/,
142
+ list: /(?:#+|\*+)/,
143
+ notextile: "notextile",
144
+ para: "p",
145
+ pre: "pre",
146
+ table: "table",
147
+ tableCellAttributes: /[\/\\]\d+/,
148
+ tableHeading: /\|_\./,
149
+ tableText: /[^"_\*\[\(\?\+~\^%@|-]+/,
150
+ text: /[^!"_=\*\[\(<\?\+~\^%@-]+/
151
+ },
152
+ attributes: {
153
+ align: /(?:<>|<|>|=)/,
154
+ selector: /\([^\(][^\)]+\)/,
155
+ lang: /\[[^\[\]]+\]/,
156
+ pad: /(?:\(+|\)+){1,2}/,
157
+ css: /\{[^\}]+\}/
158
+ },
159
+ createRe: function(i) {
160
+ switch (i) {
161
+ case "drawTable":
162
+ return t.makeRe("^", t.single.drawTable, "$");
163
+ case "html":
164
+ return t.makeRe("^", t.single.html, "(?:", t.single.html, ")*", "$");
165
+ case "linkDefinition":
166
+ return t.makeRe("^", t.single.linkDefinition, "$");
167
+ case "listLayout":
168
+ return t.makeRe("^", t.single.list, l("allAttributes"), "*\\s+");
169
+ case "tableCellAttributes":
170
+ return t.makeRe("^", t.choiceRe(
171
+ t.single.tableCellAttributes,
172
+ l("allAttributes")
173
+ ), "+\\.");
174
+ case "type":
175
+ return t.makeRe("^", l("allTypes"));
176
+ case "typeLayout":
177
+ return t.makeRe(
178
+ "^",
179
+ l("allTypes"),
180
+ l("allAttributes"),
181
+ "*\\.\\.?",
182
+ "(\\s+|$)"
183
+ );
184
+ case "attributes":
185
+ return t.makeRe("^", l("allAttributes"), "+");
186
+ case "allTypes":
187
+ return t.choiceRe(
188
+ t.single.div,
189
+ t.single.foot,
190
+ t.single.header,
191
+ t.single.bc,
192
+ t.single.bq,
193
+ t.single.notextile,
194
+ t.single.pre,
195
+ t.single.table,
196
+ t.single.para
197
+ );
198
+ case "allAttributes":
199
+ return t.choiceRe(
200
+ t.attributes.selector,
201
+ t.attributes.css,
202
+ t.attributes.lang,
203
+ t.attributes.align,
204
+ t.attributes.pad
205
+ );
206
+ default:
207
+ return t.makeRe("^", t.single[i]);
208
+ }
209
+ },
210
+ makeRe: function() {
211
+ for (var i = "", e = 0; e < arguments.length; ++e) {
212
+ var n = arguments[e];
213
+ i += typeof n == "string" ? n : n.source;
214
+ }
215
+ return new RegExp(i);
216
+ },
217
+ choiceRe: function() {
218
+ for (var i = [arguments[0]], e = 1; e < arguments.length; ++e)
219
+ i[e * 2 - 1] = "|", i[e * 2] = arguments[e];
220
+ return i.unshift("(?:"), i.push(")"), t.makeRe.apply(null, i);
221
+ }
222
+ };
223
+ function l(i) {
224
+ return t.cache[i] || (t.cache[i] = t.createRe(i));
225
+ }
226
+ var r = {
227
+ newLayout: function(i, e) {
228
+ if (i.match(l("typeLayout"), !1))
229
+ return e.spanningLayout = !1, (e.mode = r.blockType)(i, e);
230
+ var n;
231
+ return b(e) || (i.match(l("listLayout"), !1) ? n = r.list : i.match(l("drawTable"), !1) ? n = r.table : i.match(l("linkDefinition"), !1) ? n = r.linkDefinition : i.match(l("definitionList")) ? n = r.definitionList : i.match(l("html"), !1) && (n = r.html)), (e.mode = n || r.text)(i, e);
232
+ },
233
+ blockType: function(i, e) {
234
+ var n, o;
235
+ if (e.layoutType = null, n = i.match(l("type")))
236
+ o = n[0];
237
+ else
238
+ return (e.mode = r.text)(i, e);
239
+ return (n = o.match(l("header"))) ? (e.layoutType = "header", e.header = parseInt(n[0][1])) : o.match(l("bq")) ? e.layoutType = "quote" : o.match(l("bc")) ? e.layoutType = "code" : o.match(l("foot")) ? e.layoutType = "footnote" : o.match(l("notextile")) ? e.layoutType = "notextile" : o.match(l("pre")) ? e.layoutType = "pre" : o.match(l("div")) ? e.layoutType = "div" : o.match(l("table")) && (e.layoutType = "table"), e.mode = r.attributes, u(e);
240
+ },
241
+ text: function(i, e) {
242
+ if (i.match(l("text"))) return u(e);
243
+ var n = i.next();
244
+ return n === '"' ? (e.mode = r.link)(i, e) : s(i, e, n);
245
+ },
246
+ attributes: function(i, e) {
247
+ return e.mode = r.layoutLength, i.match(l("attributes")) ? f.attributes : u(e);
248
+ },
249
+ layoutLength: function(i, e) {
250
+ return i.eat(".") && i.eat(".") && (e.spanningLayout = !0), e.mode = r.text, u(e);
251
+ },
252
+ list: function(i, e) {
253
+ var n = i.match(l("list"));
254
+ e.listDepth = n[0].length;
255
+ var o = (e.listDepth - 1) % 3;
256
+ return o ? o === 1 ? e.layoutType = "list2" : e.layoutType = "list3" : e.layoutType = "list1", e.mode = r.attributes, u(e);
257
+ },
258
+ link: function(i, e) {
259
+ return e.mode = r.text, i.match(l("link")) ? (i.match(/\S+/), f.link) : u(e);
260
+ },
261
+ linkDefinition: function(i) {
262
+ return i.skipToEnd(), f.linkDefinition;
263
+ },
264
+ definitionList: function(i, e) {
265
+ return i.match(l("definitionList")), e.layoutType = "definitionList", i.match(/\s*$/) ? e.spanningLayout = !0 : e.mode = r.attributes, u(e);
266
+ },
267
+ html: function(i) {
268
+ return i.skipToEnd(), f.html;
269
+ },
270
+ table: function(i, e) {
271
+ return e.layoutType = "table", (e.mode = r.tableCell)(i, e);
272
+ },
273
+ tableCell: function(i, e) {
274
+ return i.match(l("tableHeading")) ? e.tableHeading = !0 : i.eat("|"), e.mode = r.tableCellAttributes, u(e);
275
+ },
276
+ tableCellAttributes: function(i, e) {
277
+ return e.mode = r.tableText, i.match(l("tableCellAttributes")) ? f.attributes : u(e);
278
+ },
279
+ tableText: function(i, e) {
280
+ return i.match(l("tableText")) ? u(e) : i.peek() === "|" ? (e.mode = r.tableCell, u(e)) : s(i, e, i.next());
281
+ }
282
+ };
283
+ const k = {
284
+ name: "textile",
285
+ startState: function() {
286
+ return { mode: r.newLayout };
287
+ },
288
+ token: function(i, e) {
289
+ return i.sol() && h(i, e), e.mode(i, e);
290
+ },
291
+ blankLine: m
292
+ };
293
+ export {
294
+ k as textile
295
+ };
@@ -0,0 +1,155 @@
1
+ var c = {}, l = {
2
+ allTags: !0,
3
+ closeAll: !0,
4
+ list: !0,
5
+ newJournal: !0,
6
+ newTiddler: !0,
7
+ permaview: !0,
8
+ saveChanges: !0,
9
+ search: !0,
10
+ slider: !0,
11
+ tabs: !0,
12
+ tag: !0,
13
+ tagging: !0,
14
+ tags: !0,
15
+ tiddler: !0,
16
+ timeline: !0,
17
+ today: !0,
18
+ version: !0,
19
+ option: !0,
20
+ with: !0,
21
+ filter: !0
22
+ }, f = /[\w_\-]/i, k = /^\-\-\-\-+$/, h = /^\/\*\*\*$/, d = /^\*\*\*\/$/, a = /^<<<$/, p = /^\/\/\{\{\{$/, w = /^\/\/\}\}\}$/, b = /^<!--\{\{\{-->$/, v = /^<!--\}\}\}-->$/, S = /^\{\{\{$/, y = /^\}\}\}$/, $ = /.*?\}\}\}/;
23
+ function o(e, t, r) {
24
+ return t.tokenize = r, r(e, t);
25
+ }
26
+ function i(e, t) {
27
+ var r = e.sol(), n = e.peek();
28
+ if (t.block = !1, r && /[<\/\*{}\-]/.test(n)) {
29
+ if (e.match(S))
30
+ return t.block = !0, o(e, t, u);
31
+ if (e.match(a))
32
+ return "quote";
33
+ if (e.match(h) || e.match(d) || e.match(p) || e.match(w) || e.match(b) || e.match(v))
34
+ return "comment";
35
+ if (e.match(k))
36
+ return "contentSeparator";
37
+ }
38
+ if (e.next(), r && /[\/\*!#;:>|]/.test(n)) {
39
+ if (n == "!")
40
+ return e.skipToEnd(), "header";
41
+ if (n == "*")
42
+ return e.eatWhile("*"), "comment";
43
+ if (n == "#")
44
+ return e.eatWhile("#"), "comment";
45
+ if (n == ";")
46
+ return e.eatWhile(";"), "comment";
47
+ if (n == ":")
48
+ return e.eatWhile(":"), "comment";
49
+ if (n == ">")
50
+ return e.eatWhile(">"), "quote";
51
+ if (n == "|")
52
+ return "header";
53
+ }
54
+ if (n == "{" && e.match("{{"))
55
+ return o(e, t, u);
56
+ if (/[hf]/i.test(n) && /[ti]/i.test(e.peek()) && e.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i))
57
+ return "link";
58
+ if (n == '"')
59
+ return "string";
60
+ if (n == "~" || /[\[\]]/.test(n) && e.match(n))
61
+ return "brace";
62
+ if (n == "@")
63
+ return e.eatWhile(f), "link";
64
+ if (/\d/.test(n))
65
+ return e.eatWhile(/\d/), "number";
66
+ if (n == "/") {
67
+ if (e.eat("%"))
68
+ return o(e, t, z);
69
+ if (e.eat("/"))
70
+ return o(e, t, W);
71
+ }
72
+ if (n == "_" && e.eat("_"))
73
+ return o(e, t, x);
74
+ if (n == "-" && e.eat("-")) {
75
+ if (e.peek() != " ")
76
+ return o(e, t, g);
77
+ if (e.peek() == " ")
78
+ return "brace";
79
+ }
80
+ return n == "'" && e.eat("'") ? o(e, t, C) : n == "<" && e.eat("<") ? o(e, t, T) : (e.eatWhile(/[\w\$_]/), c.propertyIsEnumerable(e.current()) ? "keyword" : null);
81
+ }
82
+ function z(e, t) {
83
+ for (var r = !1, n; n = e.next(); ) {
84
+ if (n == "/" && r) {
85
+ t.tokenize = i;
86
+ break;
87
+ }
88
+ r = n == "%";
89
+ }
90
+ return "comment";
91
+ }
92
+ function C(e, t) {
93
+ for (var r = !1, n; n = e.next(); ) {
94
+ if (n == "'" && r) {
95
+ t.tokenize = i;
96
+ break;
97
+ }
98
+ r = n == "'";
99
+ }
100
+ return "strong";
101
+ }
102
+ function u(e, t) {
103
+ var r = t.block;
104
+ return r && e.current() ? "comment" : !r && e.match($) || r && e.sol() && e.match(y) ? (t.tokenize = i, "comment") : (e.next(), "comment");
105
+ }
106
+ function W(e, t) {
107
+ for (var r = !1, n; n = e.next(); ) {
108
+ if (n == "/" && r) {
109
+ t.tokenize = i;
110
+ break;
111
+ }
112
+ r = n == "/";
113
+ }
114
+ return "emphasis";
115
+ }
116
+ function x(e, t) {
117
+ for (var r = !1, n; n = e.next(); ) {
118
+ if (n == "_" && r) {
119
+ t.tokenize = i;
120
+ break;
121
+ }
122
+ r = n == "_";
123
+ }
124
+ return "link";
125
+ }
126
+ function g(e, t) {
127
+ for (var r = !1, n; n = e.next(); ) {
128
+ if (n == "-" && r) {
129
+ t.tokenize = i;
130
+ break;
131
+ }
132
+ r = n == "-";
133
+ }
134
+ return "deleted";
135
+ }
136
+ function T(e, t) {
137
+ if (e.current() == "<<")
138
+ return "meta";
139
+ var r = e.next();
140
+ return r ? r == ">" && e.peek() == ">" ? (e.next(), t.tokenize = i, "meta") : (e.eatWhile(/[\w\$_]/), l.propertyIsEnumerable(e.current()) ? "keyword" : null) : (t.tokenize = i, null);
141
+ }
142
+ const m = {
143
+ name: "tiddlywiki",
144
+ startState: function() {
145
+ return { tokenize: i };
146
+ },
147
+ token: function(e, t) {
148
+ if (e.eatSpace()) return null;
149
+ var r = t.tokenize(e, t);
150
+ return r;
151
+ }
152
+ };
153
+ export {
154
+ m as tiddlyWiki
155
+ };
@@ -0,0 +1,181 @@
1
+ function c(e, t, n) {
2
+ return function(r, a) {
3
+ for (; !r.eol(); ) {
4
+ if (r.match(t)) {
5
+ a.tokenize = o;
6
+ break;
7
+ }
8
+ r.next();
9
+ }
10
+ return n && (a.tokenize = n), e;
11
+ };
12
+ }
13
+ function f(e) {
14
+ return function(t, n) {
15
+ for (; !t.eol(); )
16
+ t.next();
17
+ return n.tokenize = o, e;
18
+ };
19
+ }
20
+ function o(e, t) {
21
+ function n(p) {
22
+ return t.tokenize = p, p(e, t);
23
+ }
24
+ var r = e.sol(), a = e.next();
25
+ switch (a) {
26
+ //switch is generally much faster than if, so it is used here
27
+ case "{":
28
+ return e.eat("/"), e.eatSpace(), e.eatWhile(/[^\s\u00a0=\"\'\/?(}]/), t.tokenize = h, "tag";
29
+ case "_":
30
+ if (e.eat("_"))
31
+ return n(c("strong", "__", o));
32
+ break;
33
+ case "'":
34
+ if (e.eat("'"))
35
+ return n(c("em", "''", o));
36
+ break;
37
+ case "(":
38
+ if (e.eat("("))
39
+ return n(c("link", "))", o));
40
+ break;
41
+ case "[":
42
+ return n(c("url", "]", o));
43
+ case "|":
44
+ if (e.eat("|"))
45
+ return n(c("comment", "||"));
46
+ break;
47
+ case "-":
48
+ if (e.eat("="))
49
+ return n(c("header string", "=-", o));
50
+ if (e.eat("-"))
51
+ return n(c("error tw-deleted", "--", o));
52
+ break;
53
+ case "=":
54
+ if (e.match("=="))
55
+ return n(c("tw-underline", "===", o));
56
+ break;
57
+ case ":":
58
+ if (e.eat(":"))
59
+ return n(c("comment", "::"));
60
+ break;
61
+ case "^":
62
+ return n(c("tw-box", "^"));
63
+ case "~":
64
+ if (e.match("np~"))
65
+ return n(c("meta", "~/np~"));
66
+ break;
67
+ }
68
+ if (r)
69
+ switch (a) {
70
+ case "!":
71
+ return e.match("!!!!!") || e.match("!!!!") || e.match("!!!") || e.match("!!"), n(f("header string"));
72
+ case "*":
73
+ //unordered list line item, or <li /> at start of line
74
+ case "#":
75
+ //ordered list line item, or <li /> at start of line
76
+ case "+":
77
+ return n(f("tw-listitem bracket"));
78
+ }
79
+ return null;
80
+ }
81
+ var g, s;
82
+ function h(e, t) {
83
+ var n = e.next(), r = e.peek();
84
+ return n == "}" ? (t.tokenize = o, "tag") : n == "(" || n == ")" ? "bracket" : n == "=" ? (s = "equals", r == ">" && (e.next(), r = e.peek()), /[\'\"]/.test(r) || (t.tokenize = z()), "operator") : /[\'\"]/.test(n) ? (t.tokenize = w(n), t.tokenize(e, t)) : (e.eatWhile(/[^\s\u00a0=\"\'\/?]/), "keyword");
85
+ }
86
+ function w(e) {
87
+ return function(t, n) {
88
+ for (; !t.eol(); )
89
+ if (t.next() == e) {
90
+ n.tokenize = h;
91
+ break;
92
+ }
93
+ return "string";
94
+ };
95
+ }
96
+ function z() {
97
+ return function(e, t) {
98
+ for (; !e.eol(); ) {
99
+ var n = e.next(), r = e.peek();
100
+ if (n == " " || n == "," || /[ )}]/.test(r)) {
101
+ t.tokenize = h;
102
+ break;
103
+ }
104
+ }
105
+ return "string";
106
+ };
107
+ }
108
+ var i, l;
109
+ function k() {
110
+ for (var e = arguments.length - 1; e >= 0; e--) i.cc.push(arguments[e]);
111
+ }
112
+ function u() {
113
+ return k.apply(null, arguments), !0;
114
+ }
115
+ function b(e, t) {
116
+ var n = i.context && i.context.noIndent;
117
+ i.context = {
118
+ prev: i.context,
119
+ pluginName: e,
120
+ indent: i.indented,
121
+ startOfLine: t,
122
+ noIndent: n
123
+ };
124
+ }
125
+ function x() {
126
+ i.context && (i.context = i.context.prev);
127
+ }
128
+ function L(e) {
129
+ if (e == "openPlugin")
130
+ return i.pluginName = g, u(d, N(i.startOfLine));
131
+ if (e == "closePlugin") {
132
+ var t = !1;
133
+ return i.context ? (t = i.context.pluginName != g, x()) : t = !0, t && (l = "error"), u(P(t));
134
+ } else return e == "string" && ((!i.context || i.context.name != "!cdata") && b("!cdata"), i.tokenize == o && x()), u();
135
+ }
136
+ function N(e) {
137
+ return function(t) {
138
+ return t == "selfclosePlugin" || t == "endPlugin" || t == "endPlugin" && b(i.pluginName, e), u();
139
+ };
140
+ }
141
+ function P(e) {
142
+ return function(t) {
143
+ return e && (l = "error"), t == "endPlugin" ? u() : k();
144
+ };
145
+ }
146
+ function d(e) {
147
+ return e == "keyword" ? (l = "attribute", u(d)) : e == "equals" ? u(O, d) : k();
148
+ }
149
+ function O(e) {
150
+ return e == "keyword" ? (l = "string", u()) : e == "string" ? u(v) : k();
151
+ }
152
+ function v(e) {
153
+ return e == "string" ? u(v) : k();
154
+ }
155
+ const S = {
156
+ name: "tiki",
157
+ startState: function() {
158
+ return { tokenize: o, cc: [], indented: 0, startOfLine: !0, pluginName: null, context: null };
159
+ },
160
+ token: function(e, t) {
161
+ if (e.sol() && (t.startOfLine = !0, t.indented = e.indentation()), e.eatSpace()) return null;
162
+ l = s = g = null;
163
+ var n = t.tokenize(e, t);
164
+ if ((n || s) && n != "comment")
165
+ for (i = t; ; ) {
166
+ var r = t.cc.pop() || L;
167
+ if (r(s || n)) break;
168
+ }
169
+ return t.startOfLine = !1, l || n;
170
+ },
171
+ indent: function(e, t, n) {
172
+ var r = e.context;
173
+ if (r && r.noIndent) return 0;
174
+ for (r && /^{\//.test(t) && (r = r.prev); r && !r.startOfLine; )
175
+ r = r.prev;
176
+ return r ? r.indent + n.unit : 0;
177
+ }
178
+ };
179
+ export {
180
+ S as tiki
181
+ };
@@ -0,0 +1,58 @@
1
+ const r = {
2
+ name: "toml",
3
+ startState: function() {
4
+ return {
5
+ inString: !1,
6
+ stringType: "",
7
+ lhs: !0,
8
+ inArray: 0
9
+ };
10
+ },
11
+ token: function(n, e) {
12
+ let i;
13
+ if (!e.inString && (i = n.match(/^('''|"""|'|")/)) && (e.stringType = i[0], e.inString = !0), n.sol() && !e.inString && e.inArray === 0 && (e.lhs = !0), e.inString) {
14
+ for (; e.inString; )
15
+ if (n.match(e.stringType))
16
+ e.inString = !1;
17
+ else if (n.peek() === "\\")
18
+ n.next(), n.next();
19
+ else {
20
+ if (n.eol())
21
+ break;
22
+ n.match(/^.[^\\\"\']*/);
23
+ }
24
+ return e.lhs ? "property" : "string";
25
+ } else {
26
+ if (e.inArray && n.peek() === "]")
27
+ return n.next(), e.inArray--, "bracket";
28
+ if (e.lhs && n.peek() === "[" && n.skipTo("]"))
29
+ return n.next(), n.peek() === "]" && n.next(), "atom";
30
+ if (n.peek() === "#")
31
+ return n.skipToEnd(), "comment";
32
+ if (n.eatSpace())
33
+ return null;
34
+ if (e.lhs && n.eatWhile(function(l) {
35
+ return l != "=" && l != " ";
36
+ }))
37
+ return "property";
38
+ if (e.lhs && n.peek() === "=")
39
+ return n.next(), e.lhs = !1, null;
40
+ if (!e.lhs && n.match(/^\d\d\d\d[\d\-\:\.T]*Z/))
41
+ return "atom";
42
+ if (!e.lhs && (n.match("true") || n.match("false")))
43
+ return "atom";
44
+ if (!e.lhs && n.peek() === "[")
45
+ return e.inArray++, n.next(), "bracket";
46
+ if (!e.lhs && n.match(/^\-?\d+(?:\.\d+)?/))
47
+ return "number";
48
+ n.eatSpace() || n.next();
49
+ }
50
+ return null;
51
+ },
52
+ languageData: {
53
+ commentTokens: { line: "#" }
54
+ }
55
+ };
56
+ export {
57
+ r as toml
58
+ };