repl-sdk 1.0.1 → 1.0.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 (261) hide show
  1. package/package.json +12 -20
  2. package/dist/apl-fqmucPXA.js +0 -141
  3. package/dist/apl-fqmucPXA.js.map +0 -1
  4. package/dist/asciiarmor-DucZyvP0.js +0 -57
  5. package/dist/asciiarmor-DucZyvP0.js.map +0 -1
  6. package/dist/asn1-BnOEsgAm.js +0 -145
  7. package/dist/asn1-BnOEsgAm.js.map +0 -1
  8. package/dist/assets/tar-worker-CxTcoQcr.js +0 -593
  9. package/dist/assets/tar-worker-CxTcoQcr.js.map +0 -1
  10. package/dist/asterisk-QAlztEwS.js +0 -346
  11. package/dist/asterisk-QAlztEwS.js.map +0 -1
  12. package/dist/brainfuck-DZVCuF_t.js +0 -54
  13. package/dist/brainfuck-DZVCuF_t.js.map +0 -1
  14. package/dist/clike-CTYGlS6x.js +0 -800
  15. package/dist/clike-CTYGlS6x.js.map +0 -1
  16. package/dist/clojure-BhXMqnxz.js +0 -850
  17. package/dist/clojure-BhXMqnxz.js.map +0 -1
  18. package/dist/cmake-BGaNd9E7.js +0 -72
  19. package/dist/cmake-BGaNd9E7.js.map +0 -1
  20. package/dist/cobol-4yqQntpt.js +0 -121
  21. package/dist/cobol-4yqQntpt.js.map +0 -1
  22. package/dist/codemirror-De3S70Np.js +0 -2912
  23. package/dist/codemirror-De3S70Np.js.map +0 -1
  24. package/dist/coffeescript-D2dXvhEc.js +0 -309
  25. package/dist/coffeescript-D2dXvhEc.js.map +0 -1
  26. package/dist/commonlisp-CF_VNHQR.js +0 -131
  27. package/dist/commonlisp-CF_VNHQR.js.map +0 -1
  28. package/dist/crystal-DyuLTqLs.js +0 -399
  29. package/dist/crystal-DyuLTqLs.js.map +0 -1
  30. package/dist/css-DkSyTW67.js +0 -1773
  31. package/dist/css-DkSyTW67.js.map +0 -1
  32. package/dist/cypher-Dlu_3r4V.js +0 -122
  33. package/dist/cypher-Dlu_3r4V.js.map +0 -1
  34. package/dist/d-UURgV0Ux.js +0 -180
  35. package/dist/d-UURgV0Ux.js.map +0 -1
  36. package/dist/diff-B_Bi2Crb.js +0 -26
  37. package/dist/diff-B_Bi2Crb.js.map +0 -1
  38. package/dist/dockerfile-Bvk733Ga.js +0 -202
  39. package/dist/dockerfile-Bvk733Ga.js.map +0 -1
  40. package/dist/dtd-Dy74G54E.js +0 -115
  41. package/dist/dtd-Dy74G54E.js.map +0 -1
  42. package/dist/dylan-TSb-Nfix.js +0 -315
  43. package/dist/dylan-TSb-Nfix.js.map +0 -1
  44. package/dist/ebnf-4fKAGW3a.js +0 -141
  45. package/dist/ebnf-4fKAGW3a.js.map +0 -1
  46. package/dist/ecl-B59qGGVg.js +0 -179
  47. package/dist/ecl-B59qGGVg.js.map +0 -1
  48. package/dist/eiffel-Dze7nlu3.js +0 -135
  49. package/dist/eiffel-Dze7nlu3.js.map +0 -1
  50. package/dist/elm-DG7jkhNZ.js +0 -177
  51. package/dist/elm-DG7jkhNZ.js.map +0 -1
  52. package/dist/erlang-BO6gOnGA.js +0 -675
  53. package/dist/erlang-BO6gOnGA.js.map +0 -1
  54. package/dist/factor-CMxFHDqz.js +0 -66
  55. package/dist/factor-CMxFHDqz.js.map +0 -1
  56. package/dist/fcl-CDDUNjTj.js +0 -142
  57. package/dist/fcl-CDDUNjTj.js.map +0 -1
  58. package/dist/forth-B9D2JCeE.js +0 -117
  59. package/dist/forth-B9D2JCeE.js.map +0 -1
  60. package/dist/fortran-CAG2BFbe.js +0 -468
  61. package/dist/fortran-CAG2BFbe.js.map +0 -1
  62. package/dist/gas-0Aw8zDr5.js +0 -294
  63. package/dist/gas-0Aw8zDr5.js.map +0 -1
  64. package/dist/gherkin-DhZlEZiy.js +0 -116
  65. package/dist/gherkin-DhZlEZiy.js.map +0 -1
  66. package/dist/gjs-DfguZDLq.js +0 -173
  67. package/dist/gjs-DfguZDLq.js.map +0 -1
  68. package/dist/gmd-Yas-Oo8k.js +0 -163
  69. package/dist/gmd-Yas-Oo8k.js.map +0 -1
  70. package/dist/groovy-CpwJiBl7.js +0 -224
  71. package/dist/groovy-CpwJiBl7.js.map +0 -1
  72. package/dist/haskell-ySd-OUo8.js +0 -460
  73. package/dist/haskell-ySd-OUo8.js.map +0 -1
  74. package/dist/haxe-7MlzfeYV.js +0 -515
  75. package/dist/haxe-7MlzfeYV.js.map +0 -1
  76. package/dist/hbs-CxcmWxSJ.js +0 -62
  77. package/dist/hbs-CxcmWxSJ.js.map +0 -1
  78. package/dist/http-BqypyemW.js +0 -80
  79. package/dist/http-BqypyemW.js.map +0 -1
  80. package/dist/idl-4HIGJlDI.js +0 -986
  81. package/dist/idl-4HIGJlDI.js.map +0 -1
  82. package/dist/index-B3Meoznj.js +0 -118
  83. package/dist/index-B3Meoznj.js.map +0 -1
  84. package/dist/index-BQyfDUUx.js +0 -692
  85. package/dist/index-BQyfDUUx.js.map +0 -1
  86. package/dist/index-BRDroAD8.js +0 -305
  87. package/dist/index-BRDroAD8.js.map +0 -1
  88. package/dist/index-BRMAzRyM.js +0 -179
  89. package/dist/index-BRMAzRyM.js.map +0 -1
  90. package/dist/index-Bb8uYQgv.js +0 -927
  91. package/dist/index-Bb8uYQgv.js.map +0 -1
  92. package/dist/index-BlOjO66K.js +0 -17618
  93. package/dist/index-BlOjO66K.js.map +0 -1
  94. package/dist/index-BoGWnSNL.js +0 -706
  95. package/dist/index-BoGWnSNL.js.map +0 -1
  96. package/dist/index-BsRrEiOu.js +0 -98
  97. package/dist/index-BsRrEiOu.js.map +0 -1
  98. package/dist/index-C2sFZMth.js +0 -391
  99. package/dist/index-C2sFZMth.js.map +0 -1
  100. package/dist/index-C7xwOjmS.js +0 -291
  101. package/dist/index-C7xwOjmS.js.map +0 -1
  102. package/dist/index-CA3lFUx6.js +0 -315
  103. package/dist/index-CA3lFUx6.js.map +0 -1
  104. package/dist/index-CB-pPTIf.js +0 -98
  105. package/dist/index-CB-pPTIf.js.map +0 -1
  106. package/dist/index-CCa6x1FE.js +0 -386
  107. package/dist/index-CCa6x1FE.js.map +0 -1
  108. package/dist/index-CD4DINI1.js +0 -158
  109. package/dist/index-CD4DINI1.js.map +0 -1
  110. package/dist/index-CE0B_fcG.js +0 -328
  111. package/dist/index-CE0B_fcG.js.map +0 -1
  112. package/dist/index-CVGAEPMV.js +0 -2139
  113. package/dist/index-CVGAEPMV.js.map +0 -1
  114. package/dist/index-CmaT2afn.js +0 -332
  115. package/dist/index-CmaT2afn.js.map +0 -1
  116. package/dist/index-D8sUxXp5.js +0 -83
  117. package/dist/index-D8sUxXp5.js.map +0 -1
  118. package/dist/index-DIz8Vpn-.js +0 -737
  119. package/dist/index-DIz8Vpn-.js.map +0 -1
  120. package/dist/index-DNP1xT-S.js +0 -408
  121. package/dist/index-DNP1xT-S.js.map +0 -1
  122. package/dist/index-DOAqdvnQ.js +0 -862
  123. package/dist/index-DOAqdvnQ.js.map +0 -1
  124. package/dist/index-DVUMFbgi.js +0 -152
  125. package/dist/index-DVUMFbgi.js.map +0 -1
  126. package/dist/index-VeTBKRVd.js +0 -83
  127. package/dist/index-VeTBKRVd.js.map +0 -1
  128. package/dist/index-dXZeR7Bx.js +0 -1767
  129. package/dist/index-dXZeR7Bx.js.map +0 -1
  130. package/dist/index-gtqbIb6T.js +0 -62
  131. package/dist/index-gtqbIb6T.js.map +0 -1
  132. package/dist/index-pN_pUAQ7.js +0 -2426
  133. package/dist/index-pN_pUAQ7.js.map +0 -1
  134. package/dist/index-wasu5VX0.js +0 -1150
  135. package/dist/index-wasu5VX0.js.map +0 -1
  136. package/dist/javascript-Bt8B7yTi.js +0 -993
  137. package/dist/javascript-Bt8B7yTi.js.map +0 -1
  138. package/dist/julia-Bs6JJhYG.js +0 -408
  139. package/dist/julia-Bs6JJhYG.js.map +0 -1
  140. package/dist/livescript-DmzgM3Yt.js +0 -297
  141. package/dist/livescript-DmzgM3Yt.js.map +0 -1
  142. package/dist/lua-8cJgIlqe.js +0 -257
  143. package/dist/lua-8cJgIlqe.js.map +0 -1
  144. package/dist/mathematica-DNLOL9PQ.js +0 -111
  145. package/dist/mathematica-DNLOL9PQ.js.map +0 -1
  146. package/dist/mbox-Ga7d4MMN.js +0 -118
  147. package/dist/mbox-Ga7d4MMN.js.map +0 -1
  148. package/dist/mirc-Dma3B8rS.js +0 -108
  149. package/dist/mirc-Dma3B8rS.js.map +0 -1
  150. package/dist/mllike-DHn7xckP.js +0 -335
  151. package/dist/mllike-DHn7xckP.js.map +0 -1
  152. package/dist/modelica-0d55jYY0.js +0 -148
  153. package/dist/modelica-0d55jYY0.js.map +0 -1
  154. package/dist/mscgen-DdqZYINH.js +0 -136
  155. package/dist/mscgen-DdqZYINH.js.map +0 -1
  156. package/dist/mumps-Btr8VblO.js +0 -94
  157. package/dist/mumps-Btr8VblO.js.map +0 -1
  158. package/dist/nginx-DTDtBDVN.js +0 -142
  159. package/dist/nginx-DTDtBDVN.js.map +0 -1
  160. package/dist/nsis-3zG7tgur.js +0 -63
  161. package/dist/nsis-3zG7tgur.js.map +0 -1
  162. package/dist/ntriples-CvgOYMpL.js +0 -154
  163. package/dist/ntriples-CvgOYMpL.js.map +0 -1
  164. package/dist/octave-DYBj3-tl.js +0 -201
  165. package/dist/octave-DYBj3-tl.js.map +0 -1
  166. package/dist/oz-R_e8WMIi.js +0 -232
  167. package/dist/oz-R_e8WMIi.js.map +0 -1
  168. package/dist/parse-CAqQaKsh.js +0 -21685
  169. package/dist/parse-CAqQaKsh.js.map +0 -1
  170. package/dist/pascal-GD8iposT.js +0 -106
  171. package/dist/pascal-GD8iposT.js.map +0 -1
  172. package/dist/perl-DL9mHpoi.js +0 -1106
  173. package/dist/perl-DL9mHpoi.js.map +0 -1
  174. package/dist/pig-C_4T4YIV.js +0 -102
  175. package/dist/pig-C_4T4YIV.js.map +0 -1
  176. package/dist/powershell-B0suO7Vd.js +0 -329
  177. package/dist/powershell-B0suO7Vd.js.map +0 -1
  178. package/dist/properties-BR-vP1aU.js +0 -59
  179. package/dist/properties-BR-vP1aU.js.map +0 -1
  180. package/dist/protobuf-BxgpyhoW.js +0 -78
  181. package/dist/protobuf-BxgpyhoW.js.map +0 -1
  182. package/dist/pug-vHnWR0UE.js +0 -406
  183. package/dist/pug-vHnWR0UE.js.map +0 -1
  184. package/dist/puppet-Bdao66PW.js +0 -138
  185. package/dist/puppet-Bdao66PW.js.map +0 -1
  186. package/dist/python-BFGRmuZ9.js +0 -427
  187. package/dist/python-BFGRmuZ9.js.map +0 -1
  188. package/dist/q-CrbCVq4a.js +0 -132
  189. package/dist/q-CrbCVq4a.js.map +0 -1
  190. package/dist/r-V7nswm59.js +0 -171
  191. package/dist/r-V7nswm59.js.map +0 -1
  192. package/dist/render-app-island-B-i8rvGi.js +0 -61
  193. package/dist/render-app-island-B-i8rvGi.js.map +0 -1
  194. package/dist/repl-sdk.js +0 -7
  195. package/dist/repl-sdk.js.map +0 -1
  196. package/dist/rpm-C-DLY-If.js +0 -110
  197. package/dist/rpm-C-DLY-If.js.map +0 -1
  198. package/dist/ruby-JDKLJNK0.js +0 -331
  199. package/dist/ruby-JDKLJNK0.js.map +0 -1
  200. package/dist/sas-D2UG-yhZ.js +0 -208
  201. package/dist/sas-D2UG-yhZ.js.map +0 -1
  202. package/dist/scheme-BKzrkGJD.js +0 -223
  203. package/dist/scheme-BKzrkGJD.js.map +0 -1
  204. package/dist/shell-BlsXDxCn.js +0 -223
  205. package/dist/shell-BlsXDxCn.js.map +0 -1
  206. package/dist/sieve-CjwBwOY5.js +0 -136
  207. package/dist/sieve-CjwBwOY5.js.map +0 -1
  208. package/dist/simple-mode-DMneyfDu.js +0 -131
  209. package/dist/simple-mode-DMneyfDu.js.map +0 -1
  210. package/dist/smalltalk-BOIGQuhN.js +0 -122
  211. package/dist/smalltalk-BOIGQuhN.js.map +0 -1
  212. package/dist/solr-CwD7U71z.js +0 -70
  213. package/dist/solr-CwD7U71z.js.map +0 -1
  214. package/dist/sparql-DYskk2vE.js +0 -250
  215. package/dist/sparql-DYskk2vE.js.map +0 -1
  216. package/dist/spreadsheet-Bgtt3oLP.js +0 -88
  217. package/dist/spreadsheet-Bgtt3oLP.js.map +0 -1
  218. package/dist/sql-Cei9CMfk.js +0 -343
  219. package/dist/sql-Cei9CMfk.js.map +0 -1
  220. package/dist/stex-C1nZSzAw.js +0 -231
  221. package/dist/stex-C1nZSzAw.js.map +0 -1
  222. package/dist/stylus-BkS-boTH.js +0 -566
  223. package/dist/stylus-BkS-boTH.js.map +0 -1
  224. package/dist/swift-FRZi1uvB.js +0 -292
  225. package/dist/swift-FRZi1uvB.js.map +0 -1
  226. package/dist/tcl-CUcaCdmq.js +0 -115
  227. package/dist/tcl-CUcaCdmq.js.map +0 -1
  228. package/dist/textile-BnFpjsrl.js +0 -415
  229. package/dist/textile-BnFpjsrl.js.map +0 -1
  230. package/dist/tiddlywiki-CjprD-Qp.js +0 -219
  231. package/dist/tiddlywiki-CjprD-Qp.js.map +0 -1
  232. package/dist/tiki-DK9DOeWn.js +0 -269
  233. package/dist/tiki-DK9DOeWn.js.map +0 -1
  234. package/dist/toml-BOuWGMcf.js +0 -77
  235. package/dist/toml-BOuWGMcf.js.map +0 -1
  236. package/dist/troff-E1bJ0PPL.js +0 -62
  237. package/dist/troff-E1bJ0PPL.js.map +0 -1
  238. package/dist/ttcn-cfg-Dc39-fIP.js +0 -134
  239. package/dist/ttcn-cfg-Dc39-fIP.js.map +0 -1
  240. package/dist/ttcn-tKd4HLu4.js +0 -193
  241. package/dist/ttcn-tKd4HLu4.js.map +0 -1
  242. package/dist/turtle-Dq7-1WAf.js +0 -125
  243. package/dist/turtle-Dq7-1WAf.js.map +0 -1
  244. package/dist/vb-Dp90gtsv.js +0 -197
  245. package/dist/vb-Dp90gtsv.js.map +0 -1
  246. package/dist/vbscript-Bfn8O8I7.js +0 -479
  247. package/dist/vbscript-Bfn8O8I7.js.map +0 -1
  248. package/dist/velocity-BwIZK1TH.js +0 -150
  249. package/dist/velocity-BwIZK1TH.js.map +0 -1
  250. package/dist/verilog-CnT9bMk0.js +0 -430
  251. package/dist/verilog-CnT9bMk0.js.map +0 -1
  252. package/dist/vhdl-DCkMIyT9.js +0 -159
  253. package/dist/vhdl-DCkMIyT9.js.map +0 -1
  254. package/dist/webidl-BTLTThCm.js +0 -205
  255. package/dist/webidl-BTLTThCm.js.map +0 -1
  256. package/dist/xquery-BrBUuxMR.js +0 -526
  257. package/dist/xquery-BrBUuxMR.js.map +0 -1
  258. package/dist/yacas-b5lAVEIl.js +0 -131
  259. package/dist/yacas-b5lAVEIl.js.map +0 -1
  260. package/dist/z80-ClgwfNdB.js +0 -93
  261. package/dist/z80-ClgwfNdB.js.map +0 -1
@@ -1,800 +0,0 @@
1
- function Context(indented, column, type, info, align, prev) {
2
- this.indented = indented;
3
- this.column = column;
4
- this.type = type;
5
- this.info = info;
6
- this.align = align;
7
- this.prev = prev;
8
- }
9
- function pushContext(state, col, type, info) {
10
- var indent = state.indented;
11
- if (state.context && state.context.type == "statement" && type != "statement")
12
- indent = state.context.indented;
13
- return state.context = new Context(indent, col, type, info, null, state.context);
14
- }
15
- function popContext(state) {
16
- var t = state.context.type;
17
- if (t == ")" || t == "]" || t == "}")
18
- state.indented = state.context.indented;
19
- return state.context = state.context.prev;
20
- }
21
- function typeBefore(stream, state, pos) {
22
- if (state.prevToken == "variable" || state.prevToken == "type") return true;
23
- if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true;
24
- if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true;
25
- }
26
- function isTopScope(context) {
27
- for (; ; ) {
28
- if (!context || context.type == "top") return true;
29
- if (context.type == "}" && context.prev.info != "namespace") return false;
30
- context = context.prev;
31
- }
32
- }
33
- function clike(parserConfig) {
34
- var statementIndentUnit = parserConfig.statementIndentUnit, dontAlignCalls = parserConfig.dontAlignCalls, keywords = parserConfig.keywords || {}, types = parserConfig.types || {}, builtin = parserConfig.builtin || {}, blockKeywords = parserConfig.blockKeywords || {}, defKeywords = parserConfig.defKeywords || {}, atoms = parserConfig.atoms || {}, hooks = parserConfig.hooks || {}, multiLineStrings = parserConfig.multiLineStrings, indentStatements = parserConfig.indentStatements !== false, indentSwitch = parserConfig.indentSwitch !== false, namespaceSeparator = parserConfig.namespaceSeparator, isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/, numberStart = parserConfig.numberStart || /[\d\.]/, number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i, isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/, isIdentifierChar = parserConfig.isIdentifierChar || /[\w\$_\xa1-\uffff]/, isReservedIdentifier = parserConfig.isReservedIdentifier || false;
35
- var curPunc, isDefKeyword;
36
- function tokenBase(stream, state) {
37
- var ch = stream.next();
38
- if (hooks[ch]) {
39
- var result = hooks[ch](stream, state);
40
- if (result !== false) return result;
41
- }
42
- if (ch == '"' || ch == "'") {
43
- state.tokenize = tokenString(ch);
44
- return state.tokenize(stream, state);
45
- }
46
- if (numberStart.test(ch)) {
47
- stream.backUp(1);
48
- if (stream.match(number)) return "number";
49
- stream.next();
50
- }
51
- if (isPunctuationChar.test(ch)) {
52
- curPunc = ch;
53
- return null;
54
- }
55
- if (ch == "/") {
56
- if (stream.eat("*")) {
57
- state.tokenize = tokenComment;
58
- return tokenComment(stream, state);
59
- }
60
- if (stream.eat("/")) {
61
- stream.skipToEnd();
62
- return "comment";
63
- }
64
- }
65
- if (isOperatorChar.test(ch)) {
66
- while (!stream.match(/^\/[\/*]/, false) && stream.eat(isOperatorChar)) {
67
- }
68
- return "operator";
69
- }
70
- stream.eatWhile(isIdentifierChar);
71
- if (namespaceSeparator) while (stream.match(namespaceSeparator))
72
- stream.eatWhile(isIdentifierChar);
73
- var cur = stream.current();
74
- if (contains(keywords, cur)) {
75
- if (contains(blockKeywords, cur)) curPunc = "newstatement";
76
- if (contains(defKeywords, cur)) isDefKeyword = true;
77
- return "keyword";
78
- }
79
- if (contains(types, cur)) return "type";
80
- if (contains(builtin, cur) || isReservedIdentifier && isReservedIdentifier(cur)) {
81
- if (contains(blockKeywords, cur)) curPunc = "newstatement";
82
- return "builtin";
83
- }
84
- if (contains(atoms, cur)) return "atom";
85
- return "variable";
86
- }
87
- function tokenString(quote) {
88
- return function(stream, state) {
89
- var escaped = false, next, end = false;
90
- while ((next = stream.next()) != null) {
91
- if (next == quote && !escaped) {
92
- end = true;
93
- break;
94
- }
95
- escaped = !escaped && next == "\\";
96
- }
97
- if (end || !(escaped || multiLineStrings))
98
- state.tokenize = null;
99
- return "string";
100
- };
101
- }
102
- function tokenComment(stream, state) {
103
- var maybeEnd = false, ch;
104
- while (ch = stream.next()) {
105
- if (ch == "/" && maybeEnd) {
106
- state.tokenize = null;
107
- break;
108
- }
109
- maybeEnd = ch == "*";
110
- }
111
- return "comment";
112
- }
113
- function maybeEOL(stream, state) {
114
- if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context))
115
- state.typeAtEndOfLine = typeBefore(stream, state, stream.pos);
116
- }
117
- return {
118
- name: parserConfig.name,
119
- startState: function(indentUnit) {
120
- return {
121
- tokenize: null,
122
- context: new Context(-indentUnit, 0, "top", null, false),
123
- indented: 0,
124
- startOfLine: true,
125
- prevToken: null
126
- };
127
- },
128
- token: function(stream, state) {
129
- var ctx = state.context;
130
- if (stream.sol()) {
131
- if (ctx.align == null) ctx.align = false;
132
- state.indented = stream.indentation();
133
- state.startOfLine = true;
134
- }
135
- if (stream.eatSpace()) {
136
- maybeEOL(stream, state);
137
- return null;
138
- }
139
- curPunc = isDefKeyword = null;
140
- var style = (state.tokenize || tokenBase)(stream, state);
141
- if (style == "comment" || style == "meta") return style;
142
- if (ctx.align == null) ctx.align = true;
143
- if (curPunc == ";" || curPunc == ":" || curPunc == "," && stream.match(/^\s*(?:\/\/.*)?$/, false))
144
- while (state.context.type == "statement") popContext(state);
145
- else if (curPunc == "{") pushContext(state, stream.column(), "}");
146
- else if (curPunc == "[") pushContext(state, stream.column(), "]");
147
- else if (curPunc == "(") pushContext(state, stream.column(), ")");
148
- else if (curPunc == "}") {
149
- while (ctx.type == "statement") ctx = popContext(state);
150
- if (ctx.type == "}") ctx = popContext(state);
151
- while (ctx.type == "statement") ctx = popContext(state);
152
- } else if (curPunc == ctx.type) popContext(state);
153
- else if (indentStatements && ((ctx.type == "}" || ctx.type == "top") && curPunc != ";" || ctx.type == "statement" && curPunc == "newstatement")) {
154
- pushContext(state, stream.column(), "statement", stream.current());
155
- }
156
- if (style == "variable" && (state.prevToken == "def" || parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) && isTopScope(state.context) && stream.match(/^\s*\(/, false)))
157
- style = "def";
158
- if (hooks.token) {
159
- var result = hooks.token(stream, state, style);
160
- if (result !== void 0) style = result;
161
- }
162
- if (style == "def" && parserConfig.styleDefs === false) style = "variable";
163
- state.startOfLine = false;
164
- state.prevToken = isDefKeyword ? "def" : style || curPunc;
165
- maybeEOL(stream, state);
166
- return style;
167
- },
168
- indent: function(state, textAfter, context) {
169
- if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine && isTopScope(state.context))
170
- return null;
171
- var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
172
- var closing = firstChar == ctx.type;
173
- if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
174
- if (parserConfig.dontIndentStatements)
175
- while (ctx.type == "statement" && parserConfig.dontIndentStatements.test(ctx.info))
176
- ctx = ctx.prev;
177
- if (hooks.indent) {
178
- var hook = hooks.indent(state, ctx, textAfter, context.unit);
179
- if (typeof hook == "number") return hook;
180
- }
181
- var switchBlock = ctx.prev && ctx.prev.info == "switch";
182
- if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
183
- while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev;
184
- return ctx.indented;
185
- }
186
- if (ctx.type == "statement")
187
- return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit || context.unit);
188
- if (ctx.align && (!dontAlignCalls || ctx.type != ")"))
189
- return ctx.column + (closing ? 0 : 1);
190
- if (ctx.type == ")" && !closing)
191
- return ctx.indented + (statementIndentUnit || context.unit);
192
- return ctx.indented + (closing ? 0 : context.unit) + (!closing && switchBlock && !/^(?:case|default)\b/.test(textAfter) ? context.unit : 0);
193
- },
194
- languageData: {
195
- indentOnInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{\}?|\})$/ : /^\s*[{}]$/,
196
- commentTokens: { line: "//", block: { open: "/*", close: "*/" } },
197
- autocomplete: Object.keys(keywords).concat(Object.keys(types)).concat(Object.keys(builtin)).concat(Object.keys(atoms)),
198
- ...parserConfig.languageData
199
- }
200
- };
201
- }
202
- function words(str) {
203
- var obj = {}, words2 = str.split(" ");
204
- for (var i = 0; i < words2.length; ++i) obj[words2[i]] = true;
205
- return obj;
206
- }
207
- function contains(words2, word) {
208
- if (typeof words2 === "function") {
209
- return words2(word);
210
- } else {
211
- return words2.propertyIsEnumerable(word);
212
- }
213
- }
214
- var cKeywords = "auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran";
215
- var cppKeywords = "alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq";
216
- var objCKeywords = "bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available";
217
- var objCBuiltins = "FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT";
218
- var basicCTypes = words("int long char short double float unsigned signed void bool");
219
- var basicObjCTypes = words("SEL instancetype id Class Protocol BOOL");
220
- function cTypes(identifier) {
221
- return contains(basicCTypes, identifier) || /.+_t$/.test(identifier);
222
- }
223
- function objCTypes(identifier) {
224
- return cTypes(identifier) || contains(basicObjCTypes, identifier);
225
- }
226
- var cBlockKeywords = "case do else for if switch while struct enum union";
227
- var cDefKeywords = "struct enum union";
228
- function cppHook(stream, state) {
229
- if (!state.startOfLine) return false;
230
- for (var ch, next = null; ch = stream.peek(); ) {
231
- if (ch == "\\" && stream.match(/^.$/)) {
232
- next = cppHook;
233
- break;
234
- } else if (ch == "/" && stream.match(/^\/[\/\*]/, false)) {
235
- break;
236
- }
237
- stream.next();
238
- }
239
- state.tokenize = next;
240
- return "meta";
241
- }
242
- function pointerHook(_stream, state) {
243
- if (state.prevToken == "type") return "type";
244
- return false;
245
- }
246
- function cIsReservedIdentifier(token) {
247
- if (!token || token.length < 2) return false;
248
- if (token[0] != "_") return false;
249
- return token[1] == "_" || token[1] !== token[1].toLowerCase();
250
- }
251
- function cpp14Literal(stream) {
252
- stream.eatWhile(/[\w\.']/);
253
- return "number";
254
- }
255
- function cpp11StringHook(stream, state) {
256
- stream.backUp(1);
257
- if (stream.match(/^(?:R|u8R|uR|UR|LR)/)) {
258
- var match = stream.match(/^"([^\s\\()]{0,16})\(/);
259
- if (!match) {
260
- return false;
261
- }
262
- state.cpp11RawStringDelim = match[1];
263
- state.tokenize = tokenRawString;
264
- return tokenRawString(stream, state);
265
- }
266
- if (stream.match(/^(?:u8|u|U|L)/)) {
267
- if (stream.match(
268
- /^["']/,
269
- /* eat */
270
- false
271
- )) {
272
- return "string";
273
- }
274
- return false;
275
- }
276
- stream.next();
277
- return false;
278
- }
279
- function cppLooksLikeConstructor(word) {
280
- var lastTwo = /(\w+)::~?(\w+)$/.exec(word);
281
- return lastTwo && lastTwo[1] == lastTwo[2];
282
- }
283
- function tokenAtString(stream, state) {
284
- var next;
285
- while ((next = stream.next()) != null) {
286
- if (next == '"' && !stream.eat('"')) {
287
- state.tokenize = null;
288
- break;
289
- }
290
- }
291
- return "string";
292
- }
293
- function tokenRawString(stream, state) {
294
- var delim = state.cpp11RawStringDelim.replace(/[^\w\s]/g, "\\$&");
295
- var match = stream.match(new RegExp(".*?\\)" + delim + '"'));
296
- if (match)
297
- state.tokenize = null;
298
- else
299
- stream.skipToEnd();
300
- return "string";
301
- }
302
- clike({
303
- name: "c",
304
- keywords: words(cKeywords),
305
- types: cTypes,
306
- blockKeywords: words(cBlockKeywords),
307
- defKeywords: words(cDefKeywords),
308
- typeFirstDefinitions: true,
309
- atoms: words("NULL true false"),
310
- isReservedIdentifier: cIsReservedIdentifier,
311
- hooks: {
312
- "#": cppHook,
313
- "*": pointerHook
314
- }
315
- });
316
- clike({
317
- name: "cpp",
318
- keywords: words(cKeywords + " " + cppKeywords),
319
- types: cTypes,
320
- blockKeywords: words(cBlockKeywords + " class try catch"),
321
- defKeywords: words(cDefKeywords + " class namespace"),
322
- typeFirstDefinitions: true,
323
- atoms: words("true false NULL nullptr"),
324
- dontIndentStatements: /^template$/,
325
- isIdentifierChar: /[\w\$_~\xa1-\uffff]/,
326
- isReservedIdentifier: cIsReservedIdentifier,
327
- hooks: {
328
- "#": cppHook,
329
- "*": pointerHook,
330
- "u": cpp11StringHook,
331
- "U": cpp11StringHook,
332
- "L": cpp11StringHook,
333
- "R": cpp11StringHook,
334
- "0": cpp14Literal,
335
- "1": cpp14Literal,
336
- "2": cpp14Literal,
337
- "3": cpp14Literal,
338
- "4": cpp14Literal,
339
- "5": cpp14Literal,
340
- "6": cpp14Literal,
341
- "7": cpp14Literal,
342
- "8": cpp14Literal,
343
- "9": cpp14Literal,
344
- token: function(stream, state, style) {
345
- if (style == "variable" && stream.peek() == "(" && (state.prevToken == ";" || state.prevToken == null || state.prevToken == "}") && cppLooksLikeConstructor(stream.current()))
346
- return "def";
347
- }
348
- },
349
- namespaceSeparator: "::"
350
- });
351
- clike({
352
- name: "java",
353
- keywords: words("abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),
354
- types: words("var byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),
355
- blockKeywords: words("catch class do else finally for if switch try while"),
356
- defKeywords: words("class interface enum @interface"),
357
- typeFirstDefinitions: true,
358
- atoms: words("true false null"),
359
- number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,
360
- hooks: {
361
- "@": function(stream) {
362
- if (stream.match("interface", false)) return false;
363
- stream.eatWhile(/[\w\$_]/);
364
- return "meta";
365
- },
366
- '"': function(stream, state) {
367
- if (!stream.match(/""$/)) return false;
368
- state.tokenize = tokenTripleString;
369
- return state.tokenize(stream, state);
370
- }
371
- }
372
- });
373
- const csharp = clike({
374
- name: "csharp",
375
- keywords: words("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in init interface internal is lock namespace new operator out override params private protected public readonly record ref required return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),
376
- types: words("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),
377
- blockKeywords: words("catch class do else finally for foreach if struct switch try while"),
378
- defKeywords: words("class interface namespace record struct var"),
379
- typeFirstDefinitions: true,
380
- atoms: words("true false null"),
381
- hooks: {
382
- "@": function(stream, state) {
383
- if (stream.eat('"')) {
384
- state.tokenize = tokenAtString;
385
- return tokenAtString(stream, state);
386
- }
387
- stream.eatWhile(/[\w\$_]/);
388
- return "meta";
389
- }
390
- }
391
- });
392
- function tokenTripleString(stream, state) {
393
- var escaped = false;
394
- while (!stream.eol()) {
395
- if (!escaped && stream.match('"""')) {
396
- state.tokenize = null;
397
- break;
398
- }
399
- escaped = stream.next() == "\\" && !escaped;
400
- }
401
- return "string";
402
- }
403
- function tokenNestedComment(depth) {
404
- return function(stream, state) {
405
- var ch;
406
- while (ch = stream.next()) {
407
- if (ch == "*" && stream.eat("/")) {
408
- if (depth == 1) {
409
- state.tokenize = null;
410
- break;
411
- } else {
412
- state.tokenize = tokenNestedComment(depth - 1);
413
- return state.tokenize(stream, state);
414
- }
415
- } else if (ch == "/" && stream.eat("*")) {
416
- state.tokenize = tokenNestedComment(depth + 1);
417
- return state.tokenize(stream, state);
418
- }
419
- }
420
- return "comment";
421
- };
422
- }
423
- const scala = clike({
424
- name: "scala",
425
- keywords: words(
426
- /* scala */
427
- "abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"
428
- ),
429
- types: words(
430
- "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
431
- ),
432
- multiLineStrings: true,
433
- blockKeywords: words("catch class enum do else finally for forSome if match switch try while"),
434
- defKeywords: words("class enum def object package trait type val var"),
435
- atoms: words("true false null"),
436
- indentStatements: false,
437
- indentSwitch: false,
438
- isOperatorChar: /[+\-*&%=<>!?|\/#:@]/,
439
- hooks: {
440
- "@": function(stream) {
441
- stream.eatWhile(/[\w\$_]/);
442
- return "meta";
443
- },
444
- '"': function(stream, state) {
445
- if (!stream.match('""')) return false;
446
- state.tokenize = tokenTripleString;
447
- return state.tokenize(stream, state);
448
- },
449
- "'": function(stream) {
450
- if (stream.match(/^(\\[^'\s]+|[^\\'])'/)) return "character";
451
- stream.eatWhile(/[\w\$_\xa1-\uffff]/);
452
- return "atom";
453
- },
454
- "=": function(stream, state) {
455
- var cx = state.context;
456
- if (cx.type == "}" && cx.align && stream.eat(">")) {
457
- state.context = new Context(cx.indented, cx.column, cx.type, cx.info, null, cx.prev);
458
- return "operator";
459
- } else {
460
- return false;
461
- }
462
- },
463
- "/": function(stream, state) {
464
- if (!stream.eat("*")) return false;
465
- state.tokenize = tokenNestedComment(1);
466
- return state.tokenize(stream, state);
467
- }
468
- },
469
- languageData: {
470
- closeBrackets: { brackets: ["(", "[", "{", "'", '"', '"""'] }
471
- }
472
- });
473
- function tokenKotlinString(tripleString) {
474
- return function(stream, state) {
475
- var escaped = false, next, end = false;
476
- while (!stream.eol()) {
477
- if (!tripleString && !escaped && stream.match('"')) {
478
- end = true;
479
- break;
480
- }
481
- if (tripleString && stream.match('"""')) {
482
- end = true;
483
- break;
484
- }
485
- next = stream.next();
486
- if (!escaped && next == "$" && stream.match("{"))
487
- stream.skipTo("}");
488
- escaped = !escaped && next == "\\" && !tripleString;
489
- }
490
- if (end || !tripleString)
491
- state.tokenize = null;
492
- return "string";
493
- };
494
- }
495
- const kotlin = clike({
496
- name: "kotlin",
497
- keywords: words(
498
- /*keywords*/
499
- "package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam"
500
- ),
501
- types: words(
502
- /* package java.lang */
503
- "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"
504
- ),
505
- indentStatements: false,
506
- multiLineStrings: true,
507
- number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(ul?|l|f)?/i,
508
- blockKeywords: words("catch class do else finally for if where try while enum"),
509
- defKeywords: words("class val var object interface fun"),
510
- atoms: words("true false null this"),
511
- hooks: {
512
- "@": function(stream) {
513
- stream.eatWhile(/[\w\$_]/);
514
- return "meta";
515
- },
516
- "*": function(_stream, state) {
517
- return state.prevToken == "." ? "variable" : "operator";
518
- },
519
- '"': function(stream, state) {
520
- state.tokenize = tokenKotlinString(stream.match('""'));
521
- return state.tokenize(stream, state);
522
- },
523
- "/": function(stream, state) {
524
- if (!stream.eat("*")) return false;
525
- state.tokenize = tokenNestedComment(1);
526
- return state.tokenize(stream, state);
527
- },
528
- indent: function(state, ctx, textAfter, indentUnit) {
529
- var firstChar = textAfter && textAfter.charAt(0);
530
- if ((state.prevToken == "}" || state.prevToken == ")") && textAfter == "")
531
- return state.indented;
532
- if (state.prevToken == "operator" && textAfter != "}" && state.context.type != "}" || state.prevToken == "variable" && firstChar == "." || (state.prevToken == "}" || state.prevToken == ")") && firstChar == ".")
533
- return indentUnit * 2 + ctx.indented;
534
- if (ctx.align && ctx.type == "}")
535
- return ctx.indented + (state.context.type == (textAfter || "").charAt(0) ? 0 : indentUnit);
536
- }
537
- },
538
- languageData: {
539
- closeBrackets: { brackets: ["(", "[", "{", "'", '"', '"""'] }
540
- }
541
- });
542
- clike({
543
- name: "shader",
544
- keywords: words("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),
545
- types: words("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),
546
- blockKeywords: words("for while do if else struct"),
547
- builtin: words("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),
548
- atoms: words("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),
549
- indentSwitch: false,
550
- hooks: { "#": cppHook }
551
- });
552
- clike({
553
- name: "nesc",
554
- keywords: words(cKeywords + " as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),
555
- types: cTypes,
556
- blockKeywords: words(cBlockKeywords),
557
- atoms: words("null true false"),
558
- hooks: { "#": cppHook }
559
- });
560
- const objectiveC = clike({
561
- name: "objectivec",
562
- keywords: words(cKeywords + " " + objCKeywords),
563
- types: objCTypes,
564
- builtin: words(objCBuiltins),
565
- blockKeywords: words(cBlockKeywords + " @synthesize @try @catch @finally @autoreleasepool @synchronized"),
566
- defKeywords: words(cDefKeywords + " @interface @implementation @protocol @class"),
567
- dontIndentStatements: /^@.*$/,
568
- typeFirstDefinitions: true,
569
- atoms: words("YES NO NULL Nil nil true false nullptr"),
570
- isReservedIdentifier: cIsReservedIdentifier,
571
- hooks: {
572
- "#": cppHook,
573
- "*": pointerHook
574
- }
575
- });
576
- const objectiveCpp = clike({
577
- name: "objectivecpp",
578
- keywords: words(cKeywords + " " + objCKeywords + " " + cppKeywords),
579
- types: objCTypes,
580
- builtin: words(objCBuiltins),
581
- blockKeywords: words(cBlockKeywords + " @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),
582
- defKeywords: words(cDefKeywords + " @interface @implementation @protocol @class class namespace"),
583
- dontIndentStatements: /^@.*$|^template$/,
584
- typeFirstDefinitions: true,
585
- atoms: words("YES NO NULL Nil nil true false nullptr"),
586
- isReservedIdentifier: cIsReservedIdentifier,
587
- hooks: {
588
- "#": cppHook,
589
- "*": pointerHook,
590
- "u": cpp11StringHook,
591
- "U": cpp11StringHook,
592
- "L": cpp11StringHook,
593
- "R": cpp11StringHook,
594
- "0": cpp14Literal,
595
- "1": cpp14Literal,
596
- "2": cpp14Literal,
597
- "3": cpp14Literal,
598
- "4": cpp14Literal,
599
- "5": cpp14Literal,
600
- "6": cpp14Literal,
601
- "7": cpp14Literal,
602
- "8": cpp14Literal,
603
- "9": cpp14Literal,
604
- token: function(stream, state, style) {
605
- if (style == "variable" && stream.peek() == "(" && (state.prevToken == ";" || state.prevToken == null || state.prevToken == "}") && cppLooksLikeConstructor(stream.current()))
606
- return "def";
607
- }
608
- },
609
- namespaceSeparator: "::"
610
- });
611
- const squirrel = clike({
612
- name: "squirrel",
613
- keywords: words("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),
614
- types: cTypes,
615
- blockKeywords: words("case catch class else for foreach if switch try while"),
616
- defKeywords: words("function local class"),
617
- typeFirstDefinitions: true,
618
- atoms: words("true false null"),
619
- hooks: { "#": cppHook }
620
- });
621
- var stringTokenizer = null;
622
- function tokenCeylonString(type) {
623
- return function(stream, state) {
624
- var escaped = false, next, end = false;
625
- while (!stream.eol()) {
626
- if (!escaped && stream.match('"') && (type == "single" || stream.match('""'))) {
627
- end = true;
628
- break;
629
- }
630
- if (!escaped && stream.match("``")) {
631
- stringTokenizer = tokenCeylonString(type);
632
- end = true;
633
- break;
634
- }
635
- next = stream.next();
636
- escaped = type == "single" && !escaped && next == "\\";
637
- }
638
- if (end)
639
- state.tokenize = null;
640
- return "string";
641
- };
642
- }
643
- clike({
644
- name: "ceylon",
645
- keywords: words("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),
646
- types: function(word) {
647
- var first = word.charAt(0);
648
- return first === first.toUpperCase() && first !== first.toLowerCase();
649
- },
650
- blockKeywords: words("case catch class dynamic else finally for function if interface module new object switch try while"),
651
- defKeywords: words("class dynamic function interface module object package value"),
652
- builtin: words("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),
653
- isPunctuationChar: /[\[\]{}\(\),;\:\.`]/,
654
- isOperatorChar: /[+\-*&%=<>!?|^~:\/]/,
655
- numberStart: /[\d#$]/,
656
- number: /^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,
657
- multiLineStrings: true,
658
- typeFirstDefinitions: true,
659
- atoms: words("true false null larger smaller equal empty finished"),
660
- indentSwitch: false,
661
- styleDefs: false,
662
- hooks: {
663
- "@": function(stream) {
664
- stream.eatWhile(/[\w\$_]/);
665
- return "meta";
666
- },
667
- '"': function(stream, state) {
668
- state.tokenize = tokenCeylonString(stream.match('""') ? "triple" : "single");
669
- return state.tokenize(stream, state);
670
- },
671
- "`": function(stream, state) {
672
- if (!stringTokenizer || !stream.match("`")) return false;
673
- state.tokenize = stringTokenizer;
674
- stringTokenizer = null;
675
- return state.tokenize(stream, state);
676
- },
677
- "'": function(stream) {
678
- if (stream.match(/^(\\[^'\s]+|[^\\'])'/)) return "string.special";
679
- stream.eatWhile(/[\w\$_\xa1-\uffff]/);
680
- return "atom";
681
- },
682
- token: function(_stream, state, style) {
683
- if ((style == "variable" || style == "type") && state.prevToken == ".") {
684
- return "variableName.special";
685
- }
686
- }
687
- },
688
- languageData: {
689
- closeBrackets: { brackets: ["(", "[", "{", "'", '"', '"""'] }
690
- }
691
- });
692
- function pushInterpolationStack(state) {
693
- (state.interpolationStack || (state.interpolationStack = [])).push(state.tokenize);
694
- }
695
- function popInterpolationStack(state) {
696
- return (state.interpolationStack || (state.interpolationStack = [])).pop();
697
- }
698
- function sizeInterpolationStack(state) {
699
- return state.interpolationStack ? state.interpolationStack.length : 0;
700
- }
701
- function tokenDartString(quote, stream, state, raw) {
702
- var tripleQuoted = false;
703
- if (stream.eat(quote)) {
704
- if (stream.eat(quote)) tripleQuoted = true;
705
- else return "string";
706
- }
707
- function tokenStringHelper(stream2, state2) {
708
- var escaped = false;
709
- while (!stream2.eol()) {
710
- if (!raw && !escaped && stream2.peek() == "$") {
711
- pushInterpolationStack(state2);
712
- state2.tokenize = tokenInterpolation;
713
- return "string";
714
- }
715
- var next = stream2.next();
716
- if (next == quote && !escaped && (!tripleQuoted || stream2.match(quote + quote))) {
717
- state2.tokenize = null;
718
- break;
719
- }
720
- escaped = !raw && !escaped && next == "\\";
721
- }
722
- return "string";
723
- }
724
- state.tokenize = tokenStringHelper;
725
- return tokenStringHelper(stream, state);
726
- }
727
- function tokenInterpolation(stream, state) {
728
- stream.eat("$");
729
- if (stream.eat("{")) {
730
- state.tokenize = null;
731
- } else {
732
- state.tokenize = tokenInterpolationIdentifier;
733
- }
734
- return null;
735
- }
736
- function tokenInterpolationIdentifier(stream, state) {
737
- stream.eatWhile(/[\w_]/);
738
- state.tokenize = popInterpolationStack(state);
739
- return "variable";
740
- }
741
- const dart = clike({
742
- name: "dart",
743
- keywords: words("this super static final const abstract class extends external factory implements mixin get native set typedef with enum throw rethrow assert break case continue default in return new deferred async await covariant try catch finally do else for if switch while import library export part of show hide is as extension on yield late required sealed base interface when inline"),
744
- blockKeywords: words("try catch finally do else for if switch while"),
745
- builtin: words("void bool num int double dynamic var String Null Never"),
746
- atoms: words("true false null"),
747
- // clike numbers without the suffixes, and with '_' separators.
748
- number: /^(?:0x[a-f\d_]+|(?:[\d_]+\.?[\d_]*|\.[\d_]+)(?:e[-+]?[\d_]+)?)/i,
749
- hooks: {
750
- "@": function(stream) {
751
- stream.eatWhile(/[\w\$_\.]/);
752
- return "meta";
753
- },
754
- // custom string handling to deal with triple-quoted strings and string interpolation
755
- "'": function(stream, state) {
756
- return tokenDartString("'", stream, state, false);
757
- },
758
- '"': function(stream, state) {
759
- return tokenDartString('"', stream, state, false);
760
- },
761
- "r": function(stream, state) {
762
- var peek = stream.peek();
763
- if (peek == "'" || peek == '"') {
764
- return tokenDartString(stream.next(), stream, state, true);
765
- }
766
- return false;
767
- },
768
- "}": function(_stream, state) {
769
- if (sizeInterpolationStack(state) > 0) {
770
- state.tokenize = popInterpolationStack(state);
771
- return null;
772
- }
773
- return false;
774
- },
775
- "/": function(stream, state) {
776
- if (!stream.eat("*")) return false;
777
- state.tokenize = tokenNestedComment(1);
778
- return state.tokenize(stream, state);
779
- },
780
- token: function(stream, _, style) {
781
- if (style == "variable") {
782
- var isUpper = RegExp("^[_$]*[A-Z][a-zA-Z0-9_$]*$", "g");
783
- if (isUpper.test(stream.current())) {
784
- return "type";
785
- }
786
- }
787
- }
788
- }
789
- });
790
- export {
791
- clike,
792
- csharp,
793
- dart,
794
- kotlin,
795
- objectiveC,
796
- objectiveCpp,
797
- scala,
798
- squirrel
799
- };
800
- //# sourceMappingURL=clike-CTYGlS6x.js.map