repl-sdk 0.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apl-fqmucPXA.js +141 -0
- package/dist/apl-fqmucPXA.js.map +1 -0
- package/dist/asciiarmor-DucZyvP0.js +57 -0
- package/dist/asciiarmor-DucZyvP0.js.map +1 -0
- package/dist/asn1-BnOEsgAm.js +145 -0
- package/dist/asn1-BnOEsgAm.js.map +1 -0
- package/dist/assets/tar-worker-CxTcoQcr.js +593 -0
- package/dist/assets/tar-worker-CxTcoQcr.js.map +1 -0
- package/dist/asterisk-QAlztEwS.js +346 -0
- package/dist/asterisk-QAlztEwS.js.map +1 -0
- package/dist/brainfuck-DZVCuF_t.js +54 -0
- package/dist/brainfuck-DZVCuF_t.js.map +1 -0
- package/dist/clike-CTYGlS6x.js +800 -0
- package/dist/clike-CTYGlS6x.js.map +1 -0
- package/dist/clojure-BhXMqnxz.js +850 -0
- package/dist/clojure-BhXMqnxz.js.map +1 -0
- package/dist/cmake-BGaNd9E7.js +72 -0
- package/dist/cmake-BGaNd9E7.js.map +1 -0
- package/dist/cobol-4yqQntpt.js +121 -0
- package/dist/cobol-4yqQntpt.js.map +1 -0
- package/dist/codemirror-De3S70Np.js +2912 -0
- package/dist/codemirror-De3S70Np.js.map +1 -0
- package/dist/coffeescript-D2dXvhEc.js +309 -0
- package/dist/coffeescript-D2dXvhEc.js.map +1 -0
- package/dist/commonlisp-CF_VNHQR.js +131 -0
- package/dist/commonlisp-CF_VNHQR.js.map +1 -0
- package/dist/crystal-DyuLTqLs.js +399 -0
- package/dist/crystal-DyuLTqLs.js.map +1 -0
- package/dist/css-DkSyTW67.js +1773 -0
- package/dist/css-DkSyTW67.js.map +1 -0
- package/dist/cypher-Dlu_3r4V.js +122 -0
- package/dist/cypher-Dlu_3r4V.js.map +1 -0
- package/dist/d-UURgV0Ux.js +180 -0
- package/dist/d-UURgV0Ux.js.map +1 -0
- package/dist/diff-B_Bi2Crb.js +26 -0
- package/dist/diff-B_Bi2Crb.js.map +1 -0
- package/dist/dockerfile-Bvk733Ga.js +202 -0
- package/dist/dockerfile-Bvk733Ga.js.map +1 -0
- package/dist/dtd-Dy74G54E.js +115 -0
- package/dist/dtd-Dy74G54E.js.map +1 -0
- package/dist/dylan-TSb-Nfix.js +315 -0
- package/dist/dylan-TSb-Nfix.js.map +1 -0
- package/dist/ebnf-4fKAGW3a.js +141 -0
- package/dist/ebnf-4fKAGW3a.js.map +1 -0
- package/dist/ecl-B59qGGVg.js +179 -0
- package/dist/ecl-B59qGGVg.js.map +1 -0
- package/dist/eiffel-Dze7nlu3.js +135 -0
- package/dist/eiffel-Dze7nlu3.js.map +1 -0
- package/dist/elm-DG7jkhNZ.js +177 -0
- package/dist/elm-DG7jkhNZ.js.map +1 -0
- package/dist/erlang-BO6gOnGA.js +675 -0
- package/dist/erlang-BO6gOnGA.js.map +1 -0
- package/dist/factor-CMxFHDqz.js +66 -0
- package/dist/factor-CMxFHDqz.js.map +1 -0
- package/dist/fcl-CDDUNjTj.js +142 -0
- package/dist/fcl-CDDUNjTj.js.map +1 -0
- package/dist/forth-B9D2JCeE.js +117 -0
- package/dist/forth-B9D2JCeE.js.map +1 -0
- package/dist/fortran-CAG2BFbe.js +468 -0
- package/dist/fortran-CAG2BFbe.js.map +1 -0
- package/dist/gas-0Aw8zDr5.js +294 -0
- package/dist/gas-0Aw8zDr5.js.map +1 -0
- package/dist/gherkin-DhZlEZiy.js +116 -0
- package/dist/gherkin-DhZlEZiy.js.map +1 -0
- package/dist/gjs-DfguZDLq.js +173 -0
- package/dist/gjs-DfguZDLq.js.map +1 -0
- package/dist/gmd-Yas-Oo8k.js +163 -0
- package/dist/gmd-Yas-Oo8k.js.map +1 -0
- package/dist/groovy-CpwJiBl7.js +224 -0
- package/dist/groovy-CpwJiBl7.js.map +1 -0
- package/dist/haskell-ySd-OUo8.js +460 -0
- package/dist/haskell-ySd-OUo8.js.map +1 -0
- package/dist/haxe-7MlzfeYV.js +515 -0
- package/dist/haxe-7MlzfeYV.js.map +1 -0
- package/dist/hbs-CxcmWxSJ.js +62 -0
- package/dist/hbs-CxcmWxSJ.js.map +1 -0
- package/dist/http-BqypyemW.js +80 -0
- package/dist/http-BqypyemW.js.map +1 -0
- package/dist/idl-4HIGJlDI.js +986 -0
- package/dist/idl-4HIGJlDI.js.map +1 -0
- package/dist/index-B3Meoznj.js +118 -0
- package/dist/index-B3Meoznj.js.map +1 -0
- package/dist/index-BQyfDUUx.js +692 -0
- package/dist/index-BQyfDUUx.js.map +1 -0
- package/dist/index-BRDroAD8.js +305 -0
- package/dist/index-BRDroAD8.js.map +1 -0
- package/dist/index-BRMAzRyM.js +179 -0
- package/dist/index-BRMAzRyM.js.map +1 -0
- package/dist/index-Bb8uYQgv.js +927 -0
- package/dist/index-Bb8uYQgv.js.map +1 -0
- package/dist/index-BlOjO66K.js +17618 -0
- package/dist/index-BlOjO66K.js.map +1 -0
- package/dist/index-BoGWnSNL.js +706 -0
- package/dist/index-BoGWnSNL.js.map +1 -0
- package/dist/index-BsRrEiOu.js +98 -0
- package/dist/index-BsRrEiOu.js.map +1 -0
- package/dist/index-C2sFZMth.js +391 -0
- package/dist/index-C2sFZMth.js.map +1 -0
- package/dist/index-C7xwOjmS.js +291 -0
- package/dist/index-C7xwOjmS.js.map +1 -0
- package/dist/index-CA3lFUx6.js +315 -0
- package/dist/index-CA3lFUx6.js.map +1 -0
- package/dist/index-CB-pPTIf.js +98 -0
- package/dist/index-CB-pPTIf.js.map +1 -0
- package/dist/index-CCa6x1FE.js +386 -0
- package/dist/index-CCa6x1FE.js.map +1 -0
- package/dist/index-CD4DINI1.js +158 -0
- package/dist/index-CD4DINI1.js.map +1 -0
- package/dist/index-CE0B_fcG.js +328 -0
- package/dist/index-CE0B_fcG.js.map +1 -0
- package/dist/index-CVGAEPMV.js +2139 -0
- package/dist/index-CVGAEPMV.js.map +1 -0
- package/dist/index-CmaT2afn.js +332 -0
- package/dist/index-CmaT2afn.js.map +1 -0
- package/dist/index-D8sUxXp5.js +83 -0
- package/dist/index-D8sUxXp5.js.map +1 -0
- package/dist/index-DIz8Vpn-.js +737 -0
- package/dist/index-DIz8Vpn-.js.map +1 -0
- package/dist/index-DNP1xT-S.js +408 -0
- package/dist/index-DNP1xT-S.js.map +1 -0
- package/dist/index-DOAqdvnQ.js +862 -0
- package/dist/index-DOAqdvnQ.js.map +1 -0
- package/dist/index-DVUMFbgi.js +152 -0
- package/dist/index-DVUMFbgi.js.map +1 -0
- package/dist/index-VeTBKRVd.js +83 -0
- package/dist/index-VeTBKRVd.js.map +1 -0
- package/dist/index-dXZeR7Bx.js +1767 -0
- package/dist/index-dXZeR7Bx.js.map +1 -0
- package/dist/index-gtqbIb6T.js +62 -0
- package/dist/index-gtqbIb6T.js.map +1 -0
- package/dist/index-pN_pUAQ7.js +2426 -0
- package/dist/index-pN_pUAQ7.js.map +1 -0
- package/dist/index-wasu5VX0.js +1150 -0
- package/dist/index-wasu5VX0.js.map +1 -0
- package/dist/javascript-Bt8B7yTi.js +993 -0
- package/dist/javascript-Bt8B7yTi.js.map +1 -0
- package/dist/julia-Bs6JJhYG.js +408 -0
- package/dist/julia-Bs6JJhYG.js.map +1 -0
- package/dist/livescript-DmzgM3Yt.js +297 -0
- package/dist/livescript-DmzgM3Yt.js.map +1 -0
- package/dist/lua-8cJgIlqe.js +257 -0
- package/dist/lua-8cJgIlqe.js.map +1 -0
- package/dist/mathematica-DNLOL9PQ.js +111 -0
- package/dist/mathematica-DNLOL9PQ.js.map +1 -0
- package/dist/mbox-Ga7d4MMN.js +118 -0
- package/dist/mbox-Ga7d4MMN.js.map +1 -0
- package/dist/mirc-Dma3B8rS.js +108 -0
- package/dist/mirc-Dma3B8rS.js.map +1 -0
- package/dist/mllike-DHn7xckP.js +335 -0
- package/dist/mllike-DHn7xckP.js.map +1 -0
- package/dist/modelica-0d55jYY0.js +148 -0
- package/dist/modelica-0d55jYY0.js.map +1 -0
- package/dist/mscgen-DdqZYINH.js +136 -0
- package/dist/mscgen-DdqZYINH.js.map +1 -0
- package/dist/mumps-Btr8VblO.js +94 -0
- package/dist/mumps-Btr8VblO.js.map +1 -0
- package/dist/nginx-DTDtBDVN.js +142 -0
- package/dist/nginx-DTDtBDVN.js.map +1 -0
- package/dist/nsis-3zG7tgur.js +63 -0
- package/dist/nsis-3zG7tgur.js.map +1 -0
- package/dist/ntriples-CvgOYMpL.js +154 -0
- package/dist/ntriples-CvgOYMpL.js.map +1 -0
- package/dist/octave-DYBj3-tl.js +201 -0
- package/dist/octave-DYBj3-tl.js.map +1 -0
- package/dist/oz-R_e8WMIi.js +232 -0
- package/dist/oz-R_e8WMIi.js.map +1 -0
- package/dist/parse-CAqQaKsh.js +21685 -0
- package/dist/parse-CAqQaKsh.js.map +1 -0
- package/dist/pascal-GD8iposT.js +106 -0
- package/dist/pascal-GD8iposT.js.map +1 -0
- package/dist/perl-DL9mHpoi.js +1106 -0
- package/dist/perl-DL9mHpoi.js.map +1 -0
- package/dist/pig-C_4T4YIV.js +102 -0
- package/dist/pig-C_4T4YIV.js.map +1 -0
- package/dist/powershell-B0suO7Vd.js +329 -0
- package/dist/powershell-B0suO7Vd.js.map +1 -0
- package/dist/properties-BR-vP1aU.js +59 -0
- package/dist/properties-BR-vP1aU.js.map +1 -0
- package/dist/protobuf-BxgpyhoW.js +78 -0
- package/dist/protobuf-BxgpyhoW.js.map +1 -0
- package/dist/pug-vHnWR0UE.js +406 -0
- package/dist/pug-vHnWR0UE.js.map +1 -0
- package/dist/puppet-Bdao66PW.js +138 -0
- package/dist/puppet-Bdao66PW.js.map +1 -0
- package/dist/python-BFGRmuZ9.js +427 -0
- package/dist/python-BFGRmuZ9.js.map +1 -0
- package/dist/q-CrbCVq4a.js +132 -0
- package/dist/q-CrbCVq4a.js.map +1 -0
- package/dist/r-V7nswm59.js +171 -0
- package/dist/r-V7nswm59.js.map +1 -0
- package/dist/render-app-island-B-i8rvGi.js +61 -0
- package/dist/render-app-island-B-i8rvGi.js.map +1 -0
- package/dist/repl-sdk.js +7 -0
- package/dist/repl-sdk.js.map +1 -0
- package/dist/rpm-C-DLY-If.js +110 -0
- package/dist/rpm-C-DLY-If.js.map +1 -0
- package/dist/ruby-JDKLJNK0.js +331 -0
- package/dist/ruby-JDKLJNK0.js.map +1 -0
- package/dist/sas-D2UG-yhZ.js +208 -0
- package/dist/sas-D2UG-yhZ.js.map +1 -0
- package/dist/scheme-BKzrkGJD.js +223 -0
- package/dist/scheme-BKzrkGJD.js.map +1 -0
- package/dist/shell-BlsXDxCn.js +223 -0
- package/dist/shell-BlsXDxCn.js.map +1 -0
- package/dist/sieve-CjwBwOY5.js +136 -0
- package/dist/sieve-CjwBwOY5.js.map +1 -0
- package/dist/simple-mode-DMneyfDu.js +131 -0
- package/dist/simple-mode-DMneyfDu.js.map +1 -0
- package/dist/smalltalk-BOIGQuhN.js +122 -0
- package/dist/smalltalk-BOIGQuhN.js.map +1 -0
- package/dist/solr-CwD7U71z.js +70 -0
- package/dist/solr-CwD7U71z.js.map +1 -0
- package/dist/sparql-DYskk2vE.js +250 -0
- package/dist/sparql-DYskk2vE.js.map +1 -0
- package/dist/spreadsheet-Bgtt3oLP.js +88 -0
- package/dist/spreadsheet-Bgtt3oLP.js.map +1 -0
- package/dist/sql-Cei9CMfk.js +343 -0
- package/dist/sql-Cei9CMfk.js.map +1 -0
- package/dist/stex-C1nZSzAw.js +231 -0
- package/dist/stex-C1nZSzAw.js.map +1 -0
- package/dist/stylus-BkS-boTH.js +566 -0
- package/dist/stylus-BkS-boTH.js.map +1 -0
- package/dist/swift-FRZi1uvB.js +292 -0
- package/dist/swift-FRZi1uvB.js.map +1 -0
- package/dist/tcl-CUcaCdmq.js +115 -0
- package/dist/tcl-CUcaCdmq.js.map +1 -0
- package/dist/textile-BnFpjsrl.js +415 -0
- package/dist/textile-BnFpjsrl.js.map +1 -0
- package/dist/tiddlywiki-CjprD-Qp.js +219 -0
- package/dist/tiddlywiki-CjprD-Qp.js.map +1 -0
- package/dist/tiki-DK9DOeWn.js +269 -0
- package/dist/tiki-DK9DOeWn.js.map +1 -0
- package/dist/toml-BOuWGMcf.js +77 -0
- package/dist/toml-BOuWGMcf.js.map +1 -0
- package/dist/troff-E1bJ0PPL.js +62 -0
- package/dist/troff-E1bJ0PPL.js.map +1 -0
- package/dist/ttcn-cfg-Dc39-fIP.js +134 -0
- package/dist/ttcn-cfg-Dc39-fIP.js.map +1 -0
- package/dist/ttcn-tKd4HLu4.js +193 -0
- package/dist/ttcn-tKd4HLu4.js.map +1 -0
- package/dist/turtle-Dq7-1WAf.js +125 -0
- package/dist/turtle-Dq7-1WAf.js.map +1 -0
- package/dist/vb-Dp90gtsv.js +197 -0
- package/dist/vb-Dp90gtsv.js.map +1 -0
- package/dist/vbscript-Bfn8O8I7.js +479 -0
- package/dist/vbscript-Bfn8O8I7.js.map +1 -0
- package/dist/velocity-BwIZK1TH.js +150 -0
- package/dist/velocity-BwIZK1TH.js.map +1 -0
- package/dist/verilog-CnT9bMk0.js +430 -0
- package/dist/verilog-CnT9bMk0.js.map +1 -0
- package/dist/vhdl-DCkMIyT9.js +159 -0
- package/dist/vhdl-DCkMIyT9.js.map +1 -0
- package/dist/webidl-BTLTThCm.js +205 -0
- package/dist/webidl-BTLTThCm.js.map +1 -0
- package/dist/xquery-BrBUuxMR.js +526 -0
- package/dist/xquery-BrBUuxMR.js.map +1 -0
- package/dist/yacas-b5lAVEIl.js +131 -0
- package/dist/yacas-b5lAVEIl.js.map +1 -0
- package/dist/z80-ClgwfNdB.js +93 -0
- package/dist/z80-ClgwfNdB.js.map +1 -0
- package/package.json +81 -9
- package/src/cache.js +138 -0
- package/src/cdn.js +93 -0
- package/src/codemirror.js +161 -0
- package/src/compilers/ember/gjs.js +212 -0
- package/src/compilers/ember/gmd.js +190 -0
- package/src/compilers/ember/hbs.js +98 -0
- package/src/compilers/ember/render-app-island.js +83 -0
- package/src/compilers/ember.js +166 -0
- package/src/compilers/js.js +32 -0
- package/src/compilers/markdown/build-compiler.js +151 -0
- package/src/compilers/markdown/const.js +2 -0
- package/src/compilers/markdown/heading-id.js +75 -0
- package/src/compilers/markdown/live-code-extraction.js +198 -0
- package/src/compilers/markdown/parse.js +22 -0
- package/src/compilers/markdown/parse.test.ts +363 -0
- package/src/compilers/markdown/sanitize-for-glimmer.js +26 -0
- package/src/compilers/markdown/types.ts +21 -0
- package/src/compilers/markdown/utils.js +78 -0
- package/src/compilers/markdown.js +125 -0
- package/src/compilers/mermaid.js +35 -0
- package/src/compilers/react.js +59 -0
- package/src/compilers/svelte.js +116 -0
- package/src/compilers/vue.js +58 -0
- package/src/compilers.js +108 -0
- package/src/es-module-shim.js +53 -0
- package/src/index.d.ts +53 -4
- package/src/index.js +744 -89
- package/src/npm.js +58 -0
- package/src/request.Request.test.ts +59 -0
- package/src/request.js +140 -0
- package/src/resolve.fromImports.test.ts +35 -0
- package/src/resolve.fromInternalImport.test.ts +69 -0
- package/src/resolve.js +352 -0
- package/src/resolve.resolvePath.test.ts +24 -0
- package/src/resolve.test.ts +23 -0
- package/src/specifier.js +71 -0
- package/src/specifier.test.ts +90 -0
- package/src/tar-worker.js +61 -0
- package/src/tar.js +76 -0
- package/src/types.ts +335 -58
- package/src/utils.js +28 -1
- package/declarations/index.d.ts +0 -73
- package/dist/index.js +0 -107
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
function wordRegExp(words, end) {
|
|
2
|
+
return new RegExp((end ? "" : "^") + "(?:" + words.join("|") + ")" + (end ? "$" : "\\b"));
|
|
3
|
+
}
|
|
4
|
+
function chain(tokenize, stream, state) {
|
|
5
|
+
state.tokenize.push(tokenize);
|
|
6
|
+
return tokenize(stream, state);
|
|
7
|
+
}
|
|
8
|
+
var operators = /^(?:[-+/%|&^]|\*\*?|[<>]{2})/;
|
|
9
|
+
var conditionalOperators = /^(?:[=!]~|===|<=>|[<>=!]=?|[|&]{2}|~)/;
|
|
10
|
+
var indexingOperators = /^(?:\[\][?=]?)/;
|
|
11
|
+
var anotherOperators = /^(?:\.(?:\.{2})?|->|[?:])/;
|
|
12
|
+
var idents = /^[a-z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/;
|
|
13
|
+
var types = /^[A-Z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/;
|
|
14
|
+
var keywords = wordRegExp([
|
|
15
|
+
"abstract",
|
|
16
|
+
"alias",
|
|
17
|
+
"as",
|
|
18
|
+
"asm",
|
|
19
|
+
"begin",
|
|
20
|
+
"break",
|
|
21
|
+
"case",
|
|
22
|
+
"class",
|
|
23
|
+
"def",
|
|
24
|
+
"do",
|
|
25
|
+
"else",
|
|
26
|
+
"elsif",
|
|
27
|
+
"end",
|
|
28
|
+
"ensure",
|
|
29
|
+
"enum",
|
|
30
|
+
"extend",
|
|
31
|
+
"for",
|
|
32
|
+
"fun",
|
|
33
|
+
"if",
|
|
34
|
+
"include",
|
|
35
|
+
"instance_sizeof",
|
|
36
|
+
"lib",
|
|
37
|
+
"macro",
|
|
38
|
+
"module",
|
|
39
|
+
"next",
|
|
40
|
+
"of",
|
|
41
|
+
"out",
|
|
42
|
+
"pointerof",
|
|
43
|
+
"private",
|
|
44
|
+
"protected",
|
|
45
|
+
"rescue",
|
|
46
|
+
"return",
|
|
47
|
+
"require",
|
|
48
|
+
"select",
|
|
49
|
+
"sizeof",
|
|
50
|
+
"struct",
|
|
51
|
+
"super",
|
|
52
|
+
"then",
|
|
53
|
+
"type",
|
|
54
|
+
"typeof",
|
|
55
|
+
"uninitialized",
|
|
56
|
+
"union",
|
|
57
|
+
"unless",
|
|
58
|
+
"until",
|
|
59
|
+
"when",
|
|
60
|
+
"while",
|
|
61
|
+
"with",
|
|
62
|
+
"yield",
|
|
63
|
+
"__DIR__",
|
|
64
|
+
"__END_LINE__",
|
|
65
|
+
"__FILE__",
|
|
66
|
+
"__LINE__"
|
|
67
|
+
]);
|
|
68
|
+
var atomWords = wordRegExp(["true", "false", "nil", "self"]);
|
|
69
|
+
var indentKeywordsArray = [
|
|
70
|
+
"def",
|
|
71
|
+
"fun",
|
|
72
|
+
"macro",
|
|
73
|
+
"class",
|
|
74
|
+
"module",
|
|
75
|
+
"struct",
|
|
76
|
+
"lib",
|
|
77
|
+
"enum",
|
|
78
|
+
"union",
|
|
79
|
+
"do",
|
|
80
|
+
"for"
|
|
81
|
+
];
|
|
82
|
+
var indentKeywords = wordRegExp(indentKeywordsArray);
|
|
83
|
+
var indentExpressionKeywordsArray = ["if", "unless", "case", "while", "until", "begin", "then"];
|
|
84
|
+
var indentExpressionKeywords = wordRegExp(indentExpressionKeywordsArray);
|
|
85
|
+
var dedentKeywordsArray = ["end", "else", "elsif", "rescue", "ensure"];
|
|
86
|
+
var dedentKeywords = wordRegExp(dedentKeywordsArray);
|
|
87
|
+
var dedentPunctualsArray = ["\\)", "\\}", "\\]"];
|
|
88
|
+
var dedentPunctuals = new RegExp("^(?:" + dedentPunctualsArray.join("|") + ")$");
|
|
89
|
+
var nextTokenizer = {
|
|
90
|
+
"def": tokenFollowIdent,
|
|
91
|
+
"fun": tokenFollowIdent,
|
|
92
|
+
"macro": tokenMacroDef,
|
|
93
|
+
"class": tokenFollowType,
|
|
94
|
+
"module": tokenFollowType,
|
|
95
|
+
"struct": tokenFollowType,
|
|
96
|
+
"lib": tokenFollowType,
|
|
97
|
+
"enum": tokenFollowType,
|
|
98
|
+
"union": tokenFollowType
|
|
99
|
+
};
|
|
100
|
+
var matching = { "[": "]", "{": "}", "(": ")", "<": ">" };
|
|
101
|
+
function tokenBase(stream, state) {
|
|
102
|
+
if (stream.eatSpace()) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
if (state.lastToken != "\\" && stream.match("{%", false)) {
|
|
106
|
+
return chain(tokenMacro("%", "%"), stream, state);
|
|
107
|
+
}
|
|
108
|
+
if (state.lastToken != "\\" && stream.match("{{", false)) {
|
|
109
|
+
return chain(tokenMacro("{", "}"), stream, state);
|
|
110
|
+
}
|
|
111
|
+
if (stream.peek() == "#") {
|
|
112
|
+
stream.skipToEnd();
|
|
113
|
+
return "comment";
|
|
114
|
+
}
|
|
115
|
+
var matched;
|
|
116
|
+
if (stream.match(idents)) {
|
|
117
|
+
stream.eat(/[?!]/);
|
|
118
|
+
matched = stream.current();
|
|
119
|
+
if (stream.eat(":")) {
|
|
120
|
+
return "atom";
|
|
121
|
+
} else if (state.lastToken == ".") {
|
|
122
|
+
return "property";
|
|
123
|
+
} else if (keywords.test(matched)) {
|
|
124
|
+
if (indentKeywords.test(matched)) {
|
|
125
|
+
if (!(matched == "fun" && state.blocks.indexOf("lib") >= 0) && !(matched == "def" && state.lastToken == "abstract")) {
|
|
126
|
+
state.blocks.push(matched);
|
|
127
|
+
state.currentIndent += 1;
|
|
128
|
+
}
|
|
129
|
+
} else if ((state.lastStyle == "operator" || !state.lastStyle) && indentExpressionKeywords.test(matched)) {
|
|
130
|
+
state.blocks.push(matched);
|
|
131
|
+
state.currentIndent += 1;
|
|
132
|
+
} else if (matched == "end") {
|
|
133
|
+
state.blocks.pop();
|
|
134
|
+
state.currentIndent -= 1;
|
|
135
|
+
}
|
|
136
|
+
if (nextTokenizer.hasOwnProperty(matched)) {
|
|
137
|
+
state.tokenize.push(nextTokenizer[matched]);
|
|
138
|
+
}
|
|
139
|
+
return "keyword";
|
|
140
|
+
} else if (atomWords.test(matched)) {
|
|
141
|
+
return "atom";
|
|
142
|
+
}
|
|
143
|
+
return "variable";
|
|
144
|
+
}
|
|
145
|
+
if (stream.eat("@")) {
|
|
146
|
+
if (stream.peek() == "[") {
|
|
147
|
+
return chain(tokenNest("[", "]", "meta"), stream, state);
|
|
148
|
+
}
|
|
149
|
+
stream.eat("@");
|
|
150
|
+
stream.match(idents) || stream.match(types);
|
|
151
|
+
return "propertyName";
|
|
152
|
+
}
|
|
153
|
+
if (stream.match(types)) {
|
|
154
|
+
return "tag";
|
|
155
|
+
}
|
|
156
|
+
if (stream.eat(":")) {
|
|
157
|
+
if (stream.eat('"')) {
|
|
158
|
+
return chain(tokenQuote('"', "atom", false), stream, state);
|
|
159
|
+
} else if (stream.match(idents) || stream.match(types) || stream.match(operators) || stream.match(conditionalOperators) || stream.match(indexingOperators)) {
|
|
160
|
+
return "atom";
|
|
161
|
+
}
|
|
162
|
+
stream.eat(":");
|
|
163
|
+
return "operator";
|
|
164
|
+
}
|
|
165
|
+
if (stream.eat('"')) {
|
|
166
|
+
return chain(tokenQuote('"', "string", true), stream, state);
|
|
167
|
+
}
|
|
168
|
+
if (stream.peek() == "%") {
|
|
169
|
+
var style = "string";
|
|
170
|
+
var embed = true;
|
|
171
|
+
var delim;
|
|
172
|
+
if (stream.match("%r")) {
|
|
173
|
+
style = "string.special";
|
|
174
|
+
delim = stream.next();
|
|
175
|
+
} else if (stream.match("%w")) {
|
|
176
|
+
embed = false;
|
|
177
|
+
delim = stream.next();
|
|
178
|
+
} else if (stream.match("%q")) {
|
|
179
|
+
embed = false;
|
|
180
|
+
delim = stream.next();
|
|
181
|
+
} else {
|
|
182
|
+
if (delim = stream.match(/^%([^\w\s=])/)) {
|
|
183
|
+
delim = delim[1];
|
|
184
|
+
} else if (stream.match(/^%[a-zA-Z_\u009F-\uFFFF][\w\u009F-\uFFFF]*/)) {
|
|
185
|
+
return "meta";
|
|
186
|
+
} else if (stream.eat("%")) {
|
|
187
|
+
return "operator";
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (matching.hasOwnProperty(delim)) {
|
|
191
|
+
delim = matching[delim];
|
|
192
|
+
}
|
|
193
|
+
return chain(tokenQuote(delim, style, embed), stream, state);
|
|
194
|
+
}
|
|
195
|
+
if (matched = stream.match(/^<<-('?)([A-Z]\w*)\1/)) {
|
|
196
|
+
return chain(tokenHereDoc(matched[2], !matched[1]), stream, state);
|
|
197
|
+
}
|
|
198
|
+
if (stream.eat("'")) {
|
|
199
|
+
stream.match(/^(?:[^']|\\(?:[befnrtv0'"]|[0-7]{3}|u(?:[0-9a-fA-F]{4}|\{[0-9a-fA-F]{1,6}\})))/);
|
|
200
|
+
stream.eat("'");
|
|
201
|
+
return "atom";
|
|
202
|
+
}
|
|
203
|
+
if (stream.eat("0")) {
|
|
204
|
+
if (stream.eat("x")) {
|
|
205
|
+
stream.match(/^[0-9a-fA-F_]+/);
|
|
206
|
+
} else if (stream.eat("o")) {
|
|
207
|
+
stream.match(/^[0-7_]+/);
|
|
208
|
+
} else if (stream.eat("b")) {
|
|
209
|
+
stream.match(/^[01_]+/);
|
|
210
|
+
}
|
|
211
|
+
return "number";
|
|
212
|
+
}
|
|
213
|
+
if (stream.eat(/^\d/)) {
|
|
214
|
+
stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+-]?\d+)?/);
|
|
215
|
+
return "number";
|
|
216
|
+
}
|
|
217
|
+
if (stream.match(operators)) {
|
|
218
|
+
stream.eat("=");
|
|
219
|
+
return "operator";
|
|
220
|
+
}
|
|
221
|
+
if (stream.match(conditionalOperators) || stream.match(anotherOperators)) {
|
|
222
|
+
return "operator";
|
|
223
|
+
}
|
|
224
|
+
if (matched = stream.match(/[({[]/, false)) {
|
|
225
|
+
matched = matched[0];
|
|
226
|
+
return chain(tokenNest(matched, matching[matched], null), stream, state);
|
|
227
|
+
}
|
|
228
|
+
if (stream.eat("\\")) {
|
|
229
|
+
stream.next();
|
|
230
|
+
return "meta";
|
|
231
|
+
}
|
|
232
|
+
stream.next();
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
function tokenNest(begin, end, style, started) {
|
|
236
|
+
return function(stream, state) {
|
|
237
|
+
if (!started && stream.match(begin)) {
|
|
238
|
+
state.tokenize[state.tokenize.length - 1] = tokenNest(begin, end, style, true);
|
|
239
|
+
state.currentIndent += 1;
|
|
240
|
+
return style;
|
|
241
|
+
}
|
|
242
|
+
var nextStyle = tokenBase(stream, state);
|
|
243
|
+
if (stream.current() === end) {
|
|
244
|
+
state.tokenize.pop();
|
|
245
|
+
state.currentIndent -= 1;
|
|
246
|
+
nextStyle = style;
|
|
247
|
+
}
|
|
248
|
+
return nextStyle;
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
function tokenMacro(begin, end, started) {
|
|
252
|
+
return function(stream, state) {
|
|
253
|
+
if (!started && stream.match("{" + begin)) {
|
|
254
|
+
state.currentIndent += 1;
|
|
255
|
+
state.tokenize[state.tokenize.length - 1] = tokenMacro(begin, end, true);
|
|
256
|
+
return "meta";
|
|
257
|
+
}
|
|
258
|
+
if (stream.match(end + "}")) {
|
|
259
|
+
state.currentIndent -= 1;
|
|
260
|
+
state.tokenize.pop();
|
|
261
|
+
return "meta";
|
|
262
|
+
}
|
|
263
|
+
return tokenBase(stream, state);
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
function tokenMacroDef(stream, state) {
|
|
267
|
+
if (stream.eatSpace()) {
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
var matched;
|
|
271
|
+
if (matched = stream.match(idents)) {
|
|
272
|
+
if (matched == "def") {
|
|
273
|
+
return "keyword";
|
|
274
|
+
}
|
|
275
|
+
stream.eat(/[?!]/);
|
|
276
|
+
}
|
|
277
|
+
state.tokenize.pop();
|
|
278
|
+
return "def";
|
|
279
|
+
}
|
|
280
|
+
function tokenFollowIdent(stream, state) {
|
|
281
|
+
if (stream.eatSpace()) {
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
284
|
+
if (stream.match(idents)) {
|
|
285
|
+
stream.eat(/[!?]/);
|
|
286
|
+
} else {
|
|
287
|
+
stream.match(operators) || stream.match(conditionalOperators) || stream.match(indexingOperators);
|
|
288
|
+
}
|
|
289
|
+
state.tokenize.pop();
|
|
290
|
+
return "def";
|
|
291
|
+
}
|
|
292
|
+
function tokenFollowType(stream, state) {
|
|
293
|
+
if (stream.eatSpace()) {
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
stream.match(types);
|
|
297
|
+
state.tokenize.pop();
|
|
298
|
+
return "def";
|
|
299
|
+
}
|
|
300
|
+
function tokenQuote(end, style, embed) {
|
|
301
|
+
return function(stream, state) {
|
|
302
|
+
var escaped = false;
|
|
303
|
+
while (stream.peek()) {
|
|
304
|
+
if (!escaped) {
|
|
305
|
+
if (stream.match("{%", false)) {
|
|
306
|
+
state.tokenize.push(tokenMacro("%", "%"));
|
|
307
|
+
return style;
|
|
308
|
+
}
|
|
309
|
+
if (stream.match("{{", false)) {
|
|
310
|
+
state.tokenize.push(tokenMacro("{", "}"));
|
|
311
|
+
return style;
|
|
312
|
+
}
|
|
313
|
+
if (embed && stream.match("#{", false)) {
|
|
314
|
+
state.tokenize.push(tokenNest("#{", "}", "meta"));
|
|
315
|
+
return style;
|
|
316
|
+
}
|
|
317
|
+
var ch = stream.next();
|
|
318
|
+
if (ch == end) {
|
|
319
|
+
state.tokenize.pop();
|
|
320
|
+
return style;
|
|
321
|
+
}
|
|
322
|
+
escaped = embed && ch == "\\";
|
|
323
|
+
} else {
|
|
324
|
+
stream.next();
|
|
325
|
+
escaped = false;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return style;
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
function tokenHereDoc(phrase, embed) {
|
|
332
|
+
return function(stream, state) {
|
|
333
|
+
if (stream.sol()) {
|
|
334
|
+
stream.eatSpace();
|
|
335
|
+
if (stream.match(phrase)) {
|
|
336
|
+
state.tokenize.pop();
|
|
337
|
+
return "string";
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
var escaped = false;
|
|
341
|
+
while (stream.peek()) {
|
|
342
|
+
if (!escaped) {
|
|
343
|
+
if (stream.match("{%", false)) {
|
|
344
|
+
state.tokenize.push(tokenMacro("%", "%"));
|
|
345
|
+
return "string";
|
|
346
|
+
}
|
|
347
|
+
if (stream.match("{{", false)) {
|
|
348
|
+
state.tokenize.push(tokenMacro("{", "}"));
|
|
349
|
+
return "string";
|
|
350
|
+
}
|
|
351
|
+
if (embed && stream.match("#{", false)) {
|
|
352
|
+
state.tokenize.push(tokenNest("#{", "}", "meta"));
|
|
353
|
+
return "string";
|
|
354
|
+
}
|
|
355
|
+
escaped = stream.next() == "\\" && embed;
|
|
356
|
+
} else {
|
|
357
|
+
stream.next();
|
|
358
|
+
escaped = false;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
return "string";
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
const crystal = {
|
|
365
|
+
name: "crystal",
|
|
366
|
+
startState: function() {
|
|
367
|
+
return {
|
|
368
|
+
tokenize: [tokenBase],
|
|
369
|
+
currentIndent: 0,
|
|
370
|
+
lastToken: null,
|
|
371
|
+
lastStyle: null,
|
|
372
|
+
blocks: []
|
|
373
|
+
};
|
|
374
|
+
},
|
|
375
|
+
token: function(stream, state) {
|
|
376
|
+
var style = state.tokenize[state.tokenize.length - 1](stream, state);
|
|
377
|
+
var token = stream.current();
|
|
378
|
+
if (style && style != "comment") {
|
|
379
|
+
state.lastToken = token;
|
|
380
|
+
state.lastStyle = style;
|
|
381
|
+
}
|
|
382
|
+
return style;
|
|
383
|
+
},
|
|
384
|
+
indent: function(state, textAfter, cx) {
|
|
385
|
+
textAfter = textAfter.replace(/^\s*(?:\{%)?\s*|\s*(?:%\})?\s*$/g, "");
|
|
386
|
+
if (dedentKeywords.test(textAfter) || dedentPunctuals.test(textAfter)) {
|
|
387
|
+
return cx.unit * (state.currentIndent - 1);
|
|
388
|
+
}
|
|
389
|
+
return cx.unit * state.currentIndent;
|
|
390
|
+
},
|
|
391
|
+
languageData: {
|
|
392
|
+
indentOnInput: wordRegExp(dedentPunctualsArray.concat(dedentKeywordsArray), true),
|
|
393
|
+
commentTokens: { line: "#" }
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
export {
|
|
397
|
+
crystal
|
|
398
|
+
};
|
|
399
|
+
//# sourceMappingURL=crystal-DyuLTqLs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crystal-DyuLTqLs.js","sources":["../../../node_modules/.pnpm/@codemirror+legacy-modes@6.5.2/node_modules/@codemirror/legacy-modes/mode/crystal.js"],"sourcesContent":["function wordRegExp(words, end) {\n return new RegExp((end ? \"\" : \"^\") + \"(?:\" + words.join(\"|\") + \")\" + (end ? \"$\" : \"\\\\b\"));\n}\n\nfunction chain(tokenize, stream, state) {\n state.tokenize.push(tokenize);\n return tokenize(stream, state);\n}\n\nvar operators = /^(?:[-+/%|&^]|\\*\\*?|[<>]{2})/;\nvar conditionalOperators = /^(?:[=!]~|===|<=>|[<>=!]=?|[|&]{2}|~)/;\nvar indexingOperators = /^(?:\\[\\][?=]?)/;\nvar anotherOperators = /^(?:\\.(?:\\.{2})?|->|[?:])/;\nvar idents = /^[a-z_\\u009F-\\uFFFF][a-zA-Z0-9_\\u009F-\\uFFFF]*/;\nvar types = /^[A-Z_\\u009F-\\uFFFF][a-zA-Z0-9_\\u009F-\\uFFFF]*/;\nvar keywords = wordRegExp([\n \"abstract\", \"alias\", \"as\", \"asm\", \"begin\", \"break\", \"case\", \"class\", \"def\", \"do\",\n \"else\", \"elsif\", \"end\", \"ensure\", \"enum\", \"extend\", \"for\", \"fun\", \"if\",\n \"include\", \"instance_sizeof\", \"lib\", \"macro\", \"module\", \"next\", \"of\", \"out\", \"pointerof\",\n \"private\", \"protected\", \"rescue\", \"return\", \"require\", \"select\", \"sizeof\", \"struct\",\n \"super\", \"then\", \"type\", \"typeof\", \"uninitialized\", \"union\", \"unless\", \"until\", \"when\", \"while\", \"with\",\n \"yield\", \"__DIR__\", \"__END_LINE__\", \"__FILE__\", \"__LINE__\"\n]);\nvar atomWords = wordRegExp([\"true\", \"false\", \"nil\", \"self\"]);\nvar indentKeywordsArray = [\n \"def\", \"fun\", \"macro\",\n \"class\", \"module\", \"struct\", \"lib\", \"enum\", \"union\",\n \"do\", \"for\"\n];\nvar indentKeywords = wordRegExp(indentKeywordsArray);\nvar indentExpressionKeywordsArray = [\"if\", \"unless\", \"case\", \"while\", \"until\", \"begin\", \"then\"];\nvar indentExpressionKeywords = wordRegExp(indentExpressionKeywordsArray);\nvar dedentKeywordsArray = [\"end\", \"else\", \"elsif\", \"rescue\", \"ensure\"];\nvar dedentKeywords = wordRegExp(dedentKeywordsArray);\nvar dedentPunctualsArray = [\"\\\\)\", \"\\\\}\", \"\\\\]\"];\nvar dedentPunctuals = new RegExp(\"^(?:\" + dedentPunctualsArray.join(\"|\") + \")$\");\nvar nextTokenizer = {\n \"def\": tokenFollowIdent, \"fun\": tokenFollowIdent, \"macro\": tokenMacroDef,\n \"class\": tokenFollowType, \"module\": tokenFollowType, \"struct\": tokenFollowType,\n \"lib\": tokenFollowType, \"enum\": tokenFollowType, \"union\": tokenFollowType\n};\nvar matching = {\"[\": \"]\", \"{\": \"}\", \"(\": \")\", \"<\": \">\"};\n\nfunction tokenBase(stream, state) {\n if (stream.eatSpace()) {\n return null;\n }\n\n // Macros\n if (state.lastToken != \"\\\\\" && stream.match(\"{%\", false)) {\n return chain(tokenMacro(\"%\", \"%\"), stream, state);\n }\n\n if (state.lastToken != \"\\\\\" && stream.match(\"{{\", false)) {\n return chain(tokenMacro(\"{\", \"}\"), stream, state);\n }\n\n // Comments\n if (stream.peek() == \"#\") {\n stream.skipToEnd();\n return \"comment\";\n }\n\n // Variables and keywords\n var matched;\n if (stream.match(idents)) {\n stream.eat(/[?!]/);\n\n matched = stream.current();\n if (stream.eat(\":\")) {\n return \"atom\";\n } else if (state.lastToken == \".\") {\n return \"property\";\n } else if (keywords.test(matched)) {\n if (indentKeywords.test(matched)) {\n if (!(matched == \"fun\" && state.blocks.indexOf(\"lib\") >= 0) && !(matched == \"def\" && state.lastToken == \"abstract\")) {\n state.blocks.push(matched);\n state.currentIndent += 1;\n }\n } else if ((state.lastStyle == \"operator\" || !state.lastStyle) && indentExpressionKeywords.test(matched)) {\n state.blocks.push(matched);\n state.currentIndent += 1;\n } else if (matched == \"end\") {\n state.blocks.pop();\n state.currentIndent -= 1;\n }\n\n if (nextTokenizer.hasOwnProperty(matched)) {\n state.tokenize.push(nextTokenizer[matched]);\n }\n\n return \"keyword\";\n } else if (atomWords.test(matched)) {\n return \"atom\";\n }\n\n return \"variable\";\n }\n\n // Class variables and instance variables\n // or attributes\n if (stream.eat(\"@\")) {\n if (stream.peek() == \"[\") {\n return chain(tokenNest(\"[\", \"]\", \"meta\"), stream, state);\n }\n\n stream.eat(\"@\");\n stream.match(idents) || stream.match(types);\n return \"propertyName\";\n }\n\n // Constants and types\n if (stream.match(types)) {\n return \"tag\";\n }\n\n // Symbols or ':' operator\n if (stream.eat(\":\")) {\n if (stream.eat(\"\\\"\")) {\n return chain(tokenQuote(\"\\\"\", \"atom\", false), stream, state);\n } else if (stream.match(idents) || stream.match(types) ||\n stream.match(operators) || stream.match(conditionalOperators) || stream.match(indexingOperators)) {\n return \"atom\";\n }\n stream.eat(\":\");\n return \"operator\";\n }\n\n // Strings\n if (stream.eat(\"\\\"\")) {\n return chain(tokenQuote(\"\\\"\", \"string\", true), stream, state);\n }\n\n // Strings or regexps or macro variables or '%' operator\n if (stream.peek() == \"%\") {\n var style = \"string\";\n var embed = true;\n var delim;\n\n if (stream.match(\"%r\")) {\n // Regexps\n style = \"string.special\";\n delim = stream.next();\n } else if (stream.match(\"%w\")) {\n embed = false;\n delim = stream.next();\n } else if (stream.match(\"%q\")) {\n embed = false;\n delim = stream.next();\n } else {\n if(delim = stream.match(/^%([^\\w\\s=])/)) {\n delim = delim[1];\n } else if (stream.match(/^%[a-zA-Z_\\u009F-\\uFFFF][\\w\\u009F-\\uFFFF]*/)) {\n // Macro variables\n return \"meta\";\n } else if (stream.eat('%')) {\n // '%' operator\n return \"operator\";\n }\n }\n\n if (matching.hasOwnProperty(delim)) {\n delim = matching[delim];\n }\n return chain(tokenQuote(delim, style, embed), stream, state);\n }\n\n // Here Docs\n if (matched = stream.match(/^<<-('?)([A-Z]\\w*)\\1/)) {\n return chain(tokenHereDoc(matched[2], !matched[1]), stream, state)\n }\n\n // Characters\n if (stream.eat(\"'\")) {\n stream.match(/^(?:[^']|\\\\(?:[befnrtv0'\"]|[0-7]{3}|u(?:[0-9a-fA-F]{4}|\\{[0-9a-fA-F]{1,6}\\})))/);\n stream.eat(\"'\");\n return \"atom\";\n }\n\n // Numbers\n if (stream.eat(\"0\")) {\n if (stream.eat(\"x\")) {\n stream.match(/^[0-9a-fA-F_]+/);\n } else if (stream.eat(\"o\")) {\n stream.match(/^[0-7_]+/);\n } else if (stream.eat(\"b\")) {\n stream.match(/^[01_]+/);\n }\n return \"number\";\n }\n\n if (stream.eat(/^\\d/)) {\n stream.match(/^[\\d_]*(?:\\.[\\d_]+)?(?:[eE][+-]?\\d+)?/);\n return \"number\";\n }\n\n // Operators\n if (stream.match(operators)) {\n stream.eat(\"=\"); // Operators can follow assign symbol.\n return \"operator\";\n }\n\n if (stream.match(conditionalOperators) || stream.match(anotherOperators)) {\n return \"operator\";\n }\n\n // Parens and braces\n if (matched = stream.match(/[({[]/, false)) {\n matched = matched[0];\n return chain(tokenNest(matched, matching[matched], null), stream, state);\n }\n\n // Escapes\n if (stream.eat(\"\\\\\")) {\n stream.next();\n return \"meta\";\n }\n\n stream.next();\n return null;\n}\n\nfunction tokenNest(begin, end, style, started) {\n return function (stream, state) {\n if (!started && stream.match(begin)) {\n state.tokenize[state.tokenize.length - 1] = tokenNest(begin, end, style, true);\n state.currentIndent += 1;\n return style;\n }\n\n var nextStyle = tokenBase(stream, state);\n if (stream.current() === end) {\n state.tokenize.pop();\n state.currentIndent -= 1;\n nextStyle = style;\n }\n\n return nextStyle;\n };\n}\n\nfunction tokenMacro(begin, end, started) {\n return function (stream, state) {\n if (!started && stream.match(\"{\" + begin)) {\n state.currentIndent += 1;\n state.tokenize[state.tokenize.length - 1] = tokenMacro(begin, end, true);\n return \"meta\";\n }\n\n if (stream.match(end + \"}\")) {\n state.currentIndent -= 1;\n state.tokenize.pop();\n return \"meta\";\n }\n\n return tokenBase(stream, state);\n };\n}\n\nfunction tokenMacroDef(stream, state) {\n if (stream.eatSpace()) {\n return null;\n }\n\n var matched;\n if (matched = stream.match(idents)) {\n if (matched == \"def\") {\n return \"keyword\";\n }\n stream.eat(/[?!]/);\n }\n\n state.tokenize.pop();\n return \"def\";\n}\n\nfunction tokenFollowIdent(stream, state) {\n if (stream.eatSpace()) {\n return null;\n }\n\n if (stream.match(idents)) {\n stream.eat(/[!?]/);\n } else {\n stream.match(operators) || stream.match(conditionalOperators) || stream.match(indexingOperators);\n }\n state.tokenize.pop();\n return \"def\";\n}\n\nfunction tokenFollowType(stream, state) {\n if (stream.eatSpace()) {\n return null;\n }\n\n stream.match(types);\n state.tokenize.pop();\n return \"def\";\n}\n\nfunction tokenQuote(end, style, embed) {\n return function (stream, state) {\n var escaped = false;\n\n while (stream.peek()) {\n if (!escaped) {\n if (stream.match(\"{%\", false)) {\n state.tokenize.push(tokenMacro(\"%\", \"%\"));\n return style;\n }\n\n if (stream.match(\"{{\", false)) {\n state.tokenize.push(tokenMacro(\"{\", \"}\"));\n return style;\n }\n\n if (embed && stream.match(\"#{\", false)) {\n state.tokenize.push(tokenNest(\"#{\", \"}\", \"meta\"));\n return style;\n }\n\n var ch = stream.next();\n\n if (ch == end) {\n state.tokenize.pop();\n return style;\n }\n\n escaped = embed && ch == \"\\\\\";\n } else {\n stream.next();\n escaped = false;\n }\n }\n\n return style;\n };\n}\n\nfunction tokenHereDoc(phrase, embed) {\n return function (stream, state) {\n if (stream.sol()) {\n stream.eatSpace()\n if (stream.match(phrase)) {\n state.tokenize.pop();\n return \"string\";\n }\n }\n\n var escaped = false;\n while (stream.peek()) {\n if (!escaped) {\n if (stream.match(\"{%\", false)) {\n state.tokenize.push(tokenMacro(\"%\", \"%\"));\n return \"string\";\n }\n\n if (stream.match(\"{{\", false)) {\n state.tokenize.push(tokenMacro(\"{\", \"}\"));\n return \"string\";\n }\n\n if (embed && stream.match(\"#{\", false)) {\n state.tokenize.push(tokenNest(\"#{\", \"}\", \"meta\"));\n return \"string\";\n }\n\n escaped = stream.next() == \"\\\\\" && embed;\n } else {\n stream.next();\n escaped = false;\n }\n }\n\n return \"string\";\n }\n}\n\nexport const crystal = {\n name: \"crystal\",\n startState: function () {\n return {\n tokenize: [tokenBase],\n currentIndent: 0,\n lastToken: null,\n lastStyle: null,\n blocks: []\n };\n },\n\n token: function (stream, state) {\n var style = state.tokenize[state.tokenize.length - 1](stream, state);\n var token = stream.current();\n\n if (style && style != \"comment\") {\n state.lastToken = token;\n state.lastStyle = style;\n }\n\n return style;\n },\n\n indent: function (state, textAfter, cx) {\n textAfter = textAfter.replace(/^\\s*(?:\\{%)?\\s*|\\s*(?:%\\})?\\s*$/g, \"\");\n\n if (dedentKeywords.test(textAfter) || dedentPunctuals.test(textAfter)) {\n return cx.unit * (state.currentIndent - 1);\n }\n\n return cx.unit * state.currentIndent;\n },\n\n languageData: {\n indentOnInput: wordRegExp(dedentPunctualsArray.concat(dedentKeywordsArray), true),\n commentTokens: {line: \"#\"}\n }\n};\n"],"names":[],"mappings":"AAAA,SAAS,WAAW,OAAO,KAAK;AAC9B,SAAO,IAAI,QAAQ,MAAM,KAAK,OAAO,QAAQ,MAAM,KAAK,GAAG,IAAI,OAAO,MAAM,MAAM,MAAM;AAC1F;AAEA,SAAS,MAAM,UAAU,QAAQ,OAAO;AACtC,QAAM,SAAS,KAAK,QAAQ;AAC5B,SAAO,SAAS,QAAQ,KAAK;AAC/B;AAEA,IAAI,YAAY;AAChB,IAAI,uBAAuB;AAC3B,IAAI,oBAAoB;AACxB,IAAI,mBAAmB;AACvB,IAAI,SAAS;AACb,IAAI,QAAQ;AACZ,IAAI,WAAW,WAAW;AAAA,EACxB;AAAA,EAAY;AAAA,EAAS;AAAA,EAAM;AAAA,EAAO;AAAA,EAAS;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAO;AAAA,EAC5E;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAO;AAAA,EAAU;AAAA,EAAQ;AAAA,EAAU;AAAA,EAAO;AAAA,EA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