@milkdown/crepe 7.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +11 -0
  3. package/lib/apl-p0IPP13W.js +76 -0
  4. package/lib/asciiarmor-lJsBxlJJ.js +34 -0
  5. package/lib/asn1-Q9v1zIy5.js +102 -0
  6. package/lib/asterisk-foNkeTjy.js +273 -0
  7. package/lib/brainfuck-0XqyXpNS.js +35 -0
  8. package/lib/clike-ak6Z6Yhe.js +639 -0
  9. package/lib/clojure-iYO8U8Sg.js +810 -0
  10. package/lib/clsx-7d8NmkQq.js +21 -0
  11. package/lib/cmake-SVzjkxV_.js +28 -0
  12. package/lib/cobol-APHEnAOX.js +74 -0
  13. package/lib/coffeescript-KqQa0SYG.js +182 -0
  14. package/lib/commonlisp-bwqNqR5V.js +79 -0
  15. package/lib/core/crepe.d.ts +21 -0
  16. package/lib/core/crepe.d.ts.map +1 -0
  17. package/lib/core/index.d.ts +3 -0
  18. package/lib/core/index.d.ts.map +1 -0
  19. package/lib/core/slice.d.ts +12 -0
  20. package/lib/core/slice.d.ts.map +1 -0
  21. package/lib/crystal-BViWuDpA.js +217 -0
  22. package/lib/css-KHXHXfXg.js +1572 -0
  23. package/lib/cypher-XpTt4zQ3.js +69 -0
  24. package/lib/d-fLig6yqY.js +139 -0
  25. package/lib/diff-WoKGLpy6.js +18 -0
  26. package/lib/dockerfile-u6f6Vw2s.js +194 -0
  27. package/lib/dtd-SIJRUW6K.js +91 -0
  28. package/lib/dylan-4HCLhpWP.js +238 -0
  29. package/lib/ebnf-h_0lged5.js +77 -0
  30. package/lib/ecl-Lf4FF0lf.js +133 -0
  31. package/lib/eiffel-qlw8KUyf.js +112 -0
  32. package/lib/elm-QRnB3zXs.js +108 -0
  33. package/lib/erlang-fyVKb7eK.js +488 -0
  34. package/lib/factor-BEeN4upY.js +65 -0
  35. package/lib/fcl-lRek3hEb.js +106 -0
  36. package/lib/feature/block-edit/handle/component.d.ts +9 -0
  37. package/lib/feature/block-edit/handle/component.d.ts.map +1 -0
  38. package/lib/feature/block-edit/handle/index.d.ts +12 -0
  39. package/lib/feature/block-edit/handle/index.d.ts.map +1 -0
  40. package/lib/feature/block-edit/index.d.ts +3 -0
  41. package/lib/feature/block-edit/index.d.ts.map +1 -0
  42. package/lib/feature/block-edit/menu/component.d.ts +14 -0
  43. package/lib/feature/block-edit/menu/component.d.ts.map +1 -0
  44. package/lib/feature/block-edit/menu/config.d.ts +21 -0
  45. package/lib/feature/block-edit/menu/config.d.ts.map +1 -0
  46. package/lib/feature/block-edit/menu/icons.d.ts +14 -0
  47. package/lib/feature/block-edit/menu/icons.d.ts.map +1 -0
  48. package/lib/feature/block-edit/menu/index.d.ts +9 -0
  49. package/lib/feature/block-edit/menu/index.d.ts.map +1 -0
  50. package/lib/feature/code-mirror/index.d.ts +3 -0
  51. package/lib/feature/code-mirror/index.d.ts.map +1 -0
  52. package/lib/feature/gap-cursor/index.d.ts +3 -0
  53. package/lib/feature/gap-cursor/index.d.ts.map +1 -0
  54. package/lib/feature/image-block/index.d.ts +3 -0
  55. package/lib/feature/image-block/index.d.ts.map +1 -0
  56. package/lib/feature/index.d.ts +18 -0
  57. package/lib/feature/index.d.ts.map +1 -0
  58. package/lib/feature/link-tooltip/consts.d.ts +5 -0
  59. package/lib/feature/link-tooltip/consts.d.ts.map +1 -0
  60. package/lib/feature/link-tooltip/index.d.ts +3 -0
  61. package/lib/feature/link-tooltip/index.d.ts.map +1 -0
  62. package/lib/feature/list-item/consts.d.ts +2 -0
  63. package/lib/feature/list-item/consts.d.ts.map +1 -0
  64. package/lib/feature/list-item/index.d.ts +3 -0
  65. package/lib/feature/list-item/index.d.ts.map +1 -0
  66. package/lib/feature/placeholder/index.d.ts +10 -0
  67. package/lib/feature/placeholder/index.d.ts.map +1 -0
  68. package/lib/feature/shared.d.ts +3 -0
  69. package/lib/feature/shared.d.ts.map +1 -0
  70. package/lib/feature/toolbar/component.d.ts +13 -0
  71. package/lib/feature/toolbar/component.d.ts.map +1 -0
  72. package/lib/feature/toolbar/consts.d.ts +5 -0
  73. package/lib/feature/toolbar/consts.d.ts.map +1 -0
  74. package/lib/feature/toolbar/index.d.ts +3 -0
  75. package/lib/feature/toolbar/index.d.ts.map +1 -0
  76. package/lib/forth-ua2bRd8T.js +60 -0
  77. package/lib/fortran-WnF7znuN.js +443 -0
  78. package/lib/gas-wowve1o7.js +183 -0
  79. package/lib/gherkin-m7GIChu3.js +34 -0
  80. package/lib/go-th443Dhb.js +158 -0
  81. package/lib/groovy-tR4RiZnc.js +161 -0
  82. package/lib/haskell-jxVBofv5.js +375 -0
  83. package/lib/haxe-kWPI2tq3.js +390 -0
  84. package/lib/hooks-82sqkbtE.js +21 -0
  85. package/lib/http-3GIFWUlG.js +45 -0
  86. package/lib/icons-HYkfuR-O.js +50 -0
  87. package/lib/idl-PvpMZg-l.js +947 -0
  88. package/lib/index-0RbcZMbq.js +8 -0
  89. package/lib/index-4afXjFMY.js +517 -0
  90. package/lib/index-7MeyepDG.js +78 -0
  91. package/lib/index-7QgQq3x3.js +551 -0
  92. package/lib/index-7pgP6qYs.js +107 -0
  93. package/lib/index-8DvtgRVa.js +19511 -0
  94. package/lib/index-8Gg-jEP4.js +288 -0
  95. package/lib/index-8S8qcncB.js +507 -0
  96. package/lib/index-9A_GmGh4.js +1039 -0
  97. package/lib/index-EJJfYLzA.js +928 -0
  98. package/lib/index-Eg39w5kL.js +984 -0
  99. package/lib/index-FIk_7oPb.js +168 -0
  100. package/lib/index-LlbrXb_n.js +368 -0
  101. package/lib/index-MovKtgMG.js +121 -0
  102. package/lib/index-N9GtIS4X.js +64 -0
  103. package/lib/index-Pwn25-kf.js +8 -0
  104. package/lib/index-SdFSDosa.js +1295 -0
  105. package/lib/index-W5Th22-Z.js +1744 -0
  106. package/lib/index-XiXSFLmI.js +20975 -0
  107. package/lib/index-bknOViGv.js +47 -0
  108. package/lib/index-bkuIUPFS.js +275 -0
  109. package/lib/index-jPA8J9Eo.js +8 -0
  110. package/lib/index-lsG76a9s.js +552 -0
  111. package/lib/index-oTRzPo3B.js +146 -0
  112. package/lib/index-rrf6_6DC.js +317 -0
  113. package/lib/index-vJbZIHYF.js +81 -0
  114. package/lib/index-vPRh55CO.js +137 -0
  115. package/lib/index-vxy63hib.js +323 -0
  116. package/lib/index-wn1_LgCS.js +99 -0
  117. package/lib/index-xHADmDT3.js +12 -0
  118. package/lib/index-yt2EpMtv.js +141 -0
  119. package/lib/index.d.ts +4 -0
  120. package/lib/index.d.ts.map +1 -0
  121. package/lib/index.es.js +7 -0
  122. package/lib/javascript-8ZHqHagw.js +758 -0
  123. package/lib/jinja2-vsOFe0qD.js +154 -0
  124. package/lib/julia-dlp_pbN1.js +241 -0
  125. package/lib/livescript-Gf5R-LT6.js +273 -0
  126. package/lib/lua-c5Y_JsBp.js +221 -0
  127. package/lib/mathematica-iiGTGmUs.js +35 -0
  128. package/lib/mbox-ZJh86H8B.js +78 -0
  129. package/lib/meta-tAGyVRPE.js +511 -0
  130. package/lib/mirc-i0qkCa0y.js +73 -0
  131. package/lib/mllike-Dy551fZW.js +275 -0
  132. package/lib/modelica-n6tGqUT9.js +94 -0
  133. package/lib/mscgen-aKSbB7D9.js +104 -0
  134. package/lib/mumps-lNiKA6sp.js +25 -0
  135. package/lib/nginx--YmuCfDj.js +93 -0
  136. package/lib/nsis-zhS8iA09.js +62 -0
  137. package/lib/ntriples-E3jQl3MC.js +79 -0
  138. package/lib/octave-EQvkGIeG.js +144 -0
  139. package/lib/oz-W2cpqFf6.js +152 -0
  140. package/lib/pascal-lCh6ouNZ.js +79 -0
  141. package/lib/perl-PxEQBX0B.js +915 -0
  142. package/lib/pig-Y_bNcrzS.js +56 -0
  143. package/lib/powershell-GaQP-TZr.js +249 -0
  144. package/lib/properties-mbRyn54L.js +26 -0
  145. package/lib/prosemirror-noTDkx-k.js +4 -0
  146. package/lib/protobuf-8CJideyJ.js +49 -0
  147. package/lib/puppet-ABBaChNZ.js +45 -0
  148. package/lib/python-sKdHg3Ka.js +321 -0
  149. package/lib/q-_1yG40Nm.js +89 -0
  150. package/lib/r-Ziz56bHT.js +108 -0
  151. package/lib/rpm-ORjGOHaQ.js +57 -0
  152. package/lib/ruby-jlbYq0dT.js +233 -0
  153. package/lib/sas-2n7xeUuO.js +107 -0
  154. package/lib/schema-tKk3m1fu.js +62 -0
  155. package/lib/scheme-XCs-NPeU.js +126 -0
  156. package/lib/shell-0_1Um7Dq.js +184 -0
  157. package/lib/sieve-7uyJD1x1.js +73 -0
  158. package/lib/simple-mode--HIzBxba.js +95 -0
  159. package/lib/smalltalk-PEFzrlQ-.js +48 -0
  160. package/lib/solr-BLBaHahN.js +41 -0
  161. package/lib/sparql-4F9ZWf1b.js +204 -0
  162. package/lib/spreadsheet-SGSo6blj.js +49 -0
  163. package/lib/sql-tebLBzN0.js +291 -0
  164. package/lib/stex-SFJcFGOO.js +130 -0
  165. package/lib/stylus-rwwWYWFm.js +256 -0
  166. package/lib/swift-eorJ0tCv.js +238 -0
  167. package/lib/tcl-IwXMB8U4.js +82 -0
  168. package/lib/textile-ok2VyjwC.js +299 -0
  169. package/lib/theme/classic/index.d.ts +3 -0
  170. package/lib/theme/classic/index.d.ts.map +1 -0
  171. package/lib/theme/classic-dark/index.d.ts +3 -0
  172. package/lib/theme/classic-dark/index.d.ts.map +1 -0
  173. package/lib/theme/headless/index.d.ts +3 -0
  174. package/lib/theme/headless/index.d.ts.map +1 -0
  175. package/lib/theme/index.d.ts +8 -0
  176. package/lib/theme/index.d.ts.map +1 -0
  177. package/lib/theme/shared.d.ts +3 -0
  178. package/lib/theme/shared.d.ts.map +1 -0
  179. package/lib/tiddlywiki-DLhz8_pc.js +156 -0
  180. package/lib/tiki-DFAqFElY.js +183 -0
  181. package/lib/tippy.esm-MZ2vxByW.js +1813 -0
  182. package/lib/toml-ryxpTZEV.js +49 -0
  183. package/lib/tooltip-plugin-gcwyQdiT.js +119 -0
  184. package/lib/troff-ZzZyvNct.js +36 -0
  185. package/lib/ttcn-6gvkqqpW.js +136 -0
  186. package/lib/ttcn-cfg-oSu-Dq5C.js +98 -0
  187. package/lib/turtle-10ofr5au.js +87 -0
  188. package/lib/use-css-light-dom-EKWZDmbJ.js +82 -0
  189. package/lib/utils/index.d.ts +4 -0
  190. package/lib/utils/index.d.ts.map +1 -0
  191. package/lib/vb-a6n6fzrD.js +74 -0
  192. package/lib/vbscript-dgvo8jPt.js +324 -0
  193. package/lib/velocity-CBncCrwO.js +97 -0
  194. package/lib/verilog-KlcACt6C.js +271 -0
  195. package/lib/vhdl-NMd7Gf35.js +117 -0
  196. package/lib/webidl-z1UE5DN_.js +160 -0
  197. package/lib/xquery-hDt5jWTp.js +431 -0
  198. package/lib/yacas-ftgh_qwr.js +74 -0
  199. package/lib/yaml-DnNTfjXK.js +53 -0
  200. package/lib/z80-dA1PqWe1.js +62 -0
  201. package/package.json +87 -0
  202. package/src/core/crepe.ts +98 -0
  203. package/src/core/index.ts +4 -0
  204. package/src/core/slice.ts +44 -0
  205. package/src/feature/block-edit/handle/component.ts +68 -0
  206. package/src/feature/block-edit/handle/index.ts +81 -0
  207. package/src/feature/block-edit/index.ts +17 -0
  208. package/src/feature/block-edit/menu/component.ts +210 -0
  209. package/src/feature/block-edit/menu/config.ts +335 -0
  210. package/src/feature/block-edit/menu/icons.ts +171 -0
  211. package/src/feature/block-edit/menu/index.ts +113 -0
  212. package/src/feature/block-edit/style.css +126 -0
  213. package/src/feature/code-mirror/index.ts +60 -0
  214. package/src/feature/code-mirror/style.css +159 -0
  215. package/src/feature/gap-cursor/index.ts +31 -0
  216. package/src/feature/image-block/index.ts +59 -0
  217. package/src/feature/image-block/style.css +215 -0
  218. package/src/feature/index.ts +66 -0
  219. package/src/feature/link-tooltip/consts.ts +47 -0
  220. package/src/feature/link-tooltip/index.ts +22 -0
  221. package/src/feature/link-tooltip/style.css +107 -0
  222. package/src/feature/list-item/consts.ts +15 -0
  223. package/src/feature/list-item/index.ts +30 -0
  224. package/src/feature/list-item/style.css +23 -0
  225. package/src/feature/placeholder/index.ts +87 -0
  226. package/src/feature/placeholder/style.css +9 -0
  227. package/src/feature/shared.ts +4 -0
  228. package/src/feature/toolbar/component.ts +101 -0
  229. package/src/feature/toolbar/consts.ts +26 -0
  230. package/src/feature/toolbar/index.ts +92 -0
  231. package/src/feature/toolbar/style.css +37 -0
  232. package/src/index.ts +5 -0
  233. package/src/theme/classic/index.ts +12 -0
  234. package/src/theme/classic/style.css +192 -0
  235. package/src/theme/classic-dark/index.ts +12 -0
  236. package/src/theme/classic-dark/style.css +197 -0
  237. package/src/theme/headless/index.ts +9 -0
  238. package/src/theme/index.ts +26 -0
  239. package/src/theme/shared.ts +4 -0
  240. package/src/utils/index.ts +12 -0
  241. package/src/vite-env.d.ts +2 -0
@@ -0,0 +1,154 @@
1
+ var l = [
2
+ "and",
3
+ "as",
4
+ "block",
5
+ "endblock",
6
+ "by",
7
+ "cycle",
8
+ "debug",
9
+ "else",
10
+ "elif",
11
+ "extends",
12
+ "filter",
13
+ "endfilter",
14
+ "firstof",
15
+ "do",
16
+ "for",
17
+ "endfor",
18
+ "if",
19
+ "endif",
20
+ "ifchanged",
21
+ "endifchanged",
22
+ "ifequal",
23
+ "endifequal",
24
+ "ifnotequal",
25
+ "set",
26
+ "raw",
27
+ "endraw",
28
+ "endifnotequal",
29
+ "in",
30
+ "include",
31
+ "load",
32
+ "not",
33
+ "now",
34
+ "or",
35
+ "parsed",
36
+ "regroup",
37
+ "reversed",
38
+ "spaceless",
39
+ "call",
40
+ "endcall",
41
+ "macro",
42
+ "endmacro",
43
+ "endspaceless",
44
+ "ssi",
45
+ "templatetag",
46
+ "openblock",
47
+ "closeblock",
48
+ "openvariable",
49
+ "closevariable",
50
+ "without",
51
+ "context",
52
+ "openbrace",
53
+ "closebrace",
54
+ "opencomment",
55
+ "closecomment",
56
+ "widthratio",
57
+ "url",
58
+ "with",
59
+ "endwith",
60
+ "get_current_language",
61
+ "trans",
62
+ "endtrans",
63
+ "noop",
64
+ "blocktrans",
65
+ "endblocktrans",
66
+ "get_available_languages",
67
+ "get_current_language_bidi",
68
+ "pluralize",
69
+ "autoescape",
70
+ "endautoescape"
71
+ ], c = /^[+\-*&%=<>!?|~^]/, f = /^[:\[\(\{]/, o = ["true", "false"], r = /^(\d[+\-\*\/])?\d+(\.\d+)?/;
72
+ l = new RegExp("((" + l.join(")|(") + "))\\b");
73
+ o = new RegExp("((" + o.join(")|(") + "))\\b");
74
+ function u(n, e) {
75
+ var i = n.peek();
76
+ if (e.incomment)
77
+ return n.skipTo("#}") ? (n.eatWhile(/\#|}/), e.incomment = !1) : n.skipToEnd(), "comment";
78
+ if (e.intag) {
79
+ if (e.operator) {
80
+ if (e.operator = !1, n.match(o))
81
+ return "atom";
82
+ if (n.match(r))
83
+ return "number";
84
+ }
85
+ if (e.sign) {
86
+ if (e.sign = !1, n.match(o))
87
+ return "atom";
88
+ if (n.match(r))
89
+ return "number";
90
+ }
91
+ if (e.instring)
92
+ return i == e.instring && (e.instring = !1), n.next(), "string";
93
+ if (i == "'" || i == '"')
94
+ return e.instring = i, n.next(), "string";
95
+ if (e.inbraces > 0 && i == ")")
96
+ n.next(), e.inbraces--;
97
+ else if (i == "(")
98
+ n.next(), e.inbraces++;
99
+ else if (e.inbrackets > 0 && i == "]")
100
+ n.next(), e.inbrackets--;
101
+ else if (i == "[")
102
+ n.next(), e.inbrackets++;
103
+ else {
104
+ if (!e.lineTag && (n.match(e.intag + "}") || n.eat("-") && n.match(e.intag + "}")))
105
+ return e.intag = !1, "tag";
106
+ if (n.match(c))
107
+ return e.operator = !0, "operator";
108
+ if (n.match(f))
109
+ e.sign = !0;
110
+ else {
111
+ if (n.column() == 1 && e.lineTag && n.match(l))
112
+ return "keyword";
113
+ if (n.eat(" ") || n.sol()) {
114
+ if (n.match(l))
115
+ return "keyword";
116
+ if (n.match(o))
117
+ return "atom";
118
+ if (n.match(r))
119
+ return "number";
120
+ n.sol() && n.next();
121
+ } else
122
+ n.next();
123
+ }
124
+ }
125
+ return "variable";
126
+ } else if (n.eat("{")) {
127
+ if (n.eat("#"))
128
+ return e.incomment = !0, n.skipTo("#}") ? (n.eatWhile(/\#|}/), e.incomment = !1) : n.skipToEnd(), "comment";
129
+ if (i = n.eat(/\{|%/))
130
+ return e.intag = i, e.inbraces = 0, e.inbrackets = 0, i == "{" && (e.intag = "}"), n.eat("-"), "tag";
131
+ } else if (n.eat("#")) {
132
+ if (n.peek() == "#")
133
+ return n.skipToEnd(), "comment";
134
+ if (!n.eol())
135
+ return e.intag = !0, e.lineTag = !0, e.inbraces = 0, e.inbrackets = 0, "tag";
136
+ }
137
+ n.next();
138
+ }
139
+ const a = {
140
+ name: "jinja2",
141
+ startState: function() {
142
+ return { tokenize: u, inbrackets: 0, inbraces: 0 };
143
+ },
144
+ token: function(n, e) {
145
+ var i = e.tokenize(n, e);
146
+ return n.eol() && e.lineTag && !e.instring && e.inbraces == 0 && e.inbrackets == 0 && (e.intag = !1, e.lineTag = !1), i;
147
+ },
148
+ languageData: {
149
+ commentTokens: { block: { open: "{#", close: "#}", line: "##" } }
150
+ }
151
+ };
152
+ export {
153
+ a as jinja2
154
+ };
@@ -0,0 +1,241 @@
1
+ function o(e, n, i) {
2
+ return typeof i > "u" && (i = ""), typeof n > "u" && (n = "\\b"), new RegExp("^" + i + "((" + e.join(")|(") + "))" + n);
3
+ }
4
+ 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 = [
5
+ "[<>]:",
6
+ "[<>=]=",
7
+ "<<=?",
8
+ ">>>?=?",
9
+ "=>",
10
+ "--?>",
11
+ "<--[->]?",
12
+ "\\/\\/",
13
+ "\\.{2,3}",
14
+ "[\\.\\\\%*+\\-<>!\\/^|&]=?",
15
+ "\\?",
16
+ "\\$",
17
+ "~",
18
+ ":"
19
+ ], b = o([
20
+ "[<>]:",
21
+ "[<>=]=",
22
+ "[!=]==",
23
+ "<<=?",
24
+ ">>>?=?",
25
+ "=>?",
26
+ "--?>",
27
+ "<--[->]?",
28
+ "\\/\\/",
29
+ "[\\\\%*+\\-<>!\\/^|&\\u00F7\\u22BB]=?",
30
+ "\\?",
31
+ "\\$",
32
+ "~",
33
+ ":",
34
+ "\\u00D7",
35
+ "\\u2208",
36
+ "\\u2209",
37
+ "\\u220B",
38
+ "\\u220C",
39
+ "\\u2218",
40
+ "\\u221A",
41
+ "\\u221B",
42
+ "\\u2229",
43
+ "\\u222A",
44
+ "\\u2260",
45
+ "\\u2264",
46
+ "\\u2265",
47
+ "\\u2286",
48
+ "\\u2288",
49
+ "\\u228A",
50
+ "\\u22C5",
51
+ "\\b(in|isa)\\b(?!.?\\()"
52
+ ], ""), y = /^[;,()[\]{}]/, m = /^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/, x = o([v, k, F, g], "'"), z = [
53
+ "begin",
54
+ "function",
55
+ "type",
56
+ "struct",
57
+ "immutable",
58
+ "let",
59
+ "macro",
60
+ "for",
61
+ "while",
62
+ "quote",
63
+ "if",
64
+ "else",
65
+ "elseif",
66
+ "try",
67
+ "finally",
68
+ "catch",
69
+ "do"
70
+ ], A = ["end", "else", "elseif", "catch", "finally"], p = [
71
+ "if",
72
+ "else",
73
+ "elseif",
74
+ "while",
75
+ "for",
76
+ "begin",
77
+ "let",
78
+ "end",
79
+ "do",
80
+ "try",
81
+ "catch",
82
+ "finally",
83
+ "return",
84
+ "break",
85
+ "continue",
86
+ "global",
87
+ "local",
88
+ "const",
89
+ "export",
90
+ "import",
91
+ "importall",
92
+ "using",
93
+ "function",
94
+ "where",
95
+ "macro",
96
+ "module",
97
+ "baremodule",
98
+ "struct",
99
+ "type",
100
+ "mutable",
101
+ "immutable",
102
+ "quote",
103
+ "typealias",
104
+ "abstract",
105
+ "primitive",
106
+ "bitstype"
107
+ ], 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, "", ":");
108
+ function l(e) {
109
+ return e.nestedArrays > 0;
110
+ }
111
+ function S(e) {
112
+ return e.nestedGenerators > 0;
113
+ }
114
+ function t(e, n) {
115
+ return typeof n > "u" && (n = 0), e.scopes.length <= n ? null : e.scopes[e.scopes.length - (n + 1)];
116
+ }
117
+ function f(e, n) {
118
+ if (e.match("#=", !1))
119
+ return n.tokenize = I, n.tokenize(e, n);
120
+ var i = n.leavingExpr;
121
+ if (e.sol() && (i = !1), n.leavingExpr = !1, i && e.match(/^'+/))
122
+ return "operator";
123
+ if (e.match(/\.{4,}/))
124
+ return "error";
125
+ if (e.match(/\.{1,3}/))
126
+ return "operator";
127
+ if (e.eatSpace())
128
+ return null;
129
+ var r = e.peek();
130
+ if (r === "#")
131
+ return e.skipToEnd(), "comment";
132
+ if (r === "[" && (n.scopes.push("["), n.nestedArrays++), r === "(" && (n.scopes.push("("), n.nestedGenerators++), l(n) && r === "]") {
133
+ for (; n.scopes.length && t(n) !== "["; )
134
+ n.scopes.pop();
135
+ n.scopes.pop(), n.nestedArrays--, n.leavingExpr = !0;
136
+ }
137
+ if (S(n) && r === ")") {
138
+ for (; n.scopes.length && t(n) !== "("; )
139
+ n.scopes.pop();
140
+ n.scopes.pop(), n.nestedGenerators--, n.leavingExpr = !0;
141
+ }
142
+ if (l(n)) {
143
+ if (n.lastToken == "end" && e.match(":"))
144
+ return "operator";
145
+ if (e.match("end"))
146
+ return "number";
147
+ }
148
+ var u;
149
+ if ((u = e.match(E, !1)) && n.scopes.push(u[0]), e.match(C, !1) && n.scopes.pop(), e.match(/^::(?![:\$])/))
150
+ return n.tokenize = $, n.tokenize(e, n);
151
+ if (!i && (e.match(T) || e.match(G)))
152
+ return "builtin";
153
+ if (e.match(b))
154
+ return "operator";
155
+ if (e.match(/^\.?\d/, !1)) {
156
+ var s = RegExp(/^im\b/), c = !1;
157
+ 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)
158
+ return e.match(s), n.leavingExpr = !0, "number";
159
+ }
160
+ if (e.match("'"))
161
+ return n.tokenize = O, n.tokenize(e, n);
162
+ if (e.match(P))
163
+ return n.tokenize = Z(e.current()), n.tokenize(e, n);
164
+ if (e.match(D) || e.match(B))
165
+ return "meta";
166
+ if (e.match(y))
167
+ return null;
168
+ if (e.match(_))
169
+ return "keyword";
170
+ if (e.match(w))
171
+ return "builtin";
172
+ var d = n.isDefinition || n.lastToken == "function" || n.lastToken == "macro" || n.lastToken == "type" || n.lastToken == "struct" || n.lastToken == "immutable";
173
+ return e.match(m) ? d ? e.peek() === "." ? (n.isDefinition = !0, "variable") : (n.isDefinition = !1, "def") : (n.leavingExpr = !0, "variable") : (e.next(), "error");
174
+ }
175
+ function $(e, n) {
176
+ 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";
177
+ }
178
+ function I(e, n) {
179
+ return e.match("#=") && n.nestedComments++, e.match(/.*?(?=(#=|=#))/) || e.skipToEnd(), e.match("=#") && (n.nestedComments--, n.nestedComments == 0 && (n.tokenize = f)), "comment";
180
+ }
181
+ function O(e, n) {
182
+ var i = !1, r;
183
+ if (e.match(x))
184
+ i = !0;
185
+ else if (r = e.match(/\\u([a-f0-9]{1,4})(?=')/i)) {
186
+ var u = parseInt(r[1], 16);
187
+ (u <= 55295 || u >= 57344) && (i = !0, e.next());
188
+ } else if (r = e.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)) {
189
+ var u = parseInt(r[1], 16);
190
+ u <= 1114111 && (i = !0, e.next());
191
+ }
192
+ return i ? (n.leavingExpr = !0, n.tokenize = f, "string") : (e.match(/^[^']+(?=')/) || e.skipToEnd(), e.match("'") && (n.tokenize = f), "error");
193
+ }
194
+ function Z(e) {
195
+ e.substr(-3) === '"""' ? e = '"""' : e.substr(-1) === '"' && (e = '"');
196
+ function n(i, r) {
197
+ if (i.eat("\\"))
198
+ i.next();
199
+ else {
200
+ if (i.match(e))
201
+ return r.tokenize = f, r.leavingExpr = !0, "string";
202
+ i.eat(/[`"]/);
203
+ }
204
+ return i.eatWhile(/[^\\`"]/), "string";
205
+ }
206
+ return n;
207
+ }
208
+ const j = {
209
+ name: "julia",
210
+ startState: function() {
211
+ return {
212
+ tokenize: f,
213
+ scopes: [],
214
+ lastToken: null,
215
+ leavingExpr: !1,
216
+ isDefinition: !1,
217
+ nestedArrays: 0,
218
+ nestedComments: 0,
219
+ nestedGenerators: 0,
220
+ nestedParameters: 0,
221
+ firstParenPos: -1
222
+ };
223
+ },
224
+ token: function(e, n) {
225
+ var i = n.tokenize(e, n), r = e.current();
226
+ return r && i && (n.lastToken = r), i;
227
+ },
228
+ indent: function(e, n, i) {
229
+ var r = 0;
230
+ 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;
231
+ },
232
+ languageData: {
233
+ indentOnInput: /^\s*(end|else|catch|finally)\b$/,
234
+ commentTokens: { line: "#", block: { open: "#=", close: "=#" } },
235
+ closeBrackets: { brackets: ["(", "[", "{", '"'] },
236
+ autocomplete: p.concat(h)
237
+ }
238
+ };
239
+ export {
240
+ j as julia
241
+ };
@@ -0,0 +1,273 @@
1
+ var f = function(e, n) {
2
+ var r = n.next || "start";
3
+ if (r) {
4
+ n.next = n.next;
5
+ var k = g[r];
6
+ if (k.splice) {
7
+ for (var l = 0; l < k.length; ++l) {
8
+ var t = k[l];
9
+ if (t.regex && e.match(t.regex))
10
+ return n.next = t.next || n.next, t.token;
11
+ }
12
+ return e.next(), "error";
13
+ }
14
+ if (e.match(t = g[r]))
15
+ return t.regex && e.match(t.regex) ? (n.next = t.next, t.token) : (e.next(), "error");
16
+ }
17
+ return e.next(), "error";
18
+ }, s = "(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*", u = RegExp("(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*" + s + ")?))\\s*$"), o = "(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))", x = {
19
+ token: "string",
20
+ regex: ".+"
21
+ }, g = {
22
+ start: [
23
+ {
24
+ token: "docComment",
25
+ regex: "/\\*",
26
+ next: "comment"
27
+ },
28
+ {
29
+ token: "comment",
30
+ regex: "#.*"
31
+ },
32
+ {
33
+ token: "keyword",
34
+ 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)" + o
35
+ },
36
+ {
37
+ token: "atom",
38
+ regex: "(?:true|false|yes|no|on|off|null|void|undefined)" + o
39
+ },
40
+ {
41
+ token: "invalid",
42
+ regex: "(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)" + o
43
+ },
44
+ {
45
+ token: "className.standard",
46
+ regex: "(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)" + o
47
+ },
48
+ {
49
+ token: "variableName.function.standard",
50
+ regex: "(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)" + o
51
+ },
52
+ {
53
+ token: "variableName.standard",
54
+ regex: "(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)" + o
55
+ },
56
+ {
57
+ token: "variableName",
58
+ regex: s + "\\s*:(?![:=])"
59
+ },
60
+ {
61
+ token: "variableName",
62
+ regex: s
63
+ },
64
+ {
65
+ token: "operatorKeyword",
66
+ regex: "(?:\\.{3}|\\s+\\?)"
67
+ },
68
+ {
69
+ token: "keyword",
70
+ regex: "(?:@+|::|\\.\\.)",
71
+ next: "key"
72
+ },
73
+ {
74
+ token: "operatorKeyword",
75
+ regex: "\\.\\s*",
76
+ next: "key"
77
+ },
78
+ {
79
+ token: "string",
80
+ regex: "\\\\\\S[^\\s,;)}\\]]*"
81
+ },
82
+ {
83
+ token: "docString",
84
+ regex: "'''",
85
+ next: "qdoc"
86
+ },
87
+ {
88
+ token: "docString",
89
+ regex: '"""',
90
+ next: "qqdoc"
91
+ },
92
+ {
93
+ token: "string",
94
+ regex: "'",
95
+ next: "qstring"
96
+ },
97
+ {
98
+ token: "string",
99
+ regex: '"',
100
+ next: "qqstring"
101
+ },
102
+ {
103
+ token: "string",
104
+ regex: "`",
105
+ next: "js"
106
+ },
107
+ {
108
+ token: "string",
109
+ regex: "<\\[",
110
+ next: "words"
111
+ },
112
+ {
113
+ token: "regexp",
114
+ regex: "//",
115
+ next: "heregex"
116
+ },
117
+ {
118
+ token: "regexp",
119
+ regex: "\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}",
120
+ next: "key"
121
+ },
122
+ {
123
+ token: "number",
124
+ 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$]*)"
125
+ },
126
+ {
127
+ token: "paren",
128
+ regex: "[({[]"
129
+ },
130
+ {
131
+ token: "paren",
132
+ regex: "[)}\\]]",
133
+ next: "key"
134
+ },
135
+ {
136
+ token: "operatorKeyword",
137
+ regex: "\\S+"
138
+ },
139
+ {
140
+ token: "content",
141
+ regex: "\\s+"
142
+ }
143
+ ],
144
+ heregex: [
145
+ {
146
+ token: "regexp",
147
+ regex: ".*?//[gimy$?]{0,4}",
148
+ next: "start"
149
+ },
150
+ {
151
+ token: "regexp",
152
+ regex: "\\s*#{"
153
+ },
154
+ {
155
+ token: "comment",
156
+ regex: "\\s+(?:#.*)?"
157
+ },
158
+ {
159
+ token: "regexp",
160
+ regex: "\\S+"
161
+ }
162
+ ],
163
+ key: [
164
+ {
165
+ token: "operatorKeyword",
166
+ regex: "[.?@!]+"
167
+ },
168
+ {
169
+ token: "variableName",
170
+ regex: s,
171
+ next: "start"
172
+ },
173
+ {
174
+ token: "content",
175
+ regex: "",
176
+ next: "start"
177
+ }
178
+ ],
179
+ comment: [
180
+ {
181
+ token: "docComment",
182
+ regex: ".*?\\*/",
183
+ next: "start"
184
+ },
185
+ {
186
+ token: "docComment",
187
+ regex: ".+"
188
+ }
189
+ ],
190
+ qdoc: [
191
+ {
192
+ token: "string",
193
+ regex: ".*?'''",
194
+ next: "key"
195
+ },
196
+ x
197
+ ],
198
+ qqdoc: [
199
+ {
200
+ token: "string",
201
+ regex: '.*?"""',
202
+ next: "key"
203
+ },
204
+ x
205
+ ],
206
+ qstring: [
207
+ {
208
+ token: "string",
209
+ regex: "[^\\\\']*(?:\\\\.[^\\\\']*)*'",
210
+ next: "key"
211
+ },
212
+ x
213
+ ],
214
+ qqstring: [
215
+ {
216
+ token: "string",
217
+ regex: '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
218
+ next: "key"
219
+ },
220
+ x
221
+ ],
222
+ js: [
223
+ {
224
+ token: "string",
225
+ regex: "[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",
226
+ next: "key"
227
+ },
228
+ x
229
+ ],
230
+ words: [
231
+ {
232
+ token: "string",
233
+ regex: ".*?\\]>",
234
+ next: "key"
235
+ },
236
+ x
237
+ ]
238
+ };
239
+ for (var d in g) {
240
+ var a = g[d];
241
+ if (a.splice)
242
+ for (var i = 0, p = a.length; i < p; ++i) {
243
+ var c = a[i];
244
+ typeof c.regex == "string" && (g[d][i].regex = new RegExp("^" + c.regex));
245
+ }
246
+ else
247
+ typeof c.regex == "string" && (g[d].regex = new RegExp("^" + a.regex));
248
+ }
249
+ const y = {
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 r = f(e, n);
260
+ return n.lastToken = {
261
+ style: r,
262
+ indent: e.indentation(),
263
+ content: e.current()
264
+ }, r.replace(/\./g, " ");
265
+ },
266
+ indent: function(e) {
267
+ var n = e.lastToken.indent;
268
+ return e.lastToken.content.match(u) && (n += 2), n;
269
+ }
270
+ };
271
+ export {
272
+ y as liveScript
273
+ };