@checkly/playwright-core 1.48.21 → 1.48.22-beta.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.
Files changed (185) hide show
  1. package/lib/cli/cli.js +61 -0
  2. package/lib/common/debugLogger.js +90 -0
  3. package/lib/generated/clockSource.js +2 -1
  4. package/lib/generated/consoleApiSource.js +2 -1
  5. package/lib/generated/injectedScriptSource.js +2 -1
  6. package/lib/generated/pollingRecorderSource.js +2 -1
  7. package/lib/generated/recorderSource.js +1 -1
  8. package/lib/generated/utilityScriptSource.js +2 -1
  9. package/lib/generated/webSocketMockSource.js +2 -1
  10. package/lib/server/recorder/java.js +4 -36
  11. package/lib/server/trace/recorder/tracing.js +22 -17
  12. package/lib/vite/{traceViewer/assets/codeMirrorModule-U6XMqGkV.js → recorder/assets/codeMirrorModule--bQcPrZ2.js} +2 -2
  13. package/lib/vite/recorder/assets/codeMirrorModule-Cy8X9Wtw.css +344 -0
  14. package/lib/vite/recorder/assets/index-BMeslH8X.js +9946 -0
  15. package/lib/vite/recorder/assets/index-BjXmTggo.css +2515 -0
  16. package/lib/vite/recorder/index.html +2 -2
  17. package/lib/vite/traceViewer/assets/codeMirrorModule-75b0ca4f.js +24 -0
  18. package/lib/vite/traceViewer/assets/codeMirrorModule-CBokkFJ2.js +16431 -0
  19. package/lib/vite/traceViewer/assets/codeMirrorModule-CNHvVrFd.js +16437 -0
  20. package/lib/vite/traceViewer/assets/{codeMirrorModule-BdBhzV6t.js → codeMirrorModule-CpGx_S8D.js} +2 -2
  21. package/lib/vite/traceViewer/assets/codeMirrorModule-SomGa-Da.js +16443 -0
  22. package/lib/vite/traceViewer/assets/codeMirrorModule-c1454a2e.js +24 -0
  23. package/lib/vite/traceViewer/assets/codeMirrorModule-c9bb9834.js +24 -0
  24. package/lib/vite/traceViewer/assets/{codeMirrorModule-Dx6AXgMV.js → codeMirrorModule-cc2329e4.js} +11 -1256
  25. package/lib/vite/traceViewer/assets/codeMirrorModule-d2cc7db0.js +15579 -0
  26. package/lib/vite/traceViewer/assets/codeMirrorModule-da915a35.js +15586 -0
  27. package/lib/vite/traceViewer/assets/{codeMirrorModule-CcviAl53.js → codeMirrorModule-f03b1a3e.js} +1118 -2370
  28. package/lib/vite/traceViewer/assets/codeMirrorModule-f333a775.js +24 -0
  29. package/lib/vite/traceViewer/assets/{codeMirrorModule-V7N6ppkd.js → codeMirrorModule-uWDlVSQz.js} +2 -2
  30. package/lib/vite/{recorder/assets/codeMirrorModule-d0KhC1qL.js → traceViewer/assets/codeMirrorModule-xvopPhZ4.js} +1 -1
  31. package/lib/vite/traceViewer/assets/{codeMirrorModule-BqcXH1AO.js → codeMirrorModule-yboVpgC0.js} +2 -1248
  32. package/lib/vite/traceViewer/assets/{inspectorTab-DpvLVMq5.js → inspectorTab-B4ynvyY9.js} +18 -8
  33. package/lib/vite/traceViewer/assets/{inspectorTab-BPzVEZSf.js → inspectorTab-BqBvUFio.js} +18 -8
  34. package/lib/vite/traceViewer/assets/{workbench-Bjkiwcr1.js → inspectorTab-Dw0Gnh1T.js} +1847 -3605
  35. package/lib/vite/traceViewer/assets/{inspectorTab-BABZNwlH.js → inspectorTab-Ywa000c9.js} +16 -6
  36. package/lib/vite/traceViewer/assets/{inspectorTab-BHcfR9dD.js → inspectorTab-wfvwpMHs.js} +2 -2
  37. package/lib/vite/traceViewer/assets/{workbench-BcgGQnKb.js → workbench-CROk6Fcc.js} +2 -2
  38. package/lib/vite/traceViewer/assets/{workbench-ByyWxoT8.js → workbench-CfXOj3eT.js} +2 -2
  39. package/lib/vite/traceViewer/assets/{workbench-DhqI6jeL.js → workbench-D9CTkv-4.js} +2 -2
  40. package/lib/vite/traceViewer/assets/{workbench-I4s6sWjN.js → workbench-DNolpp3y.js} +1 -1
  41. package/lib/vite/traceViewer/assets/workbench-DUc2iD0P.js +1473 -0
  42. package/lib/vite/traceViewer/assets/{workbench-B13nfocr.js → workbench-LKskf2Iy.js} +1 -1
  43. package/lib/vite/traceViewer/assets/workbench-dnZM5a7x.js +1473 -0
  44. package/lib/vite/traceViewer/assets/wsPort-54626118.js +18361 -0
  45. package/lib/vite/traceViewer/assets/{workbench-Crj6jzdv.js → wsPort-57f274c6.js} +4308 -5066
  46. package/lib/vite/traceViewer/assets/wsPort-762c6840.js +64 -0
  47. package/lib/vite/traceViewer/assets/wsPort-85286e61.js +18361 -0
  48. package/lib/vite/traceViewer/assets/wsPort-98e00a94.js +64 -0
  49. package/lib/vite/traceViewer/assets/{wsPort-EUvw-dwH.js → wsPort-CAXygIGt.js} +3 -3
  50. package/lib/vite/traceViewer/assets/{workbench-C5OQh9VX.js → wsPort-cc0077b5.js} +4046 -4623
  51. package/lib/vite/traceViewer/assets/wsPort-edfeeb7d.js +64 -0
  52. package/lib/vite/traceViewer/assets/wsPort-ee2830d7.js +64 -0
  53. package/lib/vite/traceViewer/assets/{workbench-BwodYCgl.js → wsPort-peeLnQhT.js} +985 -1540
  54. package/lib/vite/traceViewer/assets/xtermModule-443332e6.js +9 -0
  55. package/lib/vite/traceViewer/assets/xtermModule-60687b6b.js +6410 -0
  56. package/lib/vite/traceViewer/codeMirrorModule.5d0f417c.css +1 -0
  57. package/lib/vite/traceViewer/codeMirrorModule.eb494ea9.css +344 -0
  58. package/lib/vite/traceViewer/codicon.79f233d0.ttf +0 -0
  59. package/lib/vite/traceViewer/{embedded.27BGR_eD.js → embedded.6N1v7bZ1.js} +4 -3
  60. package/lib/vite/traceViewer/{embedded.DTjd2aiy.js → embedded.BOw0jX78.js} +4 -3
  61. package/lib/vite/traceViewer/{embedded.Dxe2heQk.js → embedded.BXYl5zRv.js} +1 -1
  62. package/lib/vite/traceViewer/{embedded.SsjKHrxC.js → embedded.BaqdbLsy.js} +4 -3
  63. package/lib/vite/traceViewer/embedded.CwwTDBzP.js +106 -0
  64. package/lib/vite/traceViewer/{embedded.Zu332ZC1.js → embedded.DeCrOtlO.js} +2 -2
  65. package/lib/vite/traceViewer/embedded.html +6 -6
  66. package/lib/vite/traceViewer/embedded.i_k4ceMJ.js +106 -0
  67. package/lib/vite/traceViewer/index.1a1fe659.css +1 -0
  68. package/lib/vite/traceViewer/index.1b525c1c.js +181 -0
  69. package/lib/vite/traceViewer/index.55e65778.js +181 -0
  70. package/lib/vite/traceViewer/{index.6KJ-JQ0L.js → index.5nqVcfiC.js} +2 -2
  71. package/lib/vite/traceViewer/{index.C0EgJ4oW.js → index.5ooko4n7.js} +21 -36
  72. package/lib/vite/traceViewer/index.76e9f312.css +124 -0
  73. package/lib/vite/traceViewer/{index.Dz3icWJV.js → index.Bugo2TbS.js} +4 -3
  74. package/lib/vite/traceViewer/{index.PqcsvBxQ.js → index.BzvnAP7t.js} +4 -3
  75. package/lib/vite/traceViewer/{index.CLxsp2W_.js → index.CM_h9lHr.js} +2 -2
  76. package/lib/vite/traceViewer/{index.yxAwzeWG.js → index.CY13pBr8.js} +4 -3
  77. package/lib/vite/traceViewer/index.DW2ZzZfL.js +197 -0
  78. package/lib/vite/traceViewer/{index.CB297BuW.js → index.DZkJsFod.js} +1 -1
  79. package/lib/vite/traceViewer/index.DblJtEW_.js +197 -0
  80. package/lib/vite/traceViewer/index.a265fbdb.js +2 -0
  81. package/lib/vite/traceViewer/index.c9f6fa8f.js +2 -0
  82. package/lib/vite/traceViewer/index.d86e70ca.js +181 -0
  83. package/lib/vite/traceViewer/index.decad628.js +2 -0
  84. package/lib/vite/traceViewer/index.e8730524.js +181 -0
  85. package/lib/vite/traceViewer/index.ed9a3c58.js +2 -0
  86. package/lib/vite/traceViewer/index.html +7 -7
  87. package/lib/vite/traceViewer/{recorder.BufKu9Hp.js → recorder.3Xfrl_zV.js} +3 -2
  88. package/lib/vite/traceViewer/{recorder.am-MV-DQ.js → recorder.B76AH9PE.js} +3 -2
  89. package/lib/vite/traceViewer/{recorder.C88JDknq.js → recorder.BVExlUUk.js} +1 -1
  90. package/lib/vite/traceViewer/{recorder.7Wl6HrQl.js → recorder.Db1aK_DY.js} +3 -2
  91. package/lib/vite/traceViewer/recorder.html +4 -4
  92. package/lib/vite/traceViewer/recorder.uj3cfoMf.js +551 -0
  93. package/lib/vite/traceViewer/uiMode.08ab2d90.js +4 -0
  94. package/lib/vite/traceViewer/uiMode.0d0d667b.js +4 -0
  95. package/lib/vite/traceViewer/uiMode.216233d5.js +1484 -0
  96. package/lib/vite/traceViewer/{uiMode.DVWUEIHq.css → uiMode.2c31018f.css} +88 -188
  97. package/lib/vite/traceViewer/uiMode.3ff70f7d.js +4 -0
  98. package/lib/vite/traceViewer/uiMode.4d0a45af.js +1484 -0
  99. package/lib/vite/traceViewer/uiMode.66eb0ce2.js +1484 -0
  100. package/lib/vite/traceViewer/uiMode.8b41a49d.css +1 -0
  101. package/lib/vite/traceViewer/uiMode.8d080c01.js +1486 -0
  102. package/lib/vite/traceViewer/uiMode.BKrDfnAk.js +1725 -0
  103. package/lib/vite/traceViewer/uiMode.BMYUvsRh.js +1725 -0
  104. package/lib/vite/traceViewer/{uiMode.BZoFj6zV.js → uiMode.BVpTBGoe.js} +4 -3
  105. package/lib/vite/traceViewer/uiMode.BWhJCEE9.js +1725 -0
  106. package/lib/vite/traceViewer/uiMode.Bg9fACTB.js +1725 -0
  107. package/lib/vite/traceViewer/{uiMode.CpC2B27N.js → uiMode.CYBsUhm_.js} +2 -2
  108. package/lib/vite/traceViewer/{uiMode.Dlo9s_YX.js → uiMode.DCSdxlAq.js} +4 -3
  109. package/lib/vite/traceViewer/{uiMode.2tr9k625.js → uiMode.DjTS7tqC.js} +1 -1
  110. package/lib/vite/traceViewer/{uiMode.wsGnVMQK.js → uiMode.DtleKuGI.js} +4 -3
  111. package/lib/vite/traceViewer/uiMode.UamAvOMX.js +1725 -0
  112. package/lib/vite/traceViewer/uiMode.bBcXYWNF.js +1725 -0
  113. package/lib/vite/traceViewer/uiMode.ca6ec898.js +4 -0
  114. package/lib/vite/traceViewer/{uiMode.iq7CyYy7.js → uiMode.e-PLonGl.js} +2 -2
  115. package/lib/vite/traceViewer/uiMode.e_-GuqEi.js +1725 -0
  116. package/lib/vite/traceViewer/uiMode.f1YADWIl.js +1724 -0
  117. package/lib/vite/traceViewer/uiMode.html +7 -7
  118. package/lib/vite/traceViewer/uiMode.kHsXCfV8.js +1490 -0
  119. package/lib/vite/traceViewer/uiMode.myF_lyEH.js +1724 -0
  120. package/lib/vite/traceViewer/{workbench.B3X2QtYa.css → wsPort.162042f9.css} +63 -315
  121. package/lib/vite/traceViewer/{workbench.wuxQoE2z.css → wsPort.997c92cf.css} +145 -335
  122. package/lib/vite/traceViewer/wsPort.9c9a6767.css +1 -0
  123. package/lib/vite/traceViewer/xtermModule.125f4259.css +191 -0
  124. package/lib/vite/traceViewer/xtermModule.6428296b.css +32 -0
  125. package/package.json +1 -1
  126. package/lib/vite/recorder/assets/codeMirrorModule-ez37Vkbh.css +0 -1
  127. package/lib/vite/recorder/assets/index-BW-aOBcL.css +0 -1
  128. package/lib/vite/recorder/assets/index-Bxxcmxlu.js +0 -42
  129. package/lib/vite/traceViewer/assets/codeMirrorModule-5yiV-3wl.js +0 -16831
  130. package/lib/vite/traceViewer/assets/codeMirrorModule-B7Z3vq11.js +0 -24
  131. package/lib/vite/traceViewer/assets/codeMirrorModule-C6p3E9Zg.js +0 -24
  132. package/lib/vite/traceViewer/assets/codeMirrorModule-Ca-1BNel.js +0 -24
  133. package/lib/vite/traceViewer/assets/codeMirrorModule-CqYUz5ms.js +0 -24
  134. package/lib/vite/traceViewer/assets/codeMirrorModule-DS3v0XrQ.js +0 -24
  135. package/lib/vite/traceViewer/assets/codeMirrorModule-DZoSgqUd.js +0 -24
  136. package/lib/vite/traceViewer/assets/codeMirrorModule-EhKN7Okm.js +0 -16449
  137. package/lib/vite/traceViewer/assets/codeMirrorModule-MzSmL4X2.js +0 -24
  138. package/lib/vite/traceViewer/assets/codeMirrorModule-T_sdMrbM.js +0 -24
  139. package/lib/vite/traceViewer/assets/inspectorTab-Bbgq0hgt.js +0 -64
  140. package/lib/vite/traceViewer/assets/inspectorTab-DhBbZz8I.js +0 -64
  141. package/lib/vite/traceViewer/assets/workbench-C43LWZEX.js +0 -72
  142. package/lib/vite/traceViewer/assets/workbench-DZqNXdoV.js +0 -9
  143. package/lib/vite/traceViewer/assets/workbench-DrQjKdyE.js +0 -72
  144. package/lib/vite/traceViewer/assets/workbench-Pa1v1Ojh.js +0 -72
  145. package/lib/vite/traceViewer/assets/workbench-caTaZnzx.js +0 -72
  146. package/lib/vite/traceViewer/assets/workbench-gtYcQBNA.js +0 -9
  147. package/lib/vite/traceViewer/assets/workbench-u2lRPMOT.js +0 -72
  148. package/lib/vite/traceViewer/assets/xtermModule-CZ7sDYXB.js +0 -6529
  149. package/lib/vite/traceViewer/embedded.BBZ9gQEw.js +0 -104
  150. package/lib/vite/traceViewer/embedded.BQq6Psnz.js +0 -104
  151. package/lib/vite/traceViewer/embedded.BVDVQOzc.js +0 -2
  152. package/lib/vite/traceViewer/embedded.Bn8Ptzv6.js +0 -2
  153. package/lib/vite/traceViewer/embedded.CorI3dFX.js +0 -104
  154. package/lib/vite/traceViewer/embedded.CvhnUgIi.js +0 -2
  155. package/lib/vite/traceViewer/embedded.D27cnKiB.js +0 -104
  156. package/lib/vite/traceViewer/embedded.D4lqGydT.js +0 -2
  157. package/lib/vite/traceViewer/embedded.DPqrDeET.js +0 -2
  158. package/lib/vite/traceViewer/embedded.DbzY7Q8w.js +0 -2
  159. package/lib/vite/traceViewer/embedded.f-PLGsBT.js +0 -2
  160. package/lib/vite/traceViewer/index.B7aiTMfZ.js +0 -2
  161. package/lib/vite/traceViewer/index.B8dgQwuN.js +0 -2
  162. package/lib/vite/traceViewer/index.BGj8jY3H.js +0 -2
  163. package/lib/vite/traceViewer/index.BSak5QT9.js +0 -2
  164. package/lib/vite/traceViewer/index.BrT2kfuc.js +0 -2
  165. package/lib/vite/traceViewer/index.CUpI-BFe.js +0 -195
  166. package/lib/vite/traceViewer/index.DkRbtWVo.js +0 -195
  167. package/lib/vite/traceViewer/index.DsjmhbB6.js +0 -195
  168. package/lib/vite/traceViewer/index._cX8k4co.js +0 -2
  169. package/lib/vite/traceViewer/index.pMAN88y-.js +0 -2
  170. package/lib/vite/traceViewer/recorder.Ch-WHviK.js +0 -2
  171. package/lib/vite/traceViewer/recorder.POd-toIn.js +0 -2
  172. package/lib/vite/traceViewer/uiMode.BEZVCe5O.js +0 -5
  173. package/lib/vite/traceViewer/uiMode.C4nbcio6.js +0 -1730
  174. package/lib/vite/traceViewer/uiMode.D-tg1Oci.js +0 -1730
  175. package/lib/vite/traceViewer/uiMode.D3cNFP6u.css +0 -1
  176. package/lib/vite/traceViewer/uiMode.DKjMBMlc.js +0 -1730
  177. package/lib/vite/traceViewer/uiMode.DVrL7a1K.js +0 -10
  178. package/lib/vite/traceViewer/uiMode.DdtUZZVS.js +0 -5
  179. package/lib/vite/traceViewer/uiMode.Dg9oJCQU.js +0 -10
  180. package/lib/vite/traceViewer/uiMode.DwZAzstF.js +0 -10
  181. package/lib/vite/traceViewer/uiMode.O07awP3T.js +0 -10
  182. package/lib/vite/traceViewer/uiMode.gGHHTsyL.js +0 -1730
  183. package/lib/vite/traceViewer/uiMode.jY2s-9ps.js +0 -10
  184. package/lib/vite/traceViewer/workbench.DjbIuxix.css +0 -1
  185. package/lib/vite/traceViewer/workbench.DyTpxWVb.css +0 -1
@@ -1,9 +1,9 @@
1
- import { p as commonjsGlobal, q as getDefaultExportFromCjs } from "./workbench-Crj6jzdv.js";
2
- var codemirror$1 = { exports: {} };
1
+ import { o as commonjsGlobal, p as getDefaultExportFromCjs } from "./wsPort-cc0077b5.js";
2
+ var codemirror$2 = { exports: {} };
3
3
  var hasRequiredCodemirror;
4
4
  function requireCodemirror() {
5
5
  if (hasRequiredCodemirror)
6
- return codemirror$1.exports;
6
+ return codemirror$2.exports;
7
7
  hasRequiredCodemirror = 1;
8
8
  (function(module, exports) {
9
9
  (function(global, factory) {
@@ -394,7 +394,7 @@ function requireCodemirror() {
394
394
  }
395
395
  return found != null ? found : bidiOther;
396
396
  }
397
- var bidiOrdering = /* @__PURE__ */ function() {
397
+ var bidiOrdering = function() {
398
398
  var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";
399
399
  var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";
400
400
  function charType(code) {
@@ -10716,7 +10716,7 @@ function requireCodemirror() {
10716
10716
  var dontDelegate = "iter insert remove copy getEditor constructor".split(" ");
10717
10717
  for (var prop in Doc.prototype) {
10718
10718
  if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) {
10719
- CodeMirror.prototype[prop] = /* @__PURE__ */ function(method) {
10719
+ CodeMirror.prototype[prop] = function(method) {
10720
10720
  return function() {
10721
10721
  return method.apply(this.doc, arguments);
10722
10722
  };
@@ -10749,11 +10749,12 @@ function requireCodemirror() {
10749
10749
  CodeMirror.version = "5.65.15";
10750
10750
  return CodeMirror;
10751
10751
  });
10752
- })(codemirror$1);
10753
- return codemirror$1.exports;
10752
+ })(codemirror$2);
10753
+ return codemirror$2.exports;
10754
10754
  }
10755
10755
  var codemirrorExports = requireCodemirror();
10756
- const codemirror = /* @__PURE__ */ getDefaultExportFromCjs(codemirrorExports);
10756
+ const codemirror$1 = /* @__PURE__ */ getDefaultExportFromCjs(codemirrorExports);
10757
+ const codemirror = "";
10757
10758
  var css = { exports: {} };
10758
10759
  (function(module, exports) {
10759
10760
  (function(mod) {
@@ -13031,1203 +13032,1197 @@ function requireXml() {
13031
13032
  return xml.exports;
13032
13033
  }
13033
13034
  var javascript = { exports: {} };
13034
- var hasRequiredJavascript;
13035
- function requireJavascript() {
13036
- if (hasRequiredJavascript)
13037
- return javascript.exports;
13038
- hasRequiredJavascript = 1;
13039
- (function(module, exports) {
13040
- (function(mod) {
13041
- mod(requireCodemirror());
13042
- })(function(CodeMirror) {
13043
- CodeMirror.defineMode("javascript", function(config, parserConfig) {
13044
- var indentUnit = config.indentUnit;
13045
- var statementIndent = parserConfig.statementIndent;
13046
- var jsonldMode = parserConfig.jsonld;
13047
- var jsonMode = parserConfig.json || jsonldMode;
13048
- var trackScope = parserConfig.trackScope !== false;
13049
- var isTS = parserConfig.typescript;
13050
- var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;
13051
- var keywords = function() {
13052
- function kw(type2) {
13053
- return { type: type2, style: "keyword" };
13054
- }
13055
- var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"), D = kw("keyword d");
13056
- var operator = kw("operator"), atom = { type: "atom", style: "atom" };
13057
- return {
13058
- "if": kw("if"),
13059
- "while": A,
13060
- "with": A,
13061
- "else": B,
13062
- "do": B,
13063
- "try": B,
13064
- "finally": B,
13065
- "return": D,
13066
- "break": D,
13067
- "continue": D,
13068
- "new": kw("new"),
13069
- "delete": C,
13070
- "void": C,
13071
- "throw": C,
13072
- "debugger": kw("debugger"),
13073
- "var": kw("var"),
13074
- "const": kw("var"),
13075
- "let": kw("var"),
13076
- "function": kw("function"),
13077
- "catch": kw("catch"),
13078
- "for": kw("for"),
13079
- "switch": kw("switch"),
13080
- "case": kw("case"),
13081
- "default": kw("default"),
13082
- "in": operator,
13083
- "typeof": operator,
13084
- "instanceof": operator,
13085
- "true": atom,
13086
- "false": atom,
13087
- "null": atom,
13088
- "undefined": atom,
13089
- "NaN": atom,
13090
- "Infinity": atom,
13091
- "this": kw("this"),
13092
- "class": kw("class"),
13093
- "super": kw("atom"),
13094
- "yield": C,
13095
- "export": kw("export"),
13096
- "import": kw("import"),
13097
- "extends": C,
13098
- "await": C
13099
- };
13100
- }();
13101
- var isOperatorChar = /[+\-*&%=<>!?|~^@]/;
13102
- var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
13103
- function readRegexp(stream) {
13104
- var escaped = false, next, inSet = false;
13105
- while ((next = stream.next()) != null) {
13106
- if (!escaped) {
13107
- if (next == "/" && !inSet)
13108
- return;
13109
- if (next == "[")
13110
- inSet = true;
13111
- else if (inSet && next == "]")
13112
- inSet = false;
13113
- }
13114
- escaped = !escaped && next == "\\";
13035
+ (function(module, exports) {
13036
+ (function(mod) {
13037
+ mod(requireCodemirror());
13038
+ })(function(CodeMirror) {
13039
+ CodeMirror.defineMode("javascript", function(config, parserConfig) {
13040
+ var indentUnit = config.indentUnit;
13041
+ var statementIndent = parserConfig.statementIndent;
13042
+ var jsonldMode = parserConfig.jsonld;
13043
+ var jsonMode = parserConfig.json || jsonldMode;
13044
+ var trackScope = parserConfig.trackScope !== false;
13045
+ var isTS = parserConfig.typescript;
13046
+ var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;
13047
+ var keywords = function() {
13048
+ function kw(type2) {
13049
+ return { type: type2, style: "keyword" };
13050
+ }
13051
+ var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"), D = kw("keyword d");
13052
+ var operator = kw("operator"), atom = { type: "atom", style: "atom" };
13053
+ return {
13054
+ "if": kw("if"),
13055
+ "while": A,
13056
+ "with": A,
13057
+ "else": B,
13058
+ "do": B,
13059
+ "try": B,
13060
+ "finally": B,
13061
+ "return": D,
13062
+ "break": D,
13063
+ "continue": D,
13064
+ "new": kw("new"),
13065
+ "delete": C,
13066
+ "void": C,
13067
+ "throw": C,
13068
+ "debugger": kw("debugger"),
13069
+ "var": kw("var"),
13070
+ "const": kw("var"),
13071
+ "let": kw("var"),
13072
+ "function": kw("function"),
13073
+ "catch": kw("catch"),
13074
+ "for": kw("for"),
13075
+ "switch": kw("switch"),
13076
+ "case": kw("case"),
13077
+ "default": kw("default"),
13078
+ "in": operator,
13079
+ "typeof": operator,
13080
+ "instanceof": operator,
13081
+ "true": atom,
13082
+ "false": atom,
13083
+ "null": atom,
13084
+ "undefined": atom,
13085
+ "NaN": atom,
13086
+ "Infinity": atom,
13087
+ "this": kw("this"),
13088
+ "class": kw("class"),
13089
+ "super": kw("atom"),
13090
+ "yield": C,
13091
+ "export": kw("export"),
13092
+ "import": kw("import"),
13093
+ "extends": C,
13094
+ "await": C
13095
+ };
13096
+ }();
13097
+ var isOperatorChar = /[+\-*&%=<>!?|~^@]/;
13098
+ var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
13099
+ function readRegexp(stream) {
13100
+ var escaped = false, next, inSet = false;
13101
+ while ((next = stream.next()) != null) {
13102
+ if (!escaped) {
13103
+ if (next == "/" && !inSet)
13104
+ return;
13105
+ if (next == "[")
13106
+ inSet = true;
13107
+ else if (inSet && next == "]")
13108
+ inSet = false;
13115
13109
  }
13110
+ escaped = !escaped && next == "\\";
13116
13111
  }
13117
- var type, content;
13118
- function ret(tp, style, cont2) {
13119
- type = tp;
13120
- content = cont2;
13121
- return style;
13122
- }
13123
- function tokenBase(stream, state) {
13124
- var ch = stream.next();
13125
- if (ch == '"' || ch == "'") {
13126
- state.tokenize = tokenString(ch);
13127
- return state.tokenize(stream, state);
13128
- } else if (ch == "." && stream.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)) {
13129
- return ret("number", "number");
13130
- } else if (ch == "." && stream.match("..")) {
13131
- return ret("spread", "meta");
13132
- } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
13133
- return ret(ch);
13134
- } else if (ch == "=" && stream.eat(">")) {
13135
- return ret("=>", "operator");
13136
- } else if (ch == "0" && stream.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) {
13137
- return ret("number", "number");
13138
- } else if (/\d/.test(ch)) {
13139
- stream.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/);
13140
- return ret("number", "number");
13141
- } else if (ch == "/") {
13142
- if (stream.eat("*")) {
13143
- state.tokenize = tokenComment;
13144
- return tokenComment(stream, state);
13145
- } else if (stream.eat("/")) {
13146
- stream.skipToEnd();
13147
- return ret("comment", "comment");
13148
- } else if (expressionAllowed(stream, state, 1)) {
13149
- readRegexp(stream);
13150
- stream.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/);
13151
- return ret("regexp", "string-2");
13152
- } else {
13153
- stream.eat("=");
13154
- return ret("operator", "operator", stream.current());
13155
- }
13156
- } else if (ch == "`") {
13157
- state.tokenize = tokenQuasi;
13158
- return tokenQuasi(stream, state);
13159
- } else if (ch == "#" && stream.peek() == "!") {
13160
- stream.skipToEnd();
13161
- return ret("meta", "meta");
13162
- } else if (ch == "#" && stream.eatWhile(wordRE)) {
13163
- return ret("variable", "property");
13164
- } else if (ch == "<" && stream.match("!--") || ch == "-" && stream.match("->") && !/\S/.test(stream.string.slice(0, stream.start))) {
13112
+ }
13113
+ var type, content;
13114
+ function ret(tp, style, cont2) {
13115
+ type = tp;
13116
+ content = cont2;
13117
+ return style;
13118
+ }
13119
+ function tokenBase(stream, state) {
13120
+ var ch = stream.next();
13121
+ if (ch == '"' || ch == "'") {
13122
+ state.tokenize = tokenString(ch);
13123
+ return state.tokenize(stream, state);
13124
+ } else if (ch == "." && stream.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)) {
13125
+ return ret("number", "number");
13126
+ } else if (ch == "." && stream.match("..")) {
13127
+ return ret("spread", "meta");
13128
+ } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
13129
+ return ret(ch);
13130
+ } else if (ch == "=" && stream.eat(">")) {
13131
+ return ret("=>", "operator");
13132
+ } else if (ch == "0" && stream.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) {
13133
+ return ret("number", "number");
13134
+ } else if (/\d/.test(ch)) {
13135
+ stream.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/);
13136
+ return ret("number", "number");
13137
+ } else if (ch == "/") {
13138
+ if (stream.eat("*")) {
13139
+ state.tokenize = tokenComment;
13140
+ return tokenComment(stream, state);
13141
+ } else if (stream.eat("/")) {
13165
13142
  stream.skipToEnd();
13166
13143
  return ret("comment", "comment");
13167
- } else if (isOperatorChar.test(ch)) {
13168
- if (ch != ">" || !state.lexical || state.lexical.type != ">") {
13169
- if (stream.eat("=")) {
13170
- if (ch == "!" || ch == "=")
13171
- stream.eat("=");
13172
- } else if (/[<>*+\-|&?]/.test(ch)) {
13173
- stream.eat(ch);
13174
- if (ch == ">")
13175
- stream.eat(ch);
13176
- }
13177
- }
13178
- if (ch == "?" && stream.eat("."))
13179
- return ret(".");
13144
+ } else if (expressionAllowed(stream, state, 1)) {
13145
+ readRegexp(stream);
13146
+ stream.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/);
13147
+ return ret("regexp", "string-2");
13148
+ } else {
13149
+ stream.eat("=");
13180
13150
  return ret("operator", "operator", stream.current());
13181
- } else if (wordRE.test(ch)) {
13182
- stream.eatWhile(wordRE);
13183
- var word = stream.current();
13184
- if (state.lastType != ".") {
13185
- if (keywords.propertyIsEnumerable(word)) {
13186
- var kw = keywords[word];
13187
- return ret(kw.type, kw.style, word);
13188
- }
13189
- if (word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false))
13190
- return ret("async", "keyword", word);
13191
- }
13192
- return ret("variable", "variable", word);
13193
13151
  }
13194
- }
13195
- function tokenString(quote) {
13196
- return function(stream, state) {
13197
- var escaped = false, next;
13198
- if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)) {
13199
- state.tokenize = tokenBase;
13200
- return ret("jsonld-keyword", "meta");
13201
- }
13202
- while ((next = stream.next()) != null) {
13203
- if (next == quote && !escaped)
13204
- break;
13205
- escaped = !escaped && next == "\\";
13152
+ } else if (ch == "`") {
13153
+ state.tokenize = tokenQuasi;
13154
+ return tokenQuasi(stream, state);
13155
+ } else if (ch == "#" && stream.peek() == "!") {
13156
+ stream.skipToEnd();
13157
+ return ret("meta", "meta");
13158
+ } else if (ch == "#" && stream.eatWhile(wordRE)) {
13159
+ return ret("variable", "property");
13160
+ } else if (ch == "<" && stream.match("!--") || ch == "-" && stream.match("->") && !/\S/.test(stream.string.slice(0, stream.start))) {
13161
+ stream.skipToEnd();
13162
+ return ret("comment", "comment");
13163
+ } else if (isOperatorChar.test(ch)) {
13164
+ if (ch != ">" || !state.lexical || state.lexical.type != ">") {
13165
+ if (stream.eat("=")) {
13166
+ if (ch == "!" || ch == "=")
13167
+ stream.eat("=");
13168
+ } else if (/[<>*+\-|&?]/.test(ch)) {
13169
+ stream.eat(ch);
13170
+ if (ch == ">")
13171
+ stream.eat(ch);
13206
13172
  }
13207
- if (!escaped)
13208
- state.tokenize = tokenBase;
13209
- return ret("string", "string");
13210
- };
13211
- }
13212
- function tokenComment(stream, state) {
13213
- var maybeEnd = false, ch;
13214
- while (ch = stream.next()) {
13215
- if (ch == "/" && maybeEnd) {
13216
- state.tokenize = tokenBase;
13217
- break;
13173
+ }
13174
+ if (ch == "?" && stream.eat("."))
13175
+ return ret(".");
13176
+ return ret("operator", "operator", stream.current());
13177
+ } else if (wordRE.test(ch)) {
13178
+ stream.eatWhile(wordRE);
13179
+ var word = stream.current();
13180
+ if (state.lastType != ".") {
13181
+ if (keywords.propertyIsEnumerable(word)) {
13182
+ var kw = keywords[word];
13183
+ return ret(kw.type, kw.style, word);
13218
13184
  }
13219
- maybeEnd = ch == "*";
13185
+ if (word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false))
13186
+ return ret("async", "keyword", word);
13220
13187
  }
13221
- return ret("comment", "comment");
13188
+ return ret("variable", "variable", word);
13222
13189
  }
13223
- function tokenQuasi(stream, state) {
13190
+ }
13191
+ function tokenString(quote) {
13192
+ return function(stream, state) {
13224
13193
  var escaped = false, next;
13194
+ if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)) {
13195
+ state.tokenize = tokenBase;
13196
+ return ret("jsonld-keyword", "meta");
13197
+ }
13225
13198
  while ((next = stream.next()) != null) {
13226
- if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) {
13227
- state.tokenize = tokenBase;
13199
+ if (next == quote && !escaped)
13228
13200
  break;
13229
- }
13230
13201
  escaped = !escaped && next == "\\";
13231
13202
  }
13232
- return ret("quasi", "string-2", stream.current());
13203
+ if (!escaped)
13204
+ state.tokenize = tokenBase;
13205
+ return ret("string", "string");
13206
+ };
13207
+ }
13208
+ function tokenComment(stream, state) {
13209
+ var maybeEnd = false, ch;
13210
+ while (ch = stream.next()) {
13211
+ if (ch == "/" && maybeEnd) {
13212
+ state.tokenize = tokenBase;
13213
+ break;
13214
+ }
13215
+ maybeEnd = ch == "*";
13233
13216
  }
13234
- var brackets = "([{}])";
13235
- function findFatArrow(stream, state) {
13236
- if (state.fatArrowAt)
13237
- state.fatArrowAt = null;
13238
- var arrow = stream.string.indexOf("=>", stream.start);
13239
- if (arrow < 0)
13240
- return;
13241
- if (isTS) {
13242
- var m = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start, arrow));
13243
- if (m)
13244
- arrow = m.index;
13245
- }
13246
- var depth = 0, sawSomething = false;
13247
- for (var pos = arrow - 1; pos >= 0; --pos) {
13248
- var ch = stream.string.charAt(pos);
13249
- var bracket = brackets.indexOf(ch);
13250
- if (bracket >= 0 && bracket < 3) {
13251
- if (!depth) {
13252
- ++pos;
13253
- break;
13254
- }
13255
- if (--depth == 0) {
13256
- if (ch == "(")
13257
- sawSomething = true;
13258
- break;
13259
- }
13260
- } else if (bracket >= 3 && bracket < 6) {
13261
- ++depth;
13262
- } else if (wordRE.test(ch)) {
13263
- sawSomething = true;
13264
- } else if (/["'\/`]/.test(ch)) {
13265
- for (; ; --pos) {
13266
- if (pos == 0)
13267
- return;
13268
- var next = stream.string.charAt(pos - 1);
13269
- if (next == ch && stream.string.charAt(pos - 2) != "\\") {
13270
- pos--;
13271
- break;
13272
- }
13273
- }
13274
- } else if (sawSomething && !depth) {
13217
+ return ret("comment", "comment");
13218
+ }
13219
+ function tokenQuasi(stream, state) {
13220
+ var escaped = false, next;
13221
+ while ((next = stream.next()) != null) {
13222
+ if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) {
13223
+ state.tokenize = tokenBase;
13224
+ break;
13225
+ }
13226
+ escaped = !escaped && next == "\\";
13227
+ }
13228
+ return ret("quasi", "string-2", stream.current());
13229
+ }
13230
+ var brackets = "([{}])";
13231
+ function findFatArrow(stream, state) {
13232
+ if (state.fatArrowAt)
13233
+ state.fatArrowAt = null;
13234
+ var arrow = stream.string.indexOf("=>", stream.start);
13235
+ if (arrow < 0)
13236
+ return;
13237
+ if (isTS) {
13238
+ var m = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start, arrow));
13239
+ if (m)
13240
+ arrow = m.index;
13241
+ }
13242
+ var depth = 0, sawSomething = false;
13243
+ for (var pos = arrow - 1; pos >= 0; --pos) {
13244
+ var ch = stream.string.charAt(pos);
13245
+ var bracket = brackets.indexOf(ch);
13246
+ if (bracket >= 0 && bracket < 3) {
13247
+ if (!depth) {
13275
13248
  ++pos;
13276
13249
  break;
13277
13250
  }
13251
+ if (--depth == 0) {
13252
+ if (ch == "(")
13253
+ sawSomething = true;
13254
+ break;
13255
+ }
13256
+ } else if (bracket >= 3 && bracket < 6) {
13257
+ ++depth;
13258
+ } else if (wordRE.test(ch)) {
13259
+ sawSomething = true;
13260
+ } else if (/["'\/`]/.test(ch)) {
13261
+ for (; ; --pos) {
13262
+ if (pos == 0)
13263
+ return;
13264
+ var next = stream.string.charAt(pos - 1);
13265
+ if (next == ch && stream.string.charAt(pos - 2) != "\\") {
13266
+ pos--;
13267
+ break;
13268
+ }
13269
+ }
13270
+ } else if (sawSomething && !depth) {
13271
+ ++pos;
13272
+ break;
13278
13273
  }
13279
- if (sawSomething && !depth)
13280
- state.fatArrowAt = pos;
13281
13274
  }
13282
- var atomicTypes = {
13283
- "atom": true,
13284
- "number": true,
13285
- "variable": true,
13286
- "string": true,
13287
- "regexp": true,
13288
- "this": true,
13289
- "import": true,
13290
- "jsonld-keyword": true
13291
- };
13292
- function JSLexical(indented, column, type2, align, prev, info) {
13293
- this.indented = indented;
13294
- this.column = column;
13295
- this.type = type2;
13296
- this.prev = prev;
13297
- this.info = info;
13298
- if (align != null)
13299
- this.align = align;
13300
- }
13301
- function inScope(state, varname) {
13302
- if (!trackScope)
13303
- return false;
13304
- for (var v = state.localVars; v; v = v.next)
13275
+ if (sawSomething && !depth)
13276
+ state.fatArrowAt = pos;
13277
+ }
13278
+ var atomicTypes = {
13279
+ "atom": true,
13280
+ "number": true,
13281
+ "variable": true,
13282
+ "string": true,
13283
+ "regexp": true,
13284
+ "this": true,
13285
+ "import": true,
13286
+ "jsonld-keyword": true
13287
+ };
13288
+ function JSLexical(indented, column, type2, align, prev, info) {
13289
+ this.indented = indented;
13290
+ this.column = column;
13291
+ this.type = type2;
13292
+ this.prev = prev;
13293
+ this.info = info;
13294
+ if (align != null)
13295
+ this.align = align;
13296
+ }
13297
+ function inScope(state, varname) {
13298
+ if (!trackScope)
13299
+ return false;
13300
+ for (var v = state.localVars; v; v = v.next)
13301
+ if (v.name == varname)
13302
+ return true;
13303
+ for (var cx2 = state.context; cx2; cx2 = cx2.prev) {
13304
+ for (var v = cx2.vars; v; v = v.next)
13305
13305
  if (v.name == varname)
13306
13306
  return true;
13307
- for (var cx2 = state.context; cx2; cx2 = cx2.prev) {
13308
- for (var v = cx2.vars; v; v = v.next)
13309
- if (v.name == varname)
13310
- return true;
13311
- }
13312
13307
  }
13313
- function parseJS(state, style, type2, content2, stream) {
13314
- var cc = state.cc;
13315
- cx.state = state;
13316
- cx.stream = stream;
13317
- cx.marked = null, cx.cc = cc;
13318
- cx.style = style;
13319
- if (!state.lexical.hasOwnProperty("align"))
13320
- state.lexical.align = true;
13321
- while (true) {
13322
- var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
13323
- if (combinator(type2, content2)) {
13324
- while (cc.length && cc[cc.length - 1].lex)
13325
- cc.pop()();
13326
- if (cx.marked)
13327
- return cx.marked;
13328
- if (type2 == "variable" && inScope(state, content2))
13329
- return "variable-2";
13330
- return style;
13331
- }
13308
+ }
13309
+ function parseJS(state, style, type2, content2, stream) {
13310
+ var cc = state.cc;
13311
+ cx.state = state;
13312
+ cx.stream = stream;
13313
+ cx.marked = null, cx.cc = cc;
13314
+ cx.style = style;
13315
+ if (!state.lexical.hasOwnProperty("align"))
13316
+ state.lexical.align = true;
13317
+ while (true) {
13318
+ var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
13319
+ if (combinator(type2, content2)) {
13320
+ while (cc.length && cc[cc.length - 1].lex)
13321
+ cc.pop()();
13322
+ if (cx.marked)
13323
+ return cx.marked;
13324
+ if (type2 == "variable" && inScope(state, content2))
13325
+ return "variable-2";
13326
+ return style;
13332
13327
  }
13333
13328
  }
13334
- var cx = { state: null, column: null, marked: null, cc: null };
13335
- function pass() {
13336
- for (var i = arguments.length - 1; i >= 0; i--)
13337
- cx.cc.push(arguments[i]);
13338
- }
13339
- function cont() {
13340
- pass.apply(null, arguments);
13341
- return true;
13342
- }
13343
- function inList(name, list) {
13344
- for (var v = list; v; v = v.next)
13345
- if (v.name == name)
13346
- return true;
13347
- return false;
13348
- }
13349
- function register(varname) {
13350
- var state = cx.state;
13351
- cx.marked = "def";
13352
- if (!trackScope)
13353
- return;
13354
- if (state.context) {
13355
- if (state.lexical.info == "var" && state.context && state.context.block) {
13356
- var newContext = registerVarScoped(varname, state.context);
13357
- if (newContext != null) {
13358
- state.context = newContext;
13359
- return;
13360
- }
13361
- } else if (!inList(varname, state.localVars)) {
13362
- state.localVars = new Var(varname, state.localVars);
13329
+ }
13330
+ var cx = { state: null, column: null, marked: null, cc: null };
13331
+ function pass() {
13332
+ for (var i = arguments.length - 1; i >= 0; i--)
13333
+ cx.cc.push(arguments[i]);
13334
+ }
13335
+ function cont() {
13336
+ pass.apply(null, arguments);
13337
+ return true;
13338
+ }
13339
+ function inList(name, list) {
13340
+ for (var v = list; v; v = v.next)
13341
+ if (v.name == name)
13342
+ return true;
13343
+ return false;
13344
+ }
13345
+ function register(varname) {
13346
+ var state = cx.state;
13347
+ cx.marked = "def";
13348
+ if (!trackScope)
13349
+ return;
13350
+ if (state.context) {
13351
+ if (state.lexical.info == "var" && state.context && state.context.block) {
13352
+ var newContext = registerVarScoped(varname, state.context);
13353
+ if (newContext != null) {
13354
+ state.context = newContext;
13363
13355
  return;
13364
13356
  }
13357
+ } else if (!inList(varname, state.localVars)) {
13358
+ state.localVars = new Var(varname, state.localVars);
13359
+ return;
13365
13360
  }
13366
- if (parserConfig.globalVars && !inList(varname, state.globalVars))
13367
- state.globalVars = new Var(varname, state.globalVars);
13368
13361
  }
13369
- function registerVarScoped(varname, context) {
13370
- if (!context) {
13362
+ if (parserConfig.globalVars && !inList(varname, state.globalVars))
13363
+ state.globalVars = new Var(varname, state.globalVars);
13364
+ }
13365
+ function registerVarScoped(varname, context) {
13366
+ if (!context) {
13367
+ return null;
13368
+ } else if (context.block) {
13369
+ var inner = registerVarScoped(varname, context.prev);
13370
+ if (!inner)
13371
13371
  return null;
13372
- } else if (context.block) {
13373
- var inner = registerVarScoped(varname, context.prev);
13374
- if (!inner)
13375
- return null;
13376
- if (inner == context.prev)
13377
- return context;
13378
- return new Context(inner, context.vars, true);
13379
- } else if (inList(varname, context.vars)) {
13372
+ if (inner == context.prev)
13380
13373
  return context;
13381
- } else {
13382
- return new Context(context.prev, new Var(varname, context.vars), false);
13383
- }
13384
- }
13385
- function isModifier(name) {
13386
- return name == "public" || name == "private" || name == "protected" || name == "abstract" || name == "readonly";
13387
- }
13388
- function Context(prev, vars, block2) {
13389
- this.prev = prev;
13390
- this.vars = vars;
13391
- this.block = block2;
13392
- }
13393
- function Var(name, next) {
13394
- this.name = name;
13395
- this.next = next;
13396
- }
13397
- var defaultVars = new Var("this", new Var("arguments", null));
13398
- function pushcontext() {
13399
- cx.state.context = new Context(cx.state.context, cx.state.localVars, false);
13400
- cx.state.localVars = defaultVars;
13401
- }
13402
- function pushblockcontext() {
13403
- cx.state.context = new Context(cx.state.context, cx.state.localVars, true);
13404
- cx.state.localVars = null;
13405
- }
13406
- pushcontext.lex = pushblockcontext.lex = true;
13407
- function popcontext() {
13408
- cx.state.localVars = cx.state.context.vars;
13409
- cx.state.context = cx.state.context.prev;
13374
+ return new Context(inner, context.vars, true);
13375
+ } else if (inList(varname, context.vars)) {
13376
+ return context;
13377
+ } else {
13378
+ return new Context(context.prev, new Var(varname, context.vars), false);
13410
13379
  }
13411
- popcontext.lex = true;
13412
- function pushlex(type2, info) {
13413
- var result = function() {
13414
- var state = cx.state, indent = state.indented;
13415
- if (state.lexical.type == "stat")
13416
- indent = state.lexical.indented;
13417
- else
13418
- for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev)
13419
- indent = outer.indented;
13420
- state.lexical = new JSLexical(indent, cx.stream.column(), type2, null, state.lexical, info);
13421
- };
13422
- result.lex = true;
13423
- return result;
13380
+ }
13381
+ function isModifier(name) {
13382
+ return name == "public" || name == "private" || name == "protected" || name == "abstract" || name == "readonly";
13383
+ }
13384
+ function Context(prev, vars, block2) {
13385
+ this.prev = prev;
13386
+ this.vars = vars;
13387
+ this.block = block2;
13388
+ }
13389
+ function Var(name, next) {
13390
+ this.name = name;
13391
+ this.next = next;
13392
+ }
13393
+ var defaultVars = new Var("this", new Var("arguments", null));
13394
+ function pushcontext() {
13395
+ cx.state.context = new Context(cx.state.context, cx.state.localVars, false);
13396
+ cx.state.localVars = defaultVars;
13397
+ }
13398
+ function pushblockcontext() {
13399
+ cx.state.context = new Context(cx.state.context, cx.state.localVars, true);
13400
+ cx.state.localVars = null;
13401
+ }
13402
+ pushcontext.lex = pushblockcontext.lex = true;
13403
+ function popcontext() {
13404
+ cx.state.localVars = cx.state.context.vars;
13405
+ cx.state.context = cx.state.context.prev;
13406
+ }
13407
+ popcontext.lex = true;
13408
+ function pushlex(type2, info) {
13409
+ var result = function() {
13410
+ var state = cx.state, indent = state.indented;
13411
+ if (state.lexical.type == "stat")
13412
+ indent = state.lexical.indented;
13413
+ else
13414
+ for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev)
13415
+ indent = outer.indented;
13416
+ state.lexical = new JSLexical(indent, cx.stream.column(), type2, null, state.lexical, info);
13417
+ };
13418
+ result.lex = true;
13419
+ return result;
13420
+ }
13421
+ function poplex() {
13422
+ var state = cx.state;
13423
+ if (state.lexical.prev) {
13424
+ if (state.lexical.type == ")")
13425
+ state.indented = state.lexical.indented;
13426
+ state.lexical = state.lexical.prev;
13424
13427
  }
13425
- function poplex() {
13426
- var state = cx.state;
13427
- if (state.lexical.prev) {
13428
- if (state.lexical.type == ")")
13429
- state.indented = state.lexical.indented;
13430
- state.lexical = state.lexical.prev;
13431
- }
13432
- }
13433
- poplex.lex = true;
13434
- function expect(wanted) {
13435
- function exp(type2) {
13436
- if (type2 == wanted)
13437
- return cont();
13438
- else if (wanted == ";" || type2 == "}" || type2 == ")" || type2 == "]")
13439
- return pass();
13440
- else
13441
- return cont(exp);
13442
- }
13443
- return exp;
13444
- }
13445
- function statement(type2, value) {
13446
- if (type2 == "var")
13447
- return cont(pushlex("vardef", value), vardef, expect(";"), poplex);
13448
- if (type2 == "keyword a")
13449
- return cont(pushlex("form"), parenExpr, statement, poplex);
13450
- if (type2 == "keyword b")
13451
- return cont(pushlex("form"), statement, poplex);
13452
- if (type2 == "keyword d")
13453
- return cx.stream.match(/^\s*$/, false) ? cont() : cont(pushlex("stat"), maybeexpression, expect(";"), poplex);
13454
- if (type2 == "debugger")
13455
- return cont(expect(";"));
13456
- if (type2 == "{")
13457
- return cont(pushlex("}"), pushblockcontext, block, poplex, popcontext);
13458
- if (type2 == ";")
13428
+ }
13429
+ poplex.lex = true;
13430
+ function expect(wanted) {
13431
+ function exp(type2) {
13432
+ if (type2 == wanted)
13459
13433
  return cont();
13460
- if (type2 == "if") {
13461
- if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex)
13462
- cx.state.cc.pop()();
13463
- return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse);
13464
- }
13465
- if (type2 == "function")
13466
- return cont(functiondef);
13467
- if (type2 == "for")
13468
- return cont(pushlex("form"), pushblockcontext, forspec, statement, popcontext, poplex);
13469
- if (type2 == "class" || isTS && value == "interface") {
13470
- cx.marked = "keyword";
13471
- return cont(pushlex("form", type2 == "class" ? type2 : value), className, poplex);
13472
- }
13473
- if (type2 == "variable") {
13474
- if (isTS && value == "declare") {
13475
- cx.marked = "keyword";
13476
- return cont(statement);
13477
- } else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) {
13478
- cx.marked = "keyword";
13479
- if (value == "enum")
13480
- return cont(enumdef);
13481
- else if (value == "type")
13482
- return cont(typename, expect("operator"), typeexpr, expect(";"));
13483
- else
13484
- return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex);
13485
- } else if (isTS && value == "namespace") {
13486
- cx.marked = "keyword";
13487
- return cont(pushlex("form"), expression, statement, poplex);
13488
- } else if (isTS && value == "abstract") {
13489
- cx.marked = "keyword";
13490
- return cont(statement);
13491
- } else {
13492
- return cont(pushlex("stat"), maybelabel);
13493
- }
13494
- }
13495
- if (type2 == "switch")
13496
- return cont(
13497
- pushlex("form"),
13498
- parenExpr,
13499
- expect("{"),
13500
- pushlex("}", "switch"),
13501
- pushblockcontext,
13502
- block,
13503
- poplex,
13504
- poplex,
13505
- popcontext
13506
- );
13507
- if (type2 == "case")
13508
- return cont(expression, expect(":"));
13509
- if (type2 == "default")
13510
- return cont(expect(":"));
13511
- if (type2 == "catch")
13512
- return cont(pushlex("form"), pushcontext, maybeCatchBinding, statement, poplex, popcontext);
13513
- if (type2 == "export")
13514
- return cont(pushlex("stat"), afterExport, poplex);
13515
- if (type2 == "import")
13516
- return cont(pushlex("stat"), afterImport, poplex);
13517
- if (type2 == "async")
13518
- return cont(statement);
13519
- if (value == "@")
13520
- return cont(expression, statement);
13521
- return pass(pushlex("stat"), expression, expect(";"), poplex);
13522
- }
13523
- function maybeCatchBinding(type2) {
13524
- if (type2 == "(")
13525
- return cont(funarg, expect(")"));
13526
- }
13527
- function expression(type2, value) {
13528
- return expressionInner(type2, value, false);
13529
- }
13530
- function expressionNoComma(type2, value) {
13531
- return expressionInner(type2, value, true);
13532
- }
13533
- function parenExpr(type2) {
13534
- if (type2 != "(")
13434
+ else if (wanted == ";" || type2 == "}" || type2 == ")" || type2 == "]")
13535
13435
  return pass();
13536
- return cont(pushlex(")"), maybeexpression, expect(")"), poplex);
13537
- }
13538
- function expressionInner(type2, value, noComma) {
13539
- if (cx.state.fatArrowAt == cx.stream.start) {
13540
- var body = noComma ? arrowBodyNoComma : arrowBody;
13541
- if (type2 == "(")
13542
- return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext);
13543
- else if (type2 == "variable")
13544
- return pass(pushcontext, pattern, expect("=>"), body, popcontext);
13545
- }
13546
- var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
13547
- if (atomicTypes.hasOwnProperty(type2))
13548
- return cont(maybeop);
13549
- if (type2 == "function")
13550
- return cont(functiondef, maybeop);
13551
- if (type2 == "class" || isTS && value == "interface") {
13552
- cx.marked = "keyword";
13553
- return cont(pushlex("form"), classExpression, poplex);
13554
- }
13555
- if (type2 == "keyword c" || type2 == "async")
13556
- return cont(noComma ? expressionNoComma : expression);
13557
- if (type2 == "(")
13558
- return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop);
13559
- if (type2 == "operator" || type2 == "spread")
13560
- return cont(noComma ? expressionNoComma : expression);
13561
- if (type2 == "[")
13562
- return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
13563
- if (type2 == "{")
13564
- return contCommasep(objprop, "}", null, maybeop);
13565
- if (type2 == "quasi")
13566
- return pass(quasi, maybeop);
13567
- if (type2 == "new")
13568
- return cont(maybeTarget(noComma));
13436
+ else
13437
+ return cont(exp);
13438
+ }
13439
+ return exp;
13440
+ }
13441
+ function statement(type2, value) {
13442
+ if (type2 == "var")
13443
+ return cont(pushlex("vardef", value), vardef, expect(";"), poplex);
13444
+ if (type2 == "keyword a")
13445
+ return cont(pushlex("form"), parenExpr, statement, poplex);
13446
+ if (type2 == "keyword b")
13447
+ return cont(pushlex("form"), statement, poplex);
13448
+ if (type2 == "keyword d")
13449
+ return cx.stream.match(/^\s*$/, false) ? cont() : cont(pushlex("stat"), maybeexpression, expect(";"), poplex);
13450
+ if (type2 == "debugger")
13451
+ return cont(expect(";"));
13452
+ if (type2 == "{")
13453
+ return cont(pushlex("}"), pushblockcontext, block, poplex, popcontext);
13454
+ if (type2 == ";")
13569
13455
  return cont();
13456
+ if (type2 == "if") {
13457
+ if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex)
13458
+ cx.state.cc.pop()();
13459
+ return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse);
13570
13460
  }
13571
- function maybeexpression(type2) {
13572
- if (type2.match(/[;\}\)\],]/))
13573
- return pass();
13574
- return pass(expression);
13575
- }
13576
- function maybeoperatorComma(type2, value) {
13577
- if (type2 == ",")
13578
- return cont(maybeexpression);
13579
- return maybeoperatorNoComma(type2, value, false);
13580
- }
13581
- function maybeoperatorNoComma(type2, value, noComma) {
13582
- var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;
13583
- var expr = noComma == false ? expression : expressionNoComma;
13584
- if (type2 == "=>")
13585
- return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
13586
- if (type2 == "operator") {
13587
- if (/\+\+|--/.test(value) || isTS && value == "!")
13588
- return cont(me);
13589
- if (isTS && value == "<" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, false))
13590
- return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me);
13591
- if (value == "?")
13592
- return cont(expression, expect(":"), expr);
13593
- return cont(expr);
13594
- }
13595
- if (type2 == "quasi") {
13596
- return pass(quasi, me);
13597
- }
13598
- if (type2 == ";")
13599
- return;
13600
- if (type2 == "(")
13601
- return contCommasep(expressionNoComma, ")", "call", me);
13602
- if (type2 == ".")
13603
- return cont(property, me);
13604
- if (type2 == "[")
13605
- return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
13606
- if (isTS && value == "as") {
13607
- cx.marked = "keyword";
13608
- return cont(typeexpr, me);
13609
- }
13610
- if (type2 == "regexp") {
13611
- cx.state.lastType = cx.marked = "operator";
13612
- cx.stream.backUp(cx.stream.pos - cx.stream.start - 1);
13613
- return cont(expr);
13614
- }
13615
- }
13616
- function quasi(type2, value) {
13617
- if (type2 != "quasi")
13618
- return pass();
13619
- if (value.slice(value.length - 2) != "${")
13620
- return cont(quasi);
13621
- return cont(maybeexpression, continueQuasi);
13622
- }
13623
- function continueQuasi(type2) {
13624
- if (type2 == "}") {
13625
- cx.marked = "string-2";
13626
- cx.state.tokenize = tokenQuasi;
13627
- return cont(quasi);
13628
- }
13629
- }
13630
- function arrowBody(type2) {
13631
- findFatArrow(cx.stream, cx.state);
13632
- return pass(type2 == "{" ? statement : expression);
13633
- }
13634
- function arrowBodyNoComma(type2) {
13635
- findFatArrow(cx.stream, cx.state);
13636
- return pass(type2 == "{" ? statement : expressionNoComma);
13637
- }
13638
- function maybeTarget(noComma) {
13639
- return function(type2) {
13640
- if (type2 == ".")
13641
- return cont(noComma ? targetNoComma : target);
13642
- else if (type2 == "variable" && isTS)
13643
- return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma);
13644
- else
13645
- return pass(noComma ? expressionNoComma : expression);
13646
- };
13647
- }
13648
- function target(_, value) {
13649
- if (value == "target") {
13461
+ if (type2 == "function")
13462
+ return cont(functiondef);
13463
+ if (type2 == "for")
13464
+ return cont(pushlex("form"), pushblockcontext, forspec, statement, popcontext, poplex);
13465
+ if (type2 == "class" || isTS && value == "interface") {
13466
+ cx.marked = "keyword";
13467
+ return cont(pushlex("form", type2 == "class" ? type2 : value), className, poplex);
13468
+ }
13469
+ if (type2 == "variable") {
13470
+ if (isTS && value == "declare") {
13650
13471
  cx.marked = "keyword";
13651
- return cont(maybeoperatorComma);
13652
- }
13653
- }
13654
- function targetNoComma(_, value) {
13655
- if (value == "target") {
13472
+ return cont(statement);
13473
+ } else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) {
13656
13474
  cx.marked = "keyword";
13657
- return cont(maybeoperatorNoComma);
13658
- }
13659
- }
13660
- function maybelabel(type2) {
13661
- if (type2 == ":")
13662
- return cont(poplex, statement);
13663
- return pass(maybeoperatorComma, expect(";"), poplex);
13664
- }
13665
- function property(type2) {
13666
- if (type2 == "variable") {
13667
- cx.marked = "property";
13668
- return cont();
13669
- }
13670
- }
13671
- function objprop(type2, value) {
13672
- if (type2 == "async") {
13673
- cx.marked = "property";
13674
- return cont(objprop);
13675
- } else if (type2 == "variable" || cx.style == "keyword") {
13676
- cx.marked = "property";
13677
- if (value == "get" || value == "set")
13678
- return cont(getterSetter);
13679
- var m;
13680
- if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\s*:\s*/, false)))
13681
- cx.state.fatArrowAt = cx.stream.pos + m[0].length;
13682
- return cont(afterprop);
13683
- } else if (type2 == "number" || type2 == "string") {
13684
- cx.marked = jsonldMode ? "property" : cx.style + " property";
13685
- return cont(afterprop);
13686
- } else if (type2 == "jsonld-keyword") {
13687
- return cont(afterprop);
13688
- } else if (isTS && isModifier(value)) {
13475
+ if (value == "enum")
13476
+ return cont(enumdef);
13477
+ else if (value == "type")
13478
+ return cont(typename, expect("operator"), typeexpr, expect(";"));
13479
+ else
13480
+ return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex);
13481
+ } else if (isTS && value == "namespace") {
13689
13482
  cx.marked = "keyword";
13690
- return cont(objprop);
13691
- } else if (type2 == "[") {
13692
- return cont(expression, maybetype, expect("]"), afterprop);
13693
- } else if (type2 == "spread") {
13694
- return cont(expressionNoComma, afterprop);
13695
- } else if (value == "*") {
13483
+ return cont(pushlex("form"), expression, statement, poplex);
13484
+ } else if (isTS && value == "abstract") {
13696
13485
  cx.marked = "keyword";
13697
- return cont(objprop);
13698
- } else if (type2 == ":") {
13699
- return pass(afterprop);
13700
- }
13701
- }
13702
- function getterSetter(type2) {
13703
- if (type2 != "variable")
13704
- return pass(afterprop);
13705
- cx.marked = "property";
13706
- return cont(functiondef);
13707
- }
13708
- function afterprop(type2) {
13709
- if (type2 == ":")
13710
- return cont(expressionNoComma);
13486
+ return cont(statement);
13487
+ } else {
13488
+ return cont(pushlex("stat"), maybelabel);
13489
+ }
13490
+ }
13491
+ if (type2 == "switch")
13492
+ return cont(
13493
+ pushlex("form"),
13494
+ parenExpr,
13495
+ expect("{"),
13496
+ pushlex("}", "switch"),
13497
+ pushblockcontext,
13498
+ block,
13499
+ poplex,
13500
+ poplex,
13501
+ popcontext
13502
+ );
13503
+ if (type2 == "case")
13504
+ return cont(expression, expect(":"));
13505
+ if (type2 == "default")
13506
+ return cont(expect(":"));
13507
+ if (type2 == "catch")
13508
+ return cont(pushlex("form"), pushcontext, maybeCatchBinding, statement, poplex, popcontext);
13509
+ if (type2 == "export")
13510
+ return cont(pushlex("stat"), afterExport, poplex);
13511
+ if (type2 == "import")
13512
+ return cont(pushlex("stat"), afterImport, poplex);
13513
+ if (type2 == "async")
13514
+ return cont(statement);
13515
+ if (value == "@")
13516
+ return cont(expression, statement);
13517
+ return pass(pushlex("stat"), expression, expect(";"), poplex);
13518
+ }
13519
+ function maybeCatchBinding(type2) {
13520
+ if (type2 == "(")
13521
+ return cont(funarg, expect(")"));
13522
+ }
13523
+ function expression(type2, value) {
13524
+ return expressionInner(type2, value, false);
13525
+ }
13526
+ function expressionNoComma(type2, value) {
13527
+ return expressionInner(type2, value, true);
13528
+ }
13529
+ function parenExpr(type2) {
13530
+ if (type2 != "(")
13531
+ return pass();
13532
+ return cont(pushlex(")"), maybeexpression, expect(")"), poplex);
13533
+ }
13534
+ function expressionInner(type2, value, noComma) {
13535
+ if (cx.state.fatArrowAt == cx.stream.start) {
13536
+ var body = noComma ? arrowBodyNoComma : arrowBody;
13711
13537
  if (type2 == "(")
13712
- return pass(functiondef);
13713
- }
13714
- function commasep(what, end, sep) {
13715
- function proceed(type2, value) {
13716
- if (sep ? sep.indexOf(type2) > -1 : type2 == ",") {
13717
- var lex = cx.state.lexical;
13718
- if (lex.info == "call")
13719
- lex.pos = (lex.pos || 0) + 1;
13720
- return cont(function(type3, value2) {
13721
- if (type3 == end || value2 == end)
13722
- return pass();
13723
- return pass(what);
13724
- }, proceed);
13725
- }
13726
- if (type2 == end || value == end)
13727
- return cont();
13728
- if (sep && sep.indexOf(";") > -1)
13729
- return pass(what);
13730
- return cont(expect(end));
13731
- }
13732
- return function(type2, value) {
13733
- if (type2 == end || value == end)
13734
- return cont();
13735
- return pass(what, proceed);
13736
- };
13538
+ return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext);
13539
+ else if (type2 == "variable")
13540
+ return pass(pushcontext, pattern, expect("=>"), body, popcontext);
13541
+ }
13542
+ var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
13543
+ if (atomicTypes.hasOwnProperty(type2))
13544
+ return cont(maybeop);
13545
+ if (type2 == "function")
13546
+ return cont(functiondef, maybeop);
13547
+ if (type2 == "class" || isTS && value == "interface") {
13548
+ cx.marked = "keyword";
13549
+ return cont(pushlex("form"), classExpression, poplex);
13550
+ }
13551
+ if (type2 == "keyword c" || type2 == "async")
13552
+ return cont(noComma ? expressionNoComma : expression);
13553
+ if (type2 == "(")
13554
+ return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop);
13555
+ if (type2 == "operator" || type2 == "spread")
13556
+ return cont(noComma ? expressionNoComma : expression);
13557
+ if (type2 == "[")
13558
+ return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
13559
+ if (type2 == "{")
13560
+ return contCommasep(objprop, "}", null, maybeop);
13561
+ if (type2 == "quasi")
13562
+ return pass(quasi, maybeop);
13563
+ if (type2 == "new")
13564
+ return cont(maybeTarget(noComma));
13565
+ return cont();
13566
+ }
13567
+ function maybeexpression(type2) {
13568
+ if (type2.match(/[;\}\)\],]/))
13569
+ return pass();
13570
+ return pass(expression);
13571
+ }
13572
+ function maybeoperatorComma(type2, value) {
13573
+ if (type2 == ",")
13574
+ return cont(maybeexpression);
13575
+ return maybeoperatorNoComma(type2, value, false);
13576
+ }
13577
+ function maybeoperatorNoComma(type2, value, noComma) {
13578
+ var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;
13579
+ var expr = noComma == false ? expression : expressionNoComma;
13580
+ if (type2 == "=>")
13581
+ return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
13582
+ if (type2 == "operator") {
13583
+ if (/\+\+|--/.test(value) || isTS && value == "!")
13584
+ return cont(me);
13585
+ if (isTS && value == "<" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, false))
13586
+ return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me);
13587
+ if (value == "?")
13588
+ return cont(expression, expect(":"), expr);
13589
+ return cont(expr);
13737
13590
  }
13738
- function contCommasep(what, end, info) {
13739
- for (var i = 3; i < arguments.length; i++)
13740
- cx.cc.push(arguments[i]);
13741
- return cont(pushlex(end, info), commasep(what, end), poplex);
13591
+ if (type2 == "quasi") {
13592
+ return pass(quasi, me);
13742
13593
  }
13743
- function block(type2) {
13744
- if (type2 == "}")
13745
- return cont();
13746
- return pass(statement, block);
13594
+ if (type2 == ";")
13595
+ return;
13596
+ if (type2 == "(")
13597
+ return contCommasep(expressionNoComma, ")", "call", me);
13598
+ if (type2 == ".")
13599
+ return cont(property, me);
13600
+ if (type2 == "[")
13601
+ return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
13602
+ if (isTS && value == "as") {
13603
+ cx.marked = "keyword";
13604
+ return cont(typeexpr, me);
13605
+ }
13606
+ if (type2 == "regexp") {
13607
+ cx.state.lastType = cx.marked = "operator";
13608
+ cx.stream.backUp(cx.stream.pos - cx.stream.start - 1);
13609
+ return cont(expr);
13610
+ }
13611
+ }
13612
+ function quasi(type2, value) {
13613
+ if (type2 != "quasi")
13614
+ return pass();
13615
+ if (value.slice(value.length - 2) != "${")
13616
+ return cont(quasi);
13617
+ return cont(maybeexpression, continueQuasi);
13618
+ }
13619
+ function continueQuasi(type2) {
13620
+ if (type2 == "}") {
13621
+ cx.marked = "string-2";
13622
+ cx.state.tokenize = tokenQuasi;
13623
+ return cont(quasi);
13747
13624
  }
13748
- function maybetype(type2, value) {
13749
- if (isTS) {
13750
- if (type2 == ":")
13751
- return cont(typeexpr);
13752
- if (value == "?")
13753
- return cont(maybetype);
13754
- }
13625
+ }
13626
+ function arrowBody(type2) {
13627
+ findFatArrow(cx.stream, cx.state);
13628
+ return pass(type2 == "{" ? statement : expression);
13629
+ }
13630
+ function arrowBodyNoComma(type2) {
13631
+ findFatArrow(cx.stream, cx.state);
13632
+ return pass(type2 == "{" ? statement : expressionNoComma);
13633
+ }
13634
+ function maybeTarget(noComma) {
13635
+ return function(type2) {
13636
+ if (type2 == ".")
13637
+ return cont(noComma ? targetNoComma : target);
13638
+ else if (type2 == "variable" && isTS)
13639
+ return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma);
13640
+ else
13641
+ return pass(noComma ? expressionNoComma : expression);
13642
+ };
13643
+ }
13644
+ function target(_, value) {
13645
+ if (value == "target") {
13646
+ cx.marked = "keyword";
13647
+ return cont(maybeoperatorComma);
13755
13648
  }
13756
- function maybetypeOrIn(type2, value) {
13757
- if (isTS && (type2 == ":" || value == "in"))
13758
- return cont(typeexpr);
13649
+ }
13650
+ function targetNoComma(_, value) {
13651
+ if (value == "target") {
13652
+ cx.marked = "keyword";
13653
+ return cont(maybeoperatorNoComma);
13759
13654
  }
13760
- function mayberettype(type2) {
13761
- if (isTS && type2 == ":") {
13762
- if (cx.stream.match(/^\s*\w+\s+is\b/, false))
13763
- return cont(expression, isKW, typeexpr);
13764
- else
13765
- return cont(typeexpr);
13766
- }
13655
+ }
13656
+ function maybelabel(type2) {
13657
+ if (type2 == ":")
13658
+ return cont(poplex, statement);
13659
+ return pass(maybeoperatorComma, expect(";"), poplex);
13660
+ }
13661
+ function property(type2) {
13662
+ if (type2 == "variable") {
13663
+ cx.marked = "property";
13664
+ return cont();
13767
13665
  }
13768
- function isKW(_, value) {
13769
- if (value == "is") {
13770
- cx.marked = "keyword";
13771
- return cont();
13772
- }
13666
+ }
13667
+ function objprop(type2, value) {
13668
+ if (type2 == "async") {
13669
+ cx.marked = "property";
13670
+ return cont(objprop);
13671
+ } else if (type2 == "variable" || cx.style == "keyword") {
13672
+ cx.marked = "property";
13673
+ if (value == "get" || value == "set")
13674
+ return cont(getterSetter);
13675
+ var m;
13676
+ if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\s*:\s*/, false)))
13677
+ cx.state.fatArrowAt = cx.stream.pos + m[0].length;
13678
+ return cont(afterprop);
13679
+ } else if (type2 == "number" || type2 == "string") {
13680
+ cx.marked = jsonldMode ? "property" : cx.style + " property";
13681
+ return cont(afterprop);
13682
+ } else if (type2 == "jsonld-keyword") {
13683
+ return cont(afterprop);
13684
+ } else if (isTS && isModifier(value)) {
13685
+ cx.marked = "keyword";
13686
+ return cont(objprop);
13687
+ } else if (type2 == "[") {
13688
+ return cont(expression, maybetype, expect("]"), afterprop);
13689
+ } else if (type2 == "spread") {
13690
+ return cont(expressionNoComma, afterprop);
13691
+ } else if (value == "*") {
13692
+ cx.marked = "keyword";
13693
+ return cont(objprop);
13694
+ } else if (type2 == ":") {
13695
+ return pass(afterprop);
13773
13696
  }
13774
- function typeexpr(type2, value) {
13775
- if (value == "keyof" || value == "typeof" || value == "infer" || value == "readonly") {
13776
- cx.marked = "keyword";
13777
- return cont(value == "typeof" ? expressionNoComma : typeexpr);
13778
- }
13779
- if (type2 == "variable" || value == "void") {
13780
- cx.marked = "type";
13781
- return cont(afterType);
13782
- }
13783
- if (value == "|" || value == "&")
13784
- return cont(typeexpr);
13785
- if (type2 == "string" || type2 == "number" || type2 == "atom")
13786
- return cont(afterType);
13787
- if (type2 == "[")
13788
- return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType);
13789
- if (type2 == "{")
13790
- return cont(pushlex("}"), typeprops, poplex, afterType);
13791
- if (type2 == "(")
13792
- return cont(commasep(typearg, ")"), maybeReturnType, afterType);
13793
- if (type2 == "<")
13794
- return cont(commasep(typeexpr, ">"), typeexpr);
13795
- if (type2 == "quasi") {
13796
- return pass(quasiType, afterType);
13697
+ }
13698
+ function getterSetter(type2) {
13699
+ if (type2 != "variable")
13700
+ return pass(afterprop);
13701
+ cx.marked = "property";
13702
+ return cont(functiondef);
13703
+ }
13704
+ function afterprop(type2) {
13705
+ if (type2 == ":")
13706
+ return cont(expressionNoComma);
13707
+ if (type2 == "(")
13708
+ return pass(functiondef);
13709
+ }
13710
+ function commasep(what, end, sep) {
13711
+ function proceed(type2, value) {
13712
+ if (sep ? sep.indexOf(type2) > -1 : type2 == ",") {
13713
+ var lex = cx.state.lexical;
13714
+ if (lex.info == "call")
13715
+ lex.pos = (lex.pos || 0) + 1;
13716
+ return cont(function(type3, value2) {
13717
+ if (type3 == end || value2 == end)
13718
+ return pass();
13719
+ return pass(what);
13720
+ }, proceed);
13797
13721
  }
13798
- }
13799
- function maybeReturnType(type2) {
13800
- if (type2 == "=>")
13801
- return cont(typeexpr);
13802
- }
13803
- function typeprops(type2) {
13804
- if (type2.match(/[\}\)\]]/))
13722
+ if (type2 == end || value == end)
13805
13723
  return cont();
13806
- if (type2 == "," || type2 == ";")
13807
- return cont(typeprops);
13808
- return pass(typeprop, typeprops);
13809
- }
13810
- function typeprop(type2, value) {
13811
- if (type2 == "variable" || cx.style == "keyword") {
13812
- cx.marked = "property";
13813
- return cont(typeprop);
13814
- } else if (value == "?" || type2 == "number" || type2 == "string") {
13815
- return cont(typeprop);
13816
- } else if (type2 == ":") {
13817
- return cont(typeexpr);
13818
- } else if (type2 == "[") {
13819
- return cont(expect("variable"), maybetypeOrIn, expect("]"), typeprop);
13820
- } else if (type2 == "(") {
13821
- return pass(functiondecl, typeprop);
13822
- } else if (!type2.match(/[;\}\)\],]/)) {
13823
- return cont();
13824
- }
13825
- }
13826
- function quasiType(type2, value) {
13827
- if (type2 != "quasi")
13828
- return pass();
13829
- if (value.slice(value.length - 2) != "${")
13830
- return cont(quasiType);
13831
- return cont(typeexpr, continueQuasiType);
13832
- }
13833
- function continueQuasiType(type2) {
13834
- if (type2 == "}") {
13835
- cx.marked = "string-2";
13836
- cx.state.tokenize = tokenQuasi;
13837
- return cont(quasiType);
13838
- }
13724
+ if (sep && sep.indexOf(";") > -1)
13725
+ return pass(what);
13726
+ return cont(expect(end));
13839
13727
  }
13840
- function typearg(type2, value) {
13841
- if (type2 == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?")
13842
- return cont(typearg);
13728
+ return function(type2, value) {
13729
+ if (type2 == end || value == end)
13730
+ return cont();
13731
+ return pass(what, proceed);
13732
+ };
13733
+ }
13734
+ function contCommasep(what, end, info) {
13735
+ for (var i = 3; i < arguments.length; i++)
13736
+ cx.cc.push(arguments[i]);
13737
+ return cont(pushlex(end, info), commasep(what, end), poplex);
13738
+ }
13739
+ function block(type2) {
13740
+ if (type2 == "}")
13741
+ return cont();
13742
+ return pass(statement, block);
13743
+ }
13744
+ function maybetype(type2, value) {
13745
+ if (isTS) {
13843
13746
  if (type2 == ":")
13844
13747
  return cont(typeexpr);
13845
- if (type2 == "spread")
13846
- return cont(typearg);
13847
- return pass(typeexpr);
13848
- }
13849
- function afterType(type2, value) {
13850
- if (value == "<")
13851
- return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType);
13852
- if (value == "|" || type2 == "." || value == "&")
13853
- return cont(typeexpr);
13854
- if (type2 == "[")
13855
- return cont(typeexpr, expect("]"), afterType);
13856
- if (value == "extends" || value == "implements") {
13857
- cx.marked = "keyword";
13858
- return cont(typeexpr);
13859
- }
13860
13748
  if (value == "?")
13861
- return cont(typeexpr, expect(":"), typeexpr);
13749
+ return cont(maybetype);
13862
13750
  }
13863
- function maybeTypeArgs(_, value) {
13864
- if (value == "<")
13865
- return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType);
13866
- }
13867
- function typeparam() {
13868
- return pass(typeexpr, maybeTypeDefault);
13869
- }
13870
- function maybeTypeDefault(_, value) {
13871
- if (value == "=")
13751
+ }
13752
+ function maybetypeOrIn(type2, value) {
13753
+ if (isTS && (type2 == ":" || value == "in"))
13754
+ return cont(typeexpr);
13755
+ }
13756
+ function mayberettype(type2) {
13757
+ if (isTS && type2 == ":") {
13758
+ if (cx.stream.match(/^\s*\w+\s+is\b/, false))
13759
+ return cont(expression, isKW, typeexpr);
13760
+ else
13872
13761
  return cont(typeexpr);
13873
13762
  }
13874
- function vardef(_, value) {
13875
- if (value == "enum") {
13876
- cx.marked = "keyword";
13877
- return cont(enumdef);
13878
- }
13879
- return pass(pattern, maybetype, maybeAssign, vardefCont);
13880
- }
13881
- function pattern(type2, value) {
13882
- if (isTS && isModifier(value)) {
13883
- cx.marked = "keyword";
13884
- return cont(pattern);
13885
- }
13886
- if (type2 == "variable") {
13887
- register(value);
13888
- return cont();
13889
- }
13890
- if (type2 == "spread")
13891
- return cont(pattern);
13892
- if (type2 == "[")
13893
- return contCommasep(eltpattern, "]");
13894
- if (type2 == "{")
13895
- return contCommasep(proppattern, "}");
13896
- }
13897
- function proppattern(type2, value) {
13898
- if (type2 == "variable" && !cx.stream.match(/^\s*:/, false)) {
13899
- register(value);
13900
- return cont(maybeAssign);
13901
- }
13902
- if (type2 == "variable")
13903
- cx.marked = "property";
13904
- if (type2 == "spread")
13905
- return cont(pattern);
13906
- if (type2 == "}")
13907
- return pass();
13908
- if (type2 == "[")
13909
- return cont(expression, expect("]"), expect(":"), proppattern);
13910
- return cont(expect(":"), pattern, maybeAssign);
13911
- }
13912
- function eltpattern() {
13913
- return pass(pattern, maybeAssign);
13914
- }
13915
- function maybeAssign(_type, value) {
13916
- if (value == "=")
13917
- return cont(expressionNoComma);
13918
- }
13919
- function vardefCont(type2) {
13920
- if (type2 == ",")
13921
- return cont(vardef);
13922
- }
13923
- function maybeelse(type2, value) {
13924
- if (type2 == "keyword b" && value == "else")
13925
- return cont(pushlex("form", "else"), statement, poplex);
13926
- }
13927
- function forspec(type2, value) {
13928
- if (value == "await")
13929
- return cont(forspec);
13930
- if (type2 == "(")
13931
- return cont(pushlex(")"), forspec1, poplex);
13763
+ }
13764
+ function isKW(_, value) {
13765
+ if (value == "is") {
13766
+ cx.marked = "keyword";
13767
+ return cont();
13932
13768
  }
13933
- function forspec1(type2) {
13934
- if (type2 == "var")
13935
- return cont(vardef, forspec2);
13936
- if (type2 == "variable")
13937
- return cont(forspec2);
13938
- return pass(forspec2);
13769
+ }
13770
+ function typeexpr(type2, value) {
13771
+ if (value == "keyof" || value == "typeof" || value == "infer" || value == "readonly") {
13772
+ cx.marked = "keyword";
13773
+ return cont(value == "typeof" ? expressionNoComma : typeexpr);
13939
13774
  }
13940
- function forspec2(type2, value) {
13941
- if (type2 == ")")
13942
- return cont();
13943
- if (type2 == ";")
13944
- return cont(forspec2);
13945
- if (value == "in" || value == "of") {
13946
- cx.marked = "keyword";
13947
- return cont(expression, forspec2);
13948
- }
13949
- return pass(expression, forspec2);
13775
+ if (type2 == "variable" || value == "void") {
13776
+ cx.marked = "type";
13777
+ return cont(afterType);
13950
13778
  }
13951
- function functiondef(type2, value) {
13952
- if (value == "*") {
13953
- cx.marked = "keyword";
13954
- return cont(functiondef);
13955
- }
13956
- if (type2 == "variable") {
13957
- register(value);
13958
- return cont(functiondef);
13959
- }
13960
- if (type2 == "(")
13961
- return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext);
13962
- if (isTS && value == "<")
13963
- return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef);
13779
+ if (value == "|" || value == "&")
13780
+ return cont(typeexpr);
13781
+ if (type2 == "string" || type2 == "number" || type2 == "atom")
13782
+ return cont(afterType);
13783
+ if (type2 == "[")
13784
+ return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType);
13785
+ if (type2 == "{")
13786
+ return cont(pushlex("}"), typeprops, poplex, afterType);
13787
+ if (type2 == "(")
13788
+ return cont(commasep(typearg, ")"), maybeReturnType, afterType);
13789
+ if (type2 == "<")
13790
+ return cont(commasep(typeexpr, ">"), typeexpr);
13791
+ if (type2 == "quasi") {
13792
+ return pass(quasiType, afterType);
13964
13793
  }
13965
- function functiondecl(type2, value) {
13966
- if (value == "*") {
13967
- cx.marked = "keyword";
13968
- return cont(functiondecl);
13969
- }
13970
- if (type2 == "variable") {
13971
- register(value);
13972
- return cont(functiondecl);
13973
- }
13974
- if (type2 == "(")
13975
- return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, popcontext);
13976
- if (isTS && value == "<")
13977
- return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondecl);
13978
- }
13979
- function typename(type2, value) {
13980
- if (type2 == "keyword" || type2 == "variable") {
13981
- cx.marked = "type";
13982
- return cont(typename);
13983
- } else if (value == "<") {
13984
- return cont(pushlex(">"), commasep(typeparam, ">"), poplex);
13985
- }
13986
- }
13987
- function funarg(type2, value) {
13988
- if (value == "@")
13989
- cont(expression, funarg);
13990
- if (type2 == "spread")
13991
- return cont(funarg);
13992
- if (isTS && isModifier(value)) {
13993
- cx.marked = "keyword";
13994
- return cont(funarg);
13995
- }
13996
- if (isTS && type2 == "this")
13997
- return cont(maybetype, maybeAssign);
13998
- return pass(pattern, maybetype, maybeAssign);
13794
+ }
13795
+ function maybeReturnType(type2) {
13796
+ if (type2 == "=>")
13797
+ return cont(typeexpr);
13798
+ }
13799
+ function typeprops(type2) {
13800
+ if (type2.match(/[\}\)\]]/))
13801
+ return cont();
13802
+ if (type2 == "," || type2 == ";")
13803
+ return cont(typeprops);
13804
+ return pass(typeprop, typeprops);
13805
+ }
13806
+ function typeprop(type2, value) {
13807
+ if (type2 == "variable" || cx.style == "keyword") {
13808
+ cx.marked = "property";
13809
+ return cont(typeprop);
13810
+ } else if (value == "?" || type2 == "number" || type2 == "string") {
13811
+ return cont(typeprop);
13812
+ } else if (type2 == ":") {
13813
+ return cont(typeexpr);
13814
+ } else if (type2 == "[") {
13815
+ return cont(expect("variable"), maybetypeOrIn, expect("]"), typeprop);
13816
+ } else if (type2 == "(") {
13817
+ return pass(functiondecl, typeprop);
13818
+ } else if (!type2.match(/[;\}\)\],]/)) {
13819
+ return cont();
13999
13820
  }
14000
- function classExpression(type2, value) {
14001
- if (type2 == "variable")
14002
- return className(type2, value);
14003
- return classNameAfter(type2, value);
13821
+ }
13822
+ function quasiType(type2, value) {
13823
+ if (type2 != "quasi")
13824
+ return pass();
13825
+ if (value.slice(value.length - 2) != "${")
13826
+ return cont(quasiType);
13827
+ return cont(typeexpr, continueQuasiType);
13828
+ }
13829
+ function continueQuasiType(type2) {
13830
+ if (type2 == "}") {
13831
+ cx.marked = "string-2";
13832
+ cx.state.tokenize = tokenQuasi;
13833
+ return cont(quasiType);
14004
13834
  }
14005
- function className(type2, value) {
14006
- if (type2 == "variable") {
14007
- register(value);
14008
- return cont(classNameAfter);
14009
- }
13835
+ }
13836
+ function typearg(type2, value) {
13837
+ if (type2 == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?")
13838
+ return cont(typearg);
13839
+ if (type2 == ":")
13840
+ return cont(typeexpr);
13841
+ if (type2 == "spread")
13842
+ return cont(typearg);
13843
+ return pass(typeexpr);
13844
+ }
13845
+ function afterType(type2, value) {
13846
+ if (value == "<")
13847
+ return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType);
13848
+ if (value == "|" || type2 == "." || value == "&")
13849
+ return cont(typeexpr);
13850
+ if (type2 == "[")
13851
+ return cont(typeexpr, expect("]"), afterType);
13852
+ if (value == "extends" || value == "implements") {
13853
+ cx.marked = "keyword";
13854
+ return cont(typeexpr);
13855
+ }
13856
+ if (value == "?")
13857
+ return cont(typeexpr, expect(":"), typeexpr);
13858
+ }
13859
+ function maybeTypeArgs(_, value) {
13860
+ if (value == "<")
13861
+ return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType);
13862
+ }
13863
+ function typeparam() {
13864
+ return pass(typeexpr, maybeTypeDefault);
13865
+ }
13866
+ function maybeTypeDefault(_, value) {
13867
+ if (value == "=")
13868
+ return cont(typeexpr);
13869
+ }
13870
+ function vardef(_, value) {
13871
+ if (value == "enum") {
13872
+ cx.marked = "keyword";
13873
+ return cont(enumdef);
13874
+ }
13875
+ return pass(pattern, maybetype, maybeAssign, vardefCont);
13876
+ }
13877
+ function pattern(type2, value) {
13878
+ if (isTS && isModifier(value)) {
13879
+ cx.marked = "keyword";
13880
+ return cont(pattern);
13881
+ }
13882
+ if (type2 == "variable") {
13883
+ register(value);
13884
+ return cont();
14010
13885
  }
14011
- function classNameAfter(type2, value) {
14012
- if (value == "<")
14013
- return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter);
14014
- if (value == "extends" || value == "implements" || isTS && type2 == ",") {
14015
- if (value == "implements")
14016
- cx.marked = "keyword";
14017
- return cont(isTS ? typeexpr : expression, classNameAfter);
14018
- }
14019
- if (type2 == "{")
14020
- return cont(pushlex("}"), classBody, poplex);
13886
+ if (type2 == "spread")
13887
+ return cont(pattern);
13888
+ if (type2 == "[")
13889
+ return contCommasep(eltpattern, "]");
13890
+ if (type2 == "{")
13891
+ return contCommasep(proppattern, "}");
13892
+ }
13893
+ function proppattern(type2, value) {
13894
+ if (type2 == "variable" && !cx.stream.match(/^\s*:/, false)) {
13895
+ register(value);
13896
+ return cont(maybeAssign);
14021
13897
  }
14022
- function classBody(type2, value) {
14023
- if (type2 == "async" || type2 == "variable" && (value == "static" || value == "get" || value == "set" || isTS && isModifier(value)) && cx.stream.match(/^\s+#?[\w$\xa1-\uffff]/, false)) {
14024
- cx.marked = "keyword";
14025
- return cont(classBody);
14026
- }
14027
- if (type2 == "variable" || cx.style == "keyword") {
14028
- cx.marked = "property";
14029
- return cont(classfield, classBody);
14030
- }
14031
- if (type2 == "number" || type2 == "string")
14032
- return cont(classfield, classBody);
14033
- if (type2 == "[")
14034
- return cont(expression, maybetype, expect("]"), classfield, classBody);
14035
- if (value == "*") {
14036
- cx.marked = "keyword";
14037
- return cont(classBody);
14038
- }
14039
- if (isTS && type2 == "(")
14040
- return pass(functiondecl, classBody);
14041
- if (type2 == ";" || type2 == ",")
14042
- return cont(classBody);
14043
- if (type2 == "}")
14044
- return cont();
14045
- if (value == "@")
14046
- return cont(expression, classBody);
13898
+ if (type2 == "variable")
13899
+ cx.marked = "property";
13900
+ if (type2 == "spread")
13901
+ return cont(pattern);
13902
+ if (type2 == "}")
13903
+ return pass();
13904
+ if (type2 == "[")
13905
+ return cont(expression, expect("]"), expect(":"), proppattern);
13906
+ return cont(expect(":"), pattern, maybeAssign);
13907
+ }
13908
+ function eltpattern() {
13909
+ return pass(pattern, maybeAssign);
13910
+ }
13911
+ function maybeAssign(_type, value) {
13912
+ if (value == "=")
13913
+ return cont(expressionNoComma);
13914
+ }
13915
+ function vardefCont(type2) {
13916
+ if (type2 == ",")
13917
+ return cont(vardef);
13918
+ }
13919
+ function maybeelse(type2, value) {
13920
+ if (type2 == "keyword b" && value == "else")
13921
+ return cont(pushlex("form", "else"), statement, poplex);
13922
+ }
13923
+ function forspec(type2, value) {
13924
+ if (value == "await")
13925
+ return cont(forspec);
13926
+ if (type2 == "(")
13927
+ return cont(pushlex(")"), forspec1, poplex);
13928
+ }
13929
+ function forspec1(type2) {
13930
+ if (type2 == "var")
13931
+ return cont(vardef, forspec2);
13932
+ if (type2 == "variable")
13933
+ return cont(forspec2);
13934
+ return pass(forspec2);
13935
+ }
13936
+ function forspec2(type2, value) {
13937
+ if (type2 == ")")
13938
+ return cont();
13939
+ if (type2 == ";")
13940
+ return cont(forspec2);
13941
+ if (value == "in" || value == "of") {
13942
+ cx.marked = "keyword";
13943
+ return cont(expression, forspec2);
14047
13944
  }
14048
- function classfield(type2, value) {
14049
- if (value == "!")
14050
- return cont(classfield);
14051
- if (value == "?")
14052
- return cont(classfield);
14053
- if (type2 == ":")
14054
- return cont(typeexpr, maybeAssign);
14055
- if (value == "=")
14056
- return cont(expressionNoComma);
14057
- var context = cx.state.lexical.prev, isInterface = context && context.info == "interface";
14058
- return pass(isInterface ? functiondecl : functiondef);
14059
- }
14060
- function afterExport(type2, value) {
14061
- if (value == "*") {
14062
- cx.marked = "keyword";
14063
- return cont(maybeFrom, expect(";"));
14064
- }
14065
- if (value == "default") {
14066
- cx.marked = "keyword";
14067
- return cont(expression, expect(";"));
14068
- }
14069
- if (type2 == "{")
14070
- return cont(commasep(exportField, "}"), maybeFrom, expect(";"));
14071
- return pass(statement);
13945
+ return pass(expression, forspec2);
13946
+ }
13947
+ function functiondef(type2, value) {
13948
+ if (value == "*") {
13949
+ cx.marked = "keyword";
13950
+ return cont(functiondef);
14072
13951
  }
14073
- function exportField(type2, value) {
14074
- if (value == "as") {
14075
- cx.marked = "keyword";
14076
- return cont(expect("variable"));
14077
- }
14078
- if (type2 == "variable")
14079
- return pass(expressionNoComma, exportField);
13952
+ if (type2 == "variable") {
13953
+ register(value);
13954
+ return cont(functiondef);
14080
13955
  }
14081
- function afterImport(type2) {
14082
- if (type2 == "string")
14083
- return cont();
14084
- if (type2 == "(")
14085
- return pass(expression);
14086
- if (type2 == ".")
14087
- return pass(maybeoperatorComma);
14088
- return pass(importSpec, maybeMoreImports, maybeFrom);
14089
- }
14090
- function importSpec(type2, value) {
14091
- if (type2 == "{")
14092
- return contCommasep(importSpec, "}");
14093
- if (type2 == "variable")
14094
- register(value);
14095
- if (value == "*")
14096
- cx.marked = "keyword";
14097
- return cont(maybeAs);
13956
+ if (type2 == "(")
13957
+ return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext);
13958
+ if (isTS && value == "<")
13959
+ return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef);
13960
+ }
13961
+ function functiondecl(type2, value) {
13962
+ if (value == "*") {
13963
+ cx.marked = "keyword";
13964
+ return cont(functiondecl);
14098
13965
  }
14099
- function maybeMoreImports(type2) {
14100
- if (type2 == ",")
14101
- return cont(importSpec, maybeMoreImports);
13966
+ if (type2 == "variable") {
13967
+ register(value);
13968
+ return cont(functiondecl);
14102
13969
  }
14103
- function maybeAs(_type, value) {
14104
- if (value == "as") {
13970
+ if (type2 == "(")
13971
+ return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, popcontext);
13972
+ if (isTS && value == "<")
13973
+ return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondecl);
13974
+ }
13975
+ function typename(type2, value) {
13976
+ if (type2 == "keyword" || type2 == "variable") {
13977
+ cx.marked = "type";
13978
+ return cont(typename);
13979
+ } else if (value == "<") {
13980
+ return cont(pushlex(">"), commasep(typeparam, ">"), poplex);
13981
+ }
13982
+ }
13983
+ function funarg(type2, value) {
13984
+ if (value == "@")
13985
+ cont(expression, funarg);
13986
+ if (type2 == "spread")
13987
+ return cont(funarg);
13988
+ if (isTS && isModifier(value)) {
13989
+ cx.marked = "keyword";
13990
+ return cont(funarg);
13991
+ }
13992
+ if (isTS && type2 == "this")
13993
+ return cont(maybetype, maybeAssign);
13994
+ return pass(pattern, maybetype, maybeAssign);
13995
+ }
13996
+ function classExpression(type2, value) {
13997
+ if (type2 == "variable")
13998
+ return className(type2, value);
13999
+ return classNameAfter(type2, value);
14000
+ }
14001
+ function className(type2, value) {
14002
+ if (type2 == "variable") {
14003
+ register(value);
14004
+ return cont(classNameAfter);
14005
+ }
14006
+ }
14007
+ function classNameAfter(type2, value) {
14008
+ if (value == "<")
14009
+ return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter);
14010
+ if (value == "extends" || value == "implements" || isTS && type2 == ",") {
14011
+ if (value == "implements")
14105
14012
  cx.marked = "keyword";
14106
- return cont(importSpec);
14107
- }
14013
+ return cont(isTS ? typeexpr : expression, classNameAfter);
14108
14014
  }
14109
- function maybeFrom(_type, value) {
14110
- if (value == "from") {
14111
- cx.marked = "keyword";
14112
- return cont(expression);
14113
- }
14015
+ if (type2 == "{")
14016
+ return cont(pushlex("}"), classBody, poplex);
14017
+ }
14018
+ function classBody(type2, value) {
14019
+ if (type2 == "async" || type2 == "variable" && (value == "static" || value == "get" || value == "set" || isTS && isModifier(value)) && cx.stream.match(/^\s+#?[\w$\xa1-\uffff]/, false)) {
14020
+ cx.marked = "keyword";
14021
+ return cont(classBody);
14114
14022
  }
14115
- function arrayLiteral(type2) {
14116
- if (type2 == "]")
14117
- return cont();
14118
- return pass(commasep(expressionNoComma, "]"));
14023
+ if (type2 == "variable" || cx.style == "keyword") {
14024
+ cx.marked = "property";
14025
+ return cont(classfield, classBody);
14026
+ }
14027
+ if (type2 == "number" || type2 == "string")
14028
+ return cont(classfield, classBody);
14029
+ if (type2 == "[")
14030
+ return cont(expression, maybetype, expect("]"), classfield, classBody);
14031
+ if (value == "*") {
14032
+ cx.marked = "keyword";
14033
+ return cont(classBody);
14034
+ }
14035
+ if (isTS && type2 == "(")
14036
+ return pass(functiondecl, classBody);
14037
+ if (type2 == ";" || type2 == ",")
14038
+ return cont(classBody);
14039
+ if (type2 == "}")
14040
+ return cont();
14041
+ if (value == "@")
14042
+ return cont(expression, classBody);
14043
+ }
14044
+ function classfield(type2, value) {
14045
+ if (value == "!")
14046
+ return cont(classfield);
14047
+ if (value == "?")
14048
+ return cont(classfield);
14049
+ if (type2 == ":")
14050
+ return cont(typeexpr, maybeAssign);
14051
+ if (value == "=")
14052
+ return cont(expressionNoComma);
14053
+ var context = cx.state.lexical.prev, isInterface = context && context.info == "interface";
14054
+ return pass(isInterface ? functiondecl : functiondef);
14055
+ }
14056
+ function afterExport(type2, value) {
14057
+ if (value == "*") {
14058
+ cx.marked = "keyword";
14059
+ return cont(maybeFrom, expect(";"));
14119
14060
  }
14120
- function enumdef() {
14121
- return pass(pushlex("form"), pattern, expect("{"), pushlex("}"), commasep(enummember, "}"), poplex, poplex);
14061
+ if (value == "default") {
14062
+ cx.marked = "keyword";
14063
+ return cont(expression, expect(";"));
14122
14064
  }
14123
- function enummember() {
14124
- return pass(pattern, maybeAssign);
14065
+ if (type2 == "{")
14066
+ return cont(commasep(exportField, "}"), maybeFrom, expect(";"));
14067
+ return pass(statement);
14068
+ }
14069
+ function exportField(type2, value) {
14070
+ if (value == "as") {
14071
+ cx.marked = "keyword";
14072
+ return cont(expect("variable"));
14125
14073
  }
14126
- function isContinuedStatement(state, textAfter) {
14127
- return state.lastType == "operator" || state.lastType == "," || isOperatorChar.test(textAfter.charAt(0)) || /[,.]/.test(textAfter.charAt(0));
14074
+ if (type2 == "variable")
14075
+ return pass(expressionNoComma, exportField);
14076
+ }
14077
+ function afterImport(type2) {
14078
+ if (type2 == "string")
14079
+ return cont();
14080
+ if (type2 == "(")
14081
+ return pass(expression);
14082
+ if (type2 == ".")
14083
+ return pass(maybeoperatorComma);
14084
+ return pass(importSpec, maybeMoreImports, maybeFrom);
14085
+ }
14086
+ function importSpec(type2, value) {
14087
+ if (type2 == "{")
14088
+ return contCommasep(importSpec, "}");
14089
+ if (type2 == "variable")
14090
+ register(value);
14091
+ if (value == "*")
14092
+ cx.marked = "keyword";
14093
+ return cont(maybeAs);
14094
+ }
14095
+ function maybeMoreImports(type2) {
14096
+ if (type2 == ",")
14097
+ return cont(importSpec, maybeMoreImports);
14098
+ }
14099
+ function maybeAs(_type, value) {
14100
+ if (value == "as") {
14101
+ cx.marked = "keyword";
14102
+ return cont(importSpec);
14128
14103
  }
14129
- function expressionAllowed(stream, state, backUp) {
14130
- return state.tokenize == tokenBase && /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(state.lastType) || state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0)));
14104
+ }
14105
+ function maybeFrom(_type, value) {
14106
+ if (value == "from") {
14107
+ cx.marked = "keyword";
14108
+ return cont(expression);
14131
14109
  }
14132
- return {
14133
- startState: function(basecolumn) {
14134
- var state = {
14135
- tokenize: tokenBase,
14136
- lastType: "sof",
14137
- cc: [],
14138
- lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
14139
- localVars: parserConfig.localVars,
14140
- context: parserConfig.localVars && new Context(null, null, false),
14141
- indented: basecolumn || 0
14142
- };
14143
- if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
14144
- state.globalVars = parserConfig.globalVars;
14145
- return state;
14146
- },
14147
- token: function(stream, state) {
14148
- if (stream.sol()) {
14149
- if (!state.lexical.hasOwnProperty("align"))
14150
- state.lexical.align = false;
14151
- state.indented = stream.indentation();
14152
- findFatArrow(stream, state);
14153
- }
14154
- if (state.tokenize != tokenComment && stream.eatSpace())
14155
- return null;
14156
- var style = state.tokenize(stream, state);
14157
- if (type == "comment")
14158
- return style;
14159
- state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type;
14160
- return parseJS(state, style, type, content, stream);
14161
- },
14162
- indent: function(state, textAfter) {
14163
- if (state.tokenize == tokenComment || state.tokenize == tokenQuasi)
14164
- return CodeMirror.Pass;
14165
- if (state.tokenize != tokenBase)
14166
- return 0;
14167
- var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top;
14168
- if (!/^\s*else\b/.test(textAfter))
14169
- for (var i = state.cc.length - 1; i >= 0; --i) {
14170
- var c = state.cc[i];
14171
- if (c == poplex)
14172
- lexical = lexical.prev;
14173
- else if (c != maybeelse && c != popcontext)
14174
- break;
14175
- }
14176
- while ((lexical.type == "stat" || lexical.type == "form") && (firstChar == "}" || (top = state.cc[state.cc.length - 1]) && (top == maybeoperatorComma || top == maybeoperatorNoComma) && !/^[,\.=+\-*:?[\(]/.test(textAfter)))
14177
- lexical = lexical.prev;
14178
- if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat")
14179
- lexical = lexical.prev;
14180
- var type2 = lexical.type, closing = firstChar == type2;
14181
- if (type2 == "vardef")
14182
- return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info.length + 1 : 0);
14183
- else if (type2 == "form" && firstChar == "{")
14184
- return lexical.indented;
14185
- else if (type2 == "form")
14186
- return lexical.indented + indentUnit;
14187
- else if (type2 == "stat")
14188
- return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);
14189
- else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false)
14190
- return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
14191
- else if (lexical.align)
14192
- return lexical.column + (closing ? 0 : 1);
14193
- else
14194
- return lexical.indented + (closing ? 0 : indentUnit);
14195
- },
14196
- electricInput: /^\s*(?:case .*?:|default:|\{|\})$/,
14197
- blockCommentStart: jsonMode ? null : "/*",
14198
- blockCommentEnd: jsonMode ? null : "*/",
14199
- blockCommentContinue: jsonMode ? null : " * ",
14200
- lineComment: jsonMode ? null : "//",
14201
- fold: "brace",
14202
- closeBrackets: "()[]{}''\"\"``",
14203
- helperType: jsonMode ? "json" : "javascript",
14204
- jsonldMode,
14205
- jsonMode,
14206
- expressionAllowed,
14207
- skipExpression: function(state) {
14208
- parseJS(state, "atom", "atom", "true", new CodeMirror.StringStream("", 2, null));
14110
+ }
14111
+ function arrayLiteral(type2) {
14112
+ if (type2 == "]")
14113
+ return cont();
14114
+ return pass(commasep(expressionNoComma, "]"));
14115
+ }
14116
+ function enumdef() {
14117
+ return pass(pushlex("form"), pattern, expect("{"), pushlex("}"), commasep(enummember, "}"), poplex, poplex);
14118
+ }
14119
+ function enummember() {
14120
+ return pass(pattern, maybeAssign);
14121
+ }
14122
+ function isContinuedStatement(state, textAfter) {
14123
+ return state.lastType == "operator" || state.lastType == "," || isOperatorChar.test(textAfter.charAt(0)) || /[,.]/.test(textAfter.charAt(0));
14124
+ }
14125
+ function expressionAllowed(stream, state, backUp) {
14126
+ return state.tokenize == tokenBase && /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(state.lastType) || state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0)));
14127
+ }
14128
+ return {
14129
+ startState: function(basecolumn) {
14130
+ var state = {
14131
+ tokenize: tokenBase,
14132
+ lastType: "sof",
14133
+ cc: [],
14134
+ lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
14135
+ localVars: parserConfig.localVars,
14136
+ context: parserConfig.localVars && new Context(null, null, false),
14137
+ indented: basecolumn || 0
14138
+ };
14139
+ if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
14140
+ state.globalVars = parserConfig.globalVars;
14141
+ return state;
14142
+ },
14143
+ token: function(stream, state) {
14144
+ if (stream.sol()) {
14145
+ if (!state.lexical.hasOwnProperty("align"))
14146
+ state.lexical.align = false;
14147
+ state.indented = stream.indentation();
14148
+ findFatArrow(stream, state);
14209
14149
  }
14210
- };
14211
- });
14212
- CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/);
14213
- CodeMirror.defineMIME("text/javascript", "javascript");
14214
- CodeMirror.defineMIME("text/ecmascript", "javascript");
14215
- CodeMirror.defineMIME("application/javascript", "javascript");
14216
- CodeMirror.defineMIME("application/x-javascript", "javascript");
14217
- CodeMirror.defineMIME("application/ecmascript", "javascript");
14218
- CodeMirror.defineMIME("application/json", { name: "javascript", json: true });
14219
- CodeMirror.defineMIME("application/x-json", { name: "javascript", json: true });
14220
- CodeMirror.defineMIME("application/manifest+json", { name: "javascript", json: true });
14221
- CodeMirror.defineMIME("application/ld+json", { name: "javascript", jsonld: true });
14222
- CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });
14223
- CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });
14150
+ if (state.tokenize != tokenComment && stream.eatSpace())
14151
+ return null;
14152
+ var style = state.tokenize(stream, state);
14153
+ if (type == "comment")
14154
+ return style;
14155
+ state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type;
14156
+ return parseJS(state, style, type, content, stream);
14157
+ },
14158
+ indent: function(state, textAfter) {
14159
+ if (state.tokenize == tokenComment || state.tokenize == tokenQuasi)
14160
+ return CodeMirror.Pass;
14161
+ if (state.tokenize != tokenBase)
14162
+ return 0;
14163
+ var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top;
14164
+ if (!/^\s*else\b/.test(textAfter))
14165
+ for (var i = state.cc.length - 1; i >= 0; --i) {
14166
+ var c = state.cc[i];
14167
+ if (c == poplex)
14168
+ lexical = lexical.prev;
14169
+ else if (c != maybeelse && c != popcontext)
14170
+ break;
14171
+ }
14172
+ while ((lexical.type == "stat" || lexical.type == "form") && (firstChar == "}" || (top = state.cc[state.cc.length - 1]) && (top == maybeoperatorComma || top == maybeoperatorNoComma) && !/^[,\.=+\-*:?[\(]/.test(textAfter)))
14173
+ lexical = lexical.prev;
14174
+ if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat")
14175
+ lexical = lexical.prev;
14176
+ var type2 = lexical.type, closing = firstChar == type2;
14177
+ if (type2 == "vardef")
14178
+ return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info.length + 1 : 0);
14179
+ else if (type2 == "form" && firstChar == "{")
14180
+ return lexical.indented;
14181
+ else if (type2 == "form")
14182
+ return lexical.indented + indentUnit;
14183
+ else if (type2 == "stat")
14184
+ return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);
14185
+ else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false)
14186
+ return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
14187
+ else if (lexical.align)
14188
+ return lexical.column + (closing ? 0 : 1);
14189
+ else
14190
+ return lexical.indented + (closing ? 0 : indentUnit);
14191
+ },
14192
+ electricInput: /^\s*(?:case .*?:|default:|\{|\})$/,
14193
+ blockCommentStart: jsonMode ? null : "/*",
14194
+ blockCommentEnd: jsonMode ? null : "*/",
14195
+ blockCommentContinue: jsonMode ? null : " * ",
14196
+ lineComment: jsonMode ? null : "//",
14197
+ fold: "brace",
14198
+ closeBrackets: "()[]{}''\"\"``",
14199
+ helperType: jsonMode ? "json" : "javascript",
14200
+ jsonldMode,
14201
+ jsonMode,
14202
+ expressionAllowed,
14203
+ skipExpression: function(state) {
14204
+ parseJS(state, "atom", "atom", "true", new CodeMirror.StringStream("", 2, null));
14205
+ }
14206
+ };
14224
14207
  });
14225
- })();
14226
- return javascript.exports;
14227
- }
14208
+ CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/);
14209
+ CodeMirror.defineMIME("text/javascript", "javascript");
14210
+ CodeMirror.defineMIME("text/ecmascript", "javascript");
14211
+ CodeMirror.defineMIME("application/javascript", "javascript");
14212
+ CodeMirror.defineMIME("application/x-javascript", "javascript");
14213
+ CodeMirror.defineMIME("application/ecmascript", "javascript");
14214
+ CodeMirror.defineMIME("application/json", { name: "javascript", json: true });
14215
+ CodeMirror.defineMIME("application/x-json", { name: "javascript", json: true });
14216
+ CodeMirror.defineMIME("application/manifest+json", { name: "javascript", json: true });
14217
+ CodeMirror.defineMIME("application/ld+json", { name: "javascript", jsonld: true });
14218
+ CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });
14219
+ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });
14220
+ });
14221
+ })();
14222
+ var javascriptExports = javascript.exports;
14228
14223
  (function(module, exports) {
14229
14224
  (function(mod) {
14230
- mod(requireCodemirror(), requireXml(), requireJavascript(), cssExports);
14225
+ mod(requireCodemirror(), requireXml(), javascriptExports, cssExports);
14231
14226
  })(function(CodeMirror) {
14232
14227
  var defaultTags = {
14233
14228
  script: [
@@ -14363,7 +14358,6 @@ function requireJavascript() {
14363
14358
  CodeMirror.defineMIME("text/html", "htmlmixed");
14364
14359
  });
14365
14360
  })();
14366
- requireJavascript();
14367
14361
  (function(module, exports) {
14368
14362
  (function(mod) {
14369
14363
  mod(requireCodemirror());
@@ -15579,1253 +15573,7 @@ requireJavascript();
15579
15573
  });
15580
15574
  });
15581
15575
  })();
15582
- var meta = { exports: {} };
15583
- var hasRequiredMeta;
15584
- function requireMeta() {
15585
- if (hasRequiredMeta)
15586
- return meta.exports;
15587
- hasRequiredMeta = 1;
15588
- (function(module, exports) {
15589
- (function(mod) {
15590
- mod(requireCodemirror());
15591
- })(function(CodeMirror) {
15592
- CodeMirror.modeInfo = [
15593
- { name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"] },
15594
- { name: "PGP", mimes: ["application/pgp", "application/pgp-encrypted", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["asc", "pgp", "sig"] },
15595
- { name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn", "asn1"] },
15596
- { name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i },
15597
- { name: "Brainfuck", mime: "text/x-brainfuck", mode: "brainfuck", ext: ["b", "bf"] },
15598
- { name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h", "ino"] },
15599
- { name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"] },
15600
- { name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy", "cbl"] },
15601
- { name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp", "cs"] },
15602
- { name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj", "cljc", "cljx"] },
15603
- { name: "ClojureScript", mime: "text/x-clojurescript", mode: "clojure", ext: ["cljs"] },
15604
- { name: "Closure Stylesheets (GSS)", mime: "text/x-gss", mode: "css", ext: ["gss"] },
15605
- { name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists\.txt$/ },
15606
- { name: "CoffeeScript", mimes: ["application/vnd.coffeescript", "text/coffeescript", "text/x-coffeescript"], mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"] },
15607
- { name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"] },
15608
- { name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"] },
15609
- { name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"] },
15610
- { name: "Crystal", mime: "text/x-crystal", mode: "crystal", ext: ["cr"] },
15611
- { name: "CSS", mime: "text/css", mode: "css", ext: ["css"] },
15612
- { name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"] },
15613
- { name: "D", mime: "text/x-d", mode: "d", ext: ["d"] },
15614
- { name: "Dart", mimes: ["application/dart", "text/x-dart"], mode: "dart", ext: ["dart"] },
15615
- { name: "diff", mime: "text/x-diff", mode: "diff", ext: ["diff", "patch"] },
15616
- { name: "Django", mime: "text/x-django", mode: "django" },
15617
- { name: "Dockerfile", mime: "text/x-dockerfile", mode: "dockerfile", file: /^Dockerfile$/ },
15618
- { name: "DTD", mime: "application/xml-dtd", mode: "dtd", ext: ["dtd"] },
15619
- { name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"] },
15620
- { name: "EBNF", mime: "text/x-ebnf", mode: "ebnf" },
15621
- { name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"] },
15622
- { name: "edn", mime: "application/edn", mode: "clojure", ext: ["edn"] },
15623
- { name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"] },
15624
- { name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"] },
15625
- { name: "Embedded JavaScript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"] },
15626
- { name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"] },
15627
- { name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"] },
15628
- { name: "Esper", mime: "text/x-esper", mode: "sql" },
15629
- { name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"] },
15630
- { name: "FCL", mime: "text/x-fcl", mode: "fcl" },
15631
- { name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"] },
15632
- { name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90", "f95"] },
15633
- { name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"] },
15634
- { name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"] },
15635
- { name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"] },
15636
- { name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history)\.md$/i },
15637
- { name: "Go", mime: "text/x-go", mode: "go", ext: ["go"] },
15638
- { name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy", "gradle"], file: /^Jenkinsfile$/ },
15639
- { name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"] },
15640
- { name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"] },
15641
- { name: "Haskell (Literate)", mime: "text/x-literate-haskell", mode: "haskell-literate", ext: ["lhs"] },
15642
- { name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"] },
15643
- { name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"] },
15644
- { name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"] },
15645
- { name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm", "handlebars", "hbs"], alias: ["xhtml"] },
15646
- { name: "HTTP", mime: "message/http", mode: "http" },
15647
- { name: "IDL", mime: "text/x-idl", mode: "idl", ext: ["pro"] },
15648
- { name: "Pug", mime: "text/x-pug", mode: "pug", ext: ["jade", "pug"], alias: ["jade"] },
15649
- { name: "Java", mime: "text/x-java", mode: "clike", ext: ["java"] },
15650
- { name: "Java Server Pages", mime: "application/x-jsp", mode: "htmlembedded", ext: ["jsp"], alias: ["jsp"] },
15651
- {
15652
- name: "JavaScript",
15653
- mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"],
15654
- mode: "javascript",
15655
- ext: ["js"],
15656
- alias: ["ecmascript", "js", "node"]
15657
- },
15658
- { name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"] },
15659
- { name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"] },
15660
- { name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"] },
15661
- { name: "Jinja2", mime: "text/jinja2", mode: "jinja2", ext: ["j2", "jinja", "jinja2"] },
15662
- { name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"], alias: ["jl"] },
15663
- { name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"] },
15664
- { name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"] },
15665
- { name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"] },
15666
- { name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"] },
15667
- { name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"] },
15668
- { name: "mIRC", mime: "text/mirc", mode: "mirc" },
15669
- { name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql" },
15670
- { name: "Mathematica", mime: "text/x-mathematica", mode: "mathematica", ext: ["m", "nb", "wl", "wls"] },
15671
- { name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"] },
15672
- { name: "MUMPS", mime: "text/x-mumps", mode: "mumps", ext: ["mps"] },
15673
- { name: "MS SQL", mime: "text/x-mssql", mode: "sql" },
15674
- { name: "mbox", mime: "application/mbox", mode: "mbox", ext: ["mbox"] },
15675
- { name: "MySQL", mime: "text/x-mysql", mode: "sql" },
15676
- { name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i },
15677
- { name: "NSIS", mime: "text/x-nsis", mode: "nsis", ext: ["nsh", "nsi"] },
15678
- {
15679
- name: "NTriples",
15680
- mimes: ["application/n-triples", "application/n-quads", "text/n-triples"],
15681
- mode: "ntriples",
15682
- ext: ["nt", "nq"]
15683
- },
15684
- { name: "Objective-C", mime: "text/x-objectivec", mode: "clike", ext: ["m"], alias: ["objective-c", "objc"] },
15685
- { name: "Objective-C++", mime: "text/x-objectivec++", mode: "clike", ext: ["mm"], alias: ["objective-c++", "objc++"] },
15686
- { name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"] },
15687
- { name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"] },
15688
- { name: "Oz", mime: "text/x-oz", mode: "oz", ext: ["oz"] },
15689
- { name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"] },
15690
- { name: "PEG.js", mime: "null", mode: "pegjs", ext: ["jsonld"] },
15691
- { name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"] },
15692
- { name: "PHP", mimes: ["text/x-php", "application/x-httpd-php", "application/x-httpd-php-open"], mode: "php", ext: ["php", "php3", "php4", "php5", "php7", "phtml"] },
15693
- { name: "Pig", mime: "text/x-pig", mode: "pig", ext: ["pig"] },
15694
- { name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"] },
15695
- { name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"] },
15696
- { name: "PostgreSQL", mime: "text/x-pgsql", mode: "sql" },
15697
- { name: "PowerShell", mime: "application/x-powershell", mode: "powershell", ext: ["ps1", "psd1", "psm1"] },
15698
- { name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"] },
15699
- { name: "ProtoBuf", mime: "text/x-protobuf", mode: "protobuf", ext: ["proto"] },
15700
- { name: "Python", mime: "text/x-python", mode: "python", ext: ["BUILD", "bzl", "py", "pyw"], file: /^(BUCK|BUILD)$/ },
15701
- { name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"] },
15702
- { name: "Q", mime: "text/x-q", mode: "q", ext: ["q"] },
15703
- { name: "R", mime: "text/x-rsrc", mode: "r", ext: ["r", "R"], alias: ["rscript"] },
15704
- { name: "reStructuredText", mime: "text/x-rst", mode: "rst", ext: ["rst"], alias: ["rst"] },
15705
- { name: "RPM Changes", mime: "text/x-rpm-changes", mode: "rpm" },
15706
- { name: "RPM Spec", mime: "text/x-rpm-spec", mode: "rpm", ext: ["spec"] },
15707
- { name: "Ruby", mime: "text/x-ruby", mode: "ruby", ext: ["rb"], alias: ["jruby", "macruby", "rake", "rb", "rbx"] },
15708
- { name: "Rust", mime: "text/x-rustsrc", mode: "rust", ext: ["rs"] },
15709
- { name: "SAS", mime: "text/x-sas", mode: "sas", ext: ["sas"] },
15710
- { name: "Sass", mime: "text/x-sass", mode: "sass", ext: ["sass"] },
15711
- { name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"] },
15712
- { name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"] },
15713
- { name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"] },
15714
- { name: "Shell", mimes: ["text/x-sh", "application/x-sh"], mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"], file: /^PKGBUILD$/ },
15715
- { name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"] },
15716
- { name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"] },
15717
- { name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"] },
15718
- { name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"] },
15719
- { name: "Solr", mime: "text/x-solr", mode: "solr" },
15720
- { name: "SML", mime: "text/x-sml", mode: "mllike", ext: ["sml", "sig", "fun", "smackspec"] },
15721
- { name: "Soy", mime: "text/x-soy", mode: "soy", ext: ["soy"], alias: ["closure template"] },
15722
- { name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"] },
15723
- { name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"] },
15724
- { name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"] },
15725
- { name: "SQLite", mime: "text/x-sqlite", mode: "sql" },
15726
- { name: "Squirrel", mime: "text/x-squirrel", mode: "clike", ext: ["nut"] },
15727
- { name: "Stylus", mime: "text/x-styl", mode: "stylus", ext: ["styl"] },
15728
- { name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"] },
15729
- { name: "sTeX", mime: "text/x-stex", mode: "stex" },
15730
- { name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx", "tex"], alias: ["tex"] },
15731
- { name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v", "sv", "svh"] },
15732
- { name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"] },
15733
- { name: "Textile", mime: "text/x-textile", mode: "textile", ext: ["textile"] },
15734
- { name: "TiddlyWiki", mime: "text/x-tiddlywiki", mode: "tiddlywiki" },
15735
- { name: "Tiki wiki", mime: "text/tiki", mode: "tiki" },
15736
- { name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"] },
15737
- { name: "Tornado", mime: "text/x-tornado", mode: "tornado" },
15738
- { name: "troff", mime: "text/troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"] },
15739
- { name: "TTCN", mime: "text/x-ttcn", mode: "ttcn", ext: ["ttcn", "ttcn3", "ttcnpp"] },
15740
- { name: "TTCN_CFG", mime: "text/x-ttcn-cfg", mode: "ttcn-cfg", ext: ["cfg"] },
15741
- { name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"] },
15742
- { name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"] },
15743
- { name: "TypeScript-JSX", mime: "text/typescript-jsx", mode: "jsx", ext: ["tsx"], alias: ["tsx"] },
15744
- { name: "Twig", mime: "text/x-twig", mode: "twig" },
15745
- { name: "Web IDL", mime: "text/x-webidl", mode: "webidl", ext: ["webidl"] },
15746
- { name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"] },
15747
- { name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"] },
15748
- { name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"] },
15749
- { name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"] },
15750
- { name: "VHDL", mime: "text/x-vhdl", mode: "vhdl", ext: ["vhd", "vhdl"] },
15751
- { name: "Vue.js Component", mimes: ["script/x-vue", "text/x-vue"], mode: "vue", ext: ["vue"] },
15752
- { name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd", "svg"], alias: ["rss", "wsdl", "xsd"] },
15753
- { name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"] },
15754
- { name: "Yacas", mime: "text/x-yacas", mode: "yacas", ext: ["ys"] },
15755
- { name: "YAML", mimes: ["text/x-yaml", "text/yaml"], mode: "yaml", ext: ["yaml", "yml"], alias: ["yml"] },
15756
- { name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"] },
15757
- { name: "mscgen", mime: "text/x-mscgen", mode: "mscgen", ext: ["mscgen", "mscin", "msc"] },
15758
- { name: "xu", mime: "text/x-xu", mode: "mscgen", ext: ["xu"] },
15759
- { name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"] },
15760
- { name: "WebAssembly", mime: "text/webassembly", mode: "wast", ext: ["wat", "wast"] }
15761
- ];
15762
- for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
15763
- var info = CodeMirror.modeInfo[i];
15764
- if (info.mimes)
15765
- info.mime = info.mimes[0];
15766
- }
15767
- CodeMirror.findModeByMIME = function(mime) {
15768
- mime = mime.toLowerCase();
15769
- for (var i2 = 0; i2 < CodeMirror.modeInfo.length; i2++) {
15770
- var info2 = CodeMirror.modeInfo[i2];
15771
- if (info2.mime == mime)
15772
- return info2;
15773
- if (info2.mimes) {
15774
- for (var j = 0; j < info2.mimes.length; j++)
15775
- if (info2.mimes[j] == mime)
15776
- return info2;
15777
- }
15778
- }
15779
- if (/\+xml$/.test(mime))
15780
- return CodeMirror.findModeByMIME("application/xml");
15781
- if (/\+json$/.test(mime))
15782
- return CodeMirror.findModeByMIME("application/json");
15783
- };
15784
- CodeMirror.findModeByExtension = function(ext) {
15785
- ext = ext.toLowerCase();
15786
- for (var i2 = 0; i2 < CodeMirror.modeInfo.length; i2++) {
15787
- var info2 = CodeMirror.modeInfo[i2];
15788
- if (info2.ext) {
15789
- for (var j = 0; j < info2.ext.length; j++)
15790
- if (info2.ext[j] == ext)
15791
- return info2;
15792
- }
15793
- }
15794
- };
15795
- CodeMirror.findModeByFileName = function(filename) {
15796
- for (var i2 = 0; i2 < CodeMirror.modeInfo.length; i2++) {
15797
- var info2 = CodeMirror.modeInfo[i2];
15798
- if (info2.file && info2.file.test(filename))
15799
- return info2;
15800
- }
15801
- var dot = filename.lastIndexOf(".");
15802
- var ext = dot > -1 && filename.substring(dot + 1, filename.length);
15803
- if (ext)
15804
- return CodeMirror.findModeByExtension(ext);
15805
- };
15806
- CodeMirror.findModeByName = function(name) {
15807
- name = name.toLowerCase();
15808
- for (var i2 = 0; i2 < CodeMirror.modeInfo.length; i2++) {
15809
- var info2 = CodeMirror.modeInfo[i2];
15810
- if (info2.name.toLowerCase() == name)
15811
- return info2;
15812
- if (info2.alias) {
15813
- for (var j = 0; j < info2.alias.length; j++)
15814
- if (info2.alias[j].toLowerCase() == name)
15815
- return info2;
15816
- }
15817
- }
15818
- };
15819
- });
15820
- })();
15821
- return meta.exports;
15822
- }
15823
- (function(module, exports) {
15824
- (function(mod) {
15825
- mod(requireCodemirror(), requireXml(), requireMeta());
15826
- })(function(CodeMirror) {
15827
- CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
15828
- var htmlMode = CodeMirror.getMode(cmCfg, "text/html");
15829
- var htmlModeMissing = htmlMode.name == "null";
15830
- function getMode(name) {
15831
- if (CodeMirror.findModeByName) {
15832
- var found = CodeMirror.findModeByName(name);
15833
- if (found)
15834
- name = found.mime || found.mimes[0];
15835
- }
15836
- var mode2 = CodeMirror.getMode(cmCfg, name);
15837
- return mode2.name == "null" ? null : mode2;
15838
- }
15839
- if (modeCfg.highlightFormatting === void 0)
15840
- modeCfg.highlightFormatting = false;
15841
- if (modeCfg.maxBlockquoteDepth === void 0)
15842
- modeCfg.maxBlockquoteDepth = 0;
15843
- if (modeCfg.taskLists === void 0)
15844
- modeCfg.taskLists = false;
15845
- if (modeCfg.strikethrough === void 0)
15846
- modeCfg.strikethrough = false;
15847
- if (modeCfg.emoji === void 0)
15848
- modeCfg.emoji = false;
15849
- if (modeCfg.fencedCodeBlockHighlighting === void 0)
15850
- modeCfg.fencedCodeBlockHighlighting = true;
15851
- if (modeCfg.fencedCodeBlockDefaultMode === void 0)
15852
- modeCfg.fencedCodeBlockDefaultMode = "text/plain";
15853
- if (modeCfg.xml === void 0)
15854
- modeCfg.xml = true;
15855
- if (modeCfg.tokenTypeOverrides === void 0)
15856
- modeCfg.tokenTypeOverrides = {};
15857
- var tokenTypes = {
15858
- header: "header",
15859
- code: "comment",
15860
- quote: "quote",
15861
- list1: "variable-2",
15862
- list2: "variable-3",
15863
- list3: "keyword",
15864
- hr: "hr",
15865
- image: "image",
15866
- imageAltText: "image-alt-text",
15867
- imageMarker: "image-marker",
15868
- formatting: "formatting",
15869
- linkInline: "link",
15870
- linkEmail: "link",
15871
- linkText: "link",
15872
- linkHref: "string",
15873
- em: "em",
15874
- strong: "strong",
15875
- strikethrough: "strikethrough",
15876
- emoji: "builtin"
15877
- };
15878
- for (var tokenType in tokenTypes) {
15879
- if (tokenTypes.hasOwnProperty(tokenType) && modeCfg.tokenTypeOverrides[tokenType]) {
15880
- tokenTypes[tokenType] = modeCfg.tokenTypeOverrides[tokenType];
15881
- }
15882
- }
15883
- var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/, listRE = /^(?:[*\-+]|^[0-9]+([.)]))\s+/, taskListRE = /^\[(x| )\](?=\s)/i, atxHeaderRE = modeCfg.allowAtxHeaderWithoutSpace ? /^(#+)/ : /^(#+)(?: |$)/, setextHeaderRE = /^ {0,3}(?:\={1,}|-{2,})\s*$/, textRE = /^[^#!\[\]*_\\<>` "'(~:]+/, fencedCodeRE = /^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/, linkDefRE = /^\s*\[[^\]]+?\]:.*$/, punctuation = /[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/, expandedTab = " ";
15884
- function switchInline(stream, state, f) {
15885
- state.f = state.inline = f;
15886
- return f(stream, state);
15887
- }
15888
- function switchBlock(stream, state, f) {
15889
- state.f = state.block = f;
15890
- return f(stream, state);
15891
- }
15892
- function lineIsEmpty(line) {
15893
- return !line || !/\S/.test(line.string);
15894
- }
15895
- function blankLine(state) {
15896
- state.linkTitle = false;
15897
- state.linkHref = false;
15898
- state.linkText = false;
15899
- state.em = false;
15900
- state.strong = false;
15901
- state.strikethrough = false;
15902
- state.quote = 0;
15903
- state.indentedCode = false;
15904
- if (state.f == htmlBlock) {
15905
- var exit = htmlModeMissing;
15906
- if (!exit) {
15907
- var inner = CodeMirror.innerMode(htmlMode, state.htmlState);
15908
- exit = inner.mode.name == "xml" && inner.state.tagStart === null && (!inner.state.context && inner.state.tokenize.isInText);
15909
- }
15910
- if (exit) {
15911
- state.f = inlineNormal;
15912
- state.block = blockNormal;
15913
- state.htmlState = null;
15914
- }
15915
- }
15916
- state.trailingSpace = 0;
15917
- state.trailingSpaceNewLine = false;
15918
- state.prevLine = state.thisLine;
15919
- state.thisLine = { stream: null };
15920
- return null;
15921
- }
15922
- function blockNormal(stream, state) {
15923
- var firstTokenOnLine = stream.column() === state.indentation;
15924
- var prevLineLineIsEmpty = lineIsEmpty(state.prevLine.stream);
15925
- var prevLineIsIndentedCode = state.indentedCode;
15926
- var prevLineIsHr = state.prevLine.hr;
15927
- var prevLineIsList = state.list !== false;
15928
- var maxNonCodeIndentation = (state.listStack[state.listStack.length - 1] || 0) + 3;
15929
- state.indentedCode = false;
15930
- var lineIndentation = state.indentation;
15931
- if (state.indentationDiff === null) {
15932
- state.indentationDiff = state.indentation;
15933
- if (prevLineIsList) {
15934
- state.list = null;
15935
- while (lineIndentation < state.listStack[state.listStack.length - 1]) {
15936
- state.listStack.pop();
15937
- if (state.listStack.length) {
15938
- state.indentation = state.listStack[state.listStack.length - 1];
15939
- } else {
15940
- state.list = false;
15941
- }
15942
- }
15943
- if (state.list !== false) {
15944
- state.indentationDiff = lineIndentation - state.listStack[state.listStack.length - 1];
15945
- }
15946
- }
15947
- }
15948
- var allowsInlineContinuation = !prevLineLineIsEmpty && !prevLineIsHr && !state.prevLine.header && (!prevLineIsList || !prevLineIsIndentedCode) && !state.prevLine.fencedCodeEnd;
15949
- var isHr = (state.list === false || prevLineIsHr || prevLineLineIsEmpty) && state.indentation <= maxNonCodeIndentation && stream.match(hrRE);
15950
- var match = null;
15951
- if (state.indentationDiff >= 4 && (prevLineIsIndentedCode || state.prevLine.fencedCodeEnd || state.prevLine.header || prevLineLineIsEmpty)) {
15952
- stream.skipToEnd();
15953
- state.indentedCode = true;
15954
- return tokenTypes.code;
15955
- } else if (stream.eatSpace()) {
15956
- return null;
15957
- } else if (firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(atxHeaderRE)) && match[1].length <= 6) {
15958
- state.quote = 0;
15959
- state.header = match[1].length;
15960
- state.thisLine.header = true;
15961
- if (modeCfg.highlightFormatting)
15962
- state.formatting = "header";
15963
- state.f = state.inline;
15964
- return getType(state);
15965
- } else if (state.indentation <= maxNonCodeIndentation && stream.eat(">")) {
15966
- state.quote = firstTokenOnLine ? 1 : state.quote + 1;
15967
- if (modeCfg.highlightFormatting)
15968
- state.formatting = "quote";
15969
- stream.eatSpace();
15970
- return getType(state);
15971
- } else if (!isHr && !state.setext && firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(listRE))) {
15972
- var listType = match[1] ? "ol" : "ul";
15973
- state.indentation = lineIndentation + stream.current().length;
15974
- state.list = true;
15975
- state.quote = 0;
15976
- state.listStack.push(state.indentation);
15977
- state.em = false;
15978
- state.strong = false;
15979
- state.code = false;
15980
- state.strikethrough = false;
15981
- if (modeCfg.taskLists && stream.match(taskListRE, false)) {
15982
- state.taskList = true;
15983
- }
15984
- state.f = state.inline;
15985
- if (modeCfg.highlightFormatting)
15986
- state.formatting = ["list", "list-" + listType];
15987
- return getType(state);
15988
- } else if (firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(fencedCodeRE, true))) {
15989
- state.quote = 0;
15990
- state.fencedEndRE = new RegExp(match[1] + "+ *$");
15991
- state.localMode = modeCfg.fencedCodeBlockHighlighting && getMode(match[2] || modeCfg.fencedCodeBlockDefaultMode);
15992
- if (state.localMode)
15993
- state.localState = CodeMirror.startState(state.localMode);
15994
- state.f = state.block = local;
15995
- if (modeCfg.highlightFormatting)
15996
- state.formatting = "code-block";
15997
- state.code = -1;
15998
- return getType(state);
15999
- } else if (
16000
- // if setext set, indicates line after ---/===
16001
- state.setext || // line before ---/===
16002
- (!allowsInlineContinuation || !prevLineIsList) && !state.quote && state.list === false && !state.code && !isHr && !linkDefRE.test(stream.string) && (match = stream.lookAhead(1)) && (match = match.match(setextHeaderRE))
16003
- ) {
16004
- if (!state.setext) {
16005
- state.header = match[0].charAt(0) == "=" ? 1 : 2;
16006
- state.setext = state.header;
16007
- } else {
16008
- state.header = state.setext;
16009
- state.setext = 0;
16010
- stream.skipToEnd();
16011
- if (modeCfg.highlightFormatting)
16012
- state.formatting = "header";
16013
- }
16014
- state.thisLine.header = true;
16015
- state.f = state.inline;
16016
- return getType(state);
16017
- } else if (isHr) {
16018
- stream.skipToEnd();
16019
- state.hr = true;
16020
- state.thisLine.hr = true;
16021
- return tokenTypes.hr;
16022
- } else if (stream.peek() === "[") {
16023
- return switchInline(stream, state, footnoteLink);
16024
- }
16025
- return switchInline(stream, state, state.inline);
16026
- }
16027
- function htmlBlock(stream, state) {
16028
- var style = htmlMode.token(stream, state.htmlState);
16029
- if (!htmlModeMissing) {
16030
- var inner = CodeMirror.innerMode(htmlMode, state.htmlState);
16031
- if (inner.mode.name == "xml" && inner.state.tagStart === null && (!inner.state.context && inner.state.tokenize.isInText) || state.md_inside && stream.current().indexOf(">") > -1) {
16032
- state.f = inlineNormal;
16033
- state.block = blockNormal;
16034
- state.htmlState = null;
16035
- }
16036
- }
16037
- return style;
16038
- }
16039
- function local(stream, state) {
16040
- var currListInd = state.listStack[state.listStack.length - 1] || 0;
16041
- var hasExitedList = state.indentation < currListInd;
16042
- var maxFencedEndInd = currListInd + 3;
16043
- if (state.fencedEndRE && state.indentation <= maxFencedEndInd && (hasExitedList || stream.match(state.fencedEndRE))) {
16044
- if (modeCfg.highlightFormatting)
16045
- state.formatting = "code-block";
16046
- var returnType;
16047
- if (!hasExitedList)
16048
- returnType = getType(state);
16049
- state.localMode = state.localState = null;
16050
- state.block = blockNormal;
16051
- state.f = inlineNormal;
16052
- state.fencedEndRE = null;
16053
- state.code = 0;
16054
- state.thisLine.fencedCodeEnd = true;
16055
- if (hasExitedList)
16056
- return switchBlock(stream, state, state.block);
16057
- return returnType;
16058
- } else if (state.localMode) {
16059
- return state.localMode.token(stream, state.localState);
16060
- } else {
16061
- stream.skipToEnd();
16062
- return tokenTypes.code;
16063
- }
16064
- }
16065
- function getType(state) {
16066
- var styles = [];
16067
- if (state.formatting) {
16068
- styles.push(tokenTypes.formatting);
16069
- if (typeof state.formatting === "string")
16070
- state.formatting = [state.formatting];
16071
- for (var i = 0; i < state.formatting.length; i++) {
16072
- styles.push(tokenTypes.formatting + "-" + state.formatting[i]);
16073
- if (state.formatting[i] === "header") {
16074
- styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.header);
16075
- }
16076
- if (state.formatting[i] === "quote") {
16077
- if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {
16078
- styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.quote);
16079
- } else {
16080
- styles.push("error");
16081
- }
16082
- }
16083
- }
16084
- }
16085
- if (state.taskOpen) {
16086
- styles.push("meta");
16087
- return styles.length ? styles.join(" ") : null;
16088
- }
16089
- if (state.taskClosed) {
16090
- styles.push("property");
16091
- return styles.length ? styles.join(" ") : null;
16092
- }
16093
- if (state.linkHref) {
16094
- styles.push(tokenTypes.linkHref, "url");
16095
- } else {
16096
- if (state.strong) {
16097
- styles.push(tokenTypes.strong);
16098
- }
16099
- if (state.em) {
16100
- styles.push(tokenTypes.em);
16101
- }
16102
- if (state.strikethrough) {
16103
- styles.push(tokenTypes.strikethrough);
16104
- }
16105
- if (state.emoji) {
16106
- styles.push(tokenTypes.emoji);
16107
- }
16108
- if (state.linkText) {
16109
- styles.push(tokenTypes.linkText);
16110
- }
16111
- if (state.code) {
16112
- styles.push(tokenTypes.code);
16113
- }
16114
- if (state.image) {
16115
- styles.push(tokenTypes.image);
16116
- }
16117
- if (state.imageAltText) {
16118
- styles.push(tokenTypes.imageAltText, "link");
16119
- }
16120
- if (state.imageMarker) {
16121
- styles.push(tokenTypes.imageMarker);
16122
- }
16123
- }
16124
- if (state.header) {
16125
- styles.push(tokenTypes.header, tokenTypes.header + "-" + state.header);
16126
- }
16127
- if (state.quote) {
16128
- styles.push(tokenTypes.quote);
16129
- if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {
16130
- styles.push(tokenTypes.quote + "-" + state.quote);
16131
- } else {
16132
- styles.push(tokenTypes.quote + "-" + modeCfg.maxBlockquoteDepth);
16133
- }
16134
- }
16135
- if (state.list !== false) {
16136
- var listMod = (state.listStack.length - 1) % 3;
16137
- if (!listMod) {
16138
- styles.push(tokenTypes.list1);
16139
- } else if (listMod === 1) {
16140
- styles.push(tokenTypes.list2);
16141
- } else {
16142
- styles.push(tokenTypes.list3);
16143
- }
16144
- }
16145
- if (state.trailingSpaceNewLine) {
16146
- styles.push("trailing-space-new-line");
16147
- } else if (state.trailingSpace) {
16148
- styles.push("trailing-space-" + (state.trailingSpace % 2 ? "a" : "b"));
16149
- }
16150
- return styles.length ? styles.join(" ") : null;
16151
- }
16152
- function handleText(stream, state) {
16153
- if (stream.match(textRE, true)) {
16154
- return getType(state);
16155
- }
16156
- return void 0;
16157
- }
16158
- function inlineNormal(stream, state) {
16159
- var style = state.text(stream, state);
16160
- if (typeof style !== "undefined")
16161
- return style;
16162
- if (state.list) {
16163
- state.list = null;
16164
- return getType(state);
16165
- }
16166
- if (state.taskList) {
16167
- var taskOpen = stream.match(taskListRE, true)[1] === " ";
16168
- if (taskOpen)
16169
- state.taskOpen = true;
16170
- else
16171
- state.taskClosed = true;
16172
- if (modeCfg.highlightFormatting)
16173
- state.formatting = "task";
16174
- state.taskList = false;
16175
- return getType(state);
16176
- }
16177
- state.taskOpen = false;
16178
- state.taskClosed = false;
16179
- if (state.header && stream.match(/^#+$/, true)) {
16180
- if (modeCfg.highlightFormatting)
16181
- state.formatting = "header";
16182
- return getType(state);
16183
- }
16184
- var ch = stream.next();
16185
- if (state.linkTitle) {
16186
- state.linkTitle = false;
16187
- var matchCh = ch;
16188
- if (ch === "(") {
16189
- matchCh = ")";
16190
- }
16191
- matchCh = (matchCh + "").replace(/([.?*+^\[\]\\(){}|-])/g, "\\$1");
16192
- var regex = "^\\s*(?:[^" + matchCh + "\\\\]+|\\\\\\\\|\\\\.)" + matchCh;
16193
- if (stream.match(new RegExp(regex), true)) {
16194
- return tokenTypes.linkHref;
16195
- }
16196
- }
16197
- if (ch === "`") {
16198
- var previousFormatting = state.formatting;
16199
- if (modeCfg.highlightFormatting)
16200
- state.formatting = "code";
16201
- stream.eatWhile("`");
16202
- var count = stream.current().length;
16203
- if (state.code == 0 && (!state.quote || count == 1)) {
16204
- state.code = count;
16205
- return getType(state);
16206
- } else if (count == state.code) {
16207
- var t = getType(state);
16208
- state.code = 0;
16209
- return t;
16210
- } else {
16211
- state.formatting = previousFormatting;
16212
- return getType(state);
16213
- }
16214
- } else if (state.code) {
16215
- return getType(state);
16216
- }
16217
- if (ch === "\\") {
16218
- stream.next();
16219
- if (modeCfg.highlightFormatting) {
16220
- var type = getType(state);
16221
- var formattingEscape = tokenTypes.formatting + "-escape";
16222
- return type ? type + " " + formattingEscape : formattingEscape;
16223
- }
16224
- }
16225
- if (ch === "!" && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) {
16226
- state.imageMarker = true;
16227
- state.image = true;
16228
- if (modeCfg.highlightFormatting)
16229
- state.formatting = "image";
16230
- return getType(state);
16231
- }
16232
- if (ch === "[" && state.imageMarker && stream.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/, false)) {
16233
- state.imageMarker = false;
16234
- state.imageAltText = true;
16235
- if (modeCfg.highlightFormatting)
16236
- state.formatting = "image";
16237
- return getType(state);
16238
- }
16239
- if (ch === "]" && state.imageAltText) {
16240
- if (modeCfg.highlightFormatting)
16241
- state.formatting = "image";
16242
- var type = getType(state);
16243
- state.imageAltText = false;
16244
- state.image = false;
16245
- state.inline = state.f = linkHref;
16246
- return type;
16247
- }
16248
- if (ch === "[" && !state.image) {
16249
- if (state.linkText && stream.match(/^.*?\]/))
16250
- return getType(state);
16251
- state.linkText = true;
16252
- if (modeCfg.highlightFormatting)
16253
- state.formatting = "link";
16254
- return getType(state);
16255
- }
16256
- if (ch === "]" && state.linkText) {
16257
- if (modeCfg.highlightFormatting)
16258
- state.formatting = "link";
16259
- var type = getType(state);
16260
- state.linkText = false;
16261
- state.inline = state.f = stream.match(/\(.*?\)| ?\[.*?\]/, false) ? linkHref : inlineNormal;
16262
- return type;
16263
- }
16264
- if (ch === "<" && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, false)) {
16265
- state.f = state.inline = linkInline;
16266
- if (modeCfg.highlightFormatting)
16267
- state.formatting = "link";
16268
- var type = getType(state);
16269
- if (type) {
16270
- type += " ";
16271
- } else {
16272
- type = "";
16273
- }
16274
- return type + tokenTypes.linkInline;
16275
- }
16276
- if (ch === "<" && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) {
16277
- state.f = state.inline = linkInline;
16278
- if (modeCfg.highlightFormatting)
16279
- state.formatting = "link";
16280
- var type = getType(state);
16281
- if (type) {
16282
- type += " ";
16283
- } else {
16284
- type = "";
16285
- }
16286
- return type + tokenTypes.linkEmail;
16287
- }
16288
- if (modeCfg.xml && ch === "<" && stream.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i, false)) {
16289
- var end = stream.string.indexOf(">", stream.pos);
16290
- if (end != -1) {
16291
- var atts = stream.string.substring(stream.start, end);
16292
- if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts))
16293
- state.md_inside = true;
16294
- }
16295
- stream.backUp(1);
16296
- state.htmlState = CodeMirror.startState(htmlMode);
16297
- return switchBlock(stream, state, htmlBlock);
16298
- }
16299
- if (modeCfg.xml && ch === "<" && stream.match(/^\/\w*?>/)) {
16300
- state.md_inside = false;
16301
- return "tag";
16302
- } else if (ch === "*" || ch === "_") {
16303
- var len = 1, before = stream.pos == 1 ? " " : stream.string.charAt(stream.pos - 2);
16304
- while (len < 3 && stream.eat(ch))
16305
- len++;
16306
- var after = stream.peek() || " ";
16307
- var leftFlanking = !/\s/.test(after) && (!punctuation.test(after) || /\s/.test(before) || punctuation.test(before));
16308
- var rightFlanking = !/\s/.test(before) && (!punctuation.test(before) || /\s/.test(after) || punctuation.test(after));
16309
- var setEm = null, setStrong = null;
16310
- if (len % 2) {
16311
- if (!state.em && leftFlanking && (ch === "*" || !rightFlanking || punctuation.test(before)))
16312
- setEm = true;
16313
- else if (state.em == ch && rightFlanking && (ch === "*" || !leftFlanking || punctuation.test(after)))
16314
- setEm = false;
16315
- }
16316
- if (len > 1) {
16317
- if (!state.strong && leftFlanking && (ch === "*" || !rightFlanking || punctuation.test(before)))
16318
- setStrong = true;
16319
- else if (state.strong == ch && rightFlanking && (ch === "*" || !leftFlanking || punctuation.test(after)))
16320
- setStrong = false;
16321
- }
16322
- if (setStrong != null || setEm != null) {
16323
- if (modeCfg.highlightFormatting)
16324
- state.formatting = setEm == null ? "strong" : setStrong == null ? "em" : "strong em";
16325
- if (setEm === true)
16326
- state.em = ch;
16327
- if (setStrong === true)
16328
- state.strong = ch;
16329
- var t = getType(state);
16330
- if (setEm === false)
16331
- state.em = false;
16332
- if (setStrong === false)
16333
- state.strong = false;
16334
- return t;
16335
- }
16336
- } else if (ch === " ") {
16337
- if (stream.eat("*") || stream.eat("_")) {
16338
- if (stream.peek() === " ") {
16339
- return getType(state);
16340
- } else {
16341
- stream.backUp(1);
16342
- }
16343
- }
16344
- }
16345
- if (modeCfg.strikethrough) {
16346
- if (ch === "~" && stream.eatWhile(ch)) {
16347
- if (state.strikethrough) {
16348
- if (modeCfg.highlightFormatting)
16349
- state.formatting = "strikethrough";
16350
- var t = getType(state);
16351
- state.strikethrough = false;
16352
- return t;
16353
- } else if (stream.match(/^[^\s]/, false)) {
16354
- state.strikethrough = true;
16355
- if (modeCfg.highlightFormatting)
16356
- state.formatting = "strikethrough";
16357
- return getType(state);
16358
- }
16359
- } else if (ch === " ") {
16360
- if (stream.match("~~", true)) {
16361
- if (stream.peek() === " ") {
16362
- return getType(state);
16363
- } else {
16364
- stream.backUp(2);
16365
- }
16366
- }
16367
- }
16368
- }
16369
- if (modeCfg.emoji && ch === ":" && stream.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)) {
16370
- state.emoji = true;
16371
- if (modeCfg.highlightFormatting)
16372
- state.formatting = "emoji";
16373
- var retType = getType(state);
16374
- state.emoji = false;
16375
- return retType;
16376
- }
16377
- if (ch === " ") {
16378
- if (stream.match(/^ +$/, false)) {
16379
- state.trailingSpace++;
16380
- } else if (state.trailingSpace) {
16381
- state.trailingSpaceNewLine = true;
16382
- }
16383
- }
16384
- return getType(state);
16385
- }
16386
- function linkInline(stream, state) {
16387
- var ch = stream.next();
16388
- if (ch === ">") {
16389
- state.f = state.inline = inlineNormal;
16390
- if (modeCfg.highlightFormatting)
16391
- state.formatting = "link";
16392
- var type = getType(state);
16393
- if (type) {
16394
- type += " ";
16395
- } else {
16396
- type = "";
16397
- }
16398
- return type + tokenTypes.linkInline;
16399
- }
16400
- stream.match(/^[^>]+/, true);
16401
- return tokenTypes.linkInline;
16402
- }
16403
- function linkHref(stream, state) {
16404
- if (stream.eatSpace()) {
16405
- return null;
16406
- }
16407
- var ch = stream.next();
16408
- if (ch === "(" || ch === "[") {
16409
- state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]");
16410
- if (modeCfg.highlightFormatting)
16411
- state.formatting = "link-string";
16412
- state.linkHref = true;
16413
- return getType(state);
16414
- }
16415
- return "error";
16416
- }
16417
- var linkRE = {
16418
- ")": /^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,
16419
- "]": /^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/
16420
- };
16421
- function getLinkHrefInside(endChar) {
16422
- return function(stream, state) {
16423
- var ch = stream.next();
16424
- if (ch === endChar) {
16425
- state.f = state.inline = inlineNormal;
16426
- if (modeCfg.highlightFormatting)
16427
- state.formatting = "link-string";
16428
- var returnState = getType(state);
16429
- state.linkHref = false;
16430
- return returnState;
16431
- }
16432
- stream.match(linkRE[endChar]);
16433
- state.linkHref = true;
16434
- return getType(state);
16435
- };
16436
- }
16437
- function footnoteLink(stream, state) {
16438
- if (stream.match(/^([^\]\\]|\\.)*\]:/, false)) {
16439
- state.f = footnoteLinkInside;
16440
- stream.next();
16441
- if (modeCfg.highlightFormatting)
16442
- state.formatting = "link";
16443
- state.linkText = true;
16444
- return getType(state);
16445
- }
16446
- return switchInline(stream, state, inlineNormal);
16447
- }
16448
- function footnoteLinkInside(stream, state) {
16449
- if (stream.match("]:", true)) {
16450
- state.f = state.inline = footnoteUrl;
16451
- if (modeCfg.highlightFormatting)
16452
- state.formatting = "link";
16453
- var returnType = getType(state);
16454
- state.linkText = false;
16455
- return returnType;
16456
- }
16457
- stream.match(/^([^\]\\]|\\.)+/, true);
16458
- return tokenTypes.linkText;
16459
- }
16460
- function footnoteUrl(stream, state) {
16461
- if (stream.eatSpace()) {
16462
- return null;
16463
- }
16464
- stream.match(/^[^\s]+/, true);
16465
- if (stream.peek() === void 0) {
16466
- state.linkTitle = true;
16467
- } else {
16468
- stream.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/, true);
16469
- }
16470
- state.f = state.inline = inlineNormal;
16471
- return tokenTypes.linkHref + " url";
16472
- }
16473
- var mode = {
16474
- startState: function() {
16475
- return {
16476
- f: blockNormal,
16477
- prevLine: { stream: null },
16478
- thisLine: { stream: null },
16479
- block: blockNormal,
16480
- htmlState: null,
16481
- indentation: 0,
16482
- inline: inlineNormal,
16483
- text: handleText,
16484
- formatting: false,
16485
- linkText: false,
16486
- linkHref: false,
16487
- linkTitle: false,
16488
- code: 0,
16489
- em: false,
16490
- strong: false,
16491
- header: 0,
16492
- setext: 0,
16493
- hr: false,
16494
- taskList: false,
16495
- list: false,
16496
- listStack: [],
16497
- quote: 0,
16498
- trailingSpace: 0,
16499
- trailingSpaceNewLine: false,
16500
- strikethrough: false,
16501
- emoji: false,
16502
- fencedEndRE: null
16503
- };
16504
- },
16505
- copyState: function(s) {
16506
- return {
16507
- f: s.f,
16508
- prevLine: s.prevLine,
16509
- thisLine: s.thisLine,
16510
- block: s.block,
16511
- htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState),
16512
- indentation: s.indentation,
16513
- localMode: s.localMode,
16514
- localState: s.localMode ? CodeMirror.copyState(s.localMode, s.localState) : null,
16515
- inline: s.inline,
16516
- text: s.text,
16517
- formatting: false,
16518
- linkText: s.linkText,
16519
- linkTitle: s.linkTitle,
16520
- linkHref: s.linkHref,
16521
- code: s.code,
16522
- em: s.em,
16523
- strong: s.strong,
16524
- strikethrough: s.strikethrough,
16525
- emoji: s.emoji,
16526
- header: s.header,
16527
- setext: s.setext,
16528
- hr: s.hr,
16529
- taskList: s.taskList,
16530
- list: s.list,
16531
- listStack: s.listStack.slice(0),
16532
- quote: s.quote,
16533
- indentedCode: s.indentedCode,
16534
- trailingSpace: s.trailingSpace,
16535
- trailingSpaceNewLine: s.trailingSpaceNewLine,
16536
- md_inside: s.md_inside,
16537
- fencedEndRE: s.fencedEndRE
16538
- };
16539
- },
16540
- token: function(stream, state) {
16541
- state.formatting = false;
16542
- if (stream != state.thisLine.stream) {
16543
- state.header = 0;
16544
- state.hr = false;
16545
- if (stream.match(/^\s*$/, true)) {
16546
- blankLine(state);
16547
- return null;
16548
- }
16549
- state.prevLine = state.thisLine;
16550
- state.thisLine = { stream };
16551
- state.taskList = false;
16552
- state.trailingSpace = 0;
16553
- state.trailingSpaceNewLine = false;
16554
- if (!state.localState) {
16555
- state.f = state.block;
16556
- if (state.f != htmlBlock) {
16557
- var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, expandedTab).length;
16558
- state.indentation = indentation;
16559
- state.indentationDiff = null;
16560
- if (indentation > 0)
16561
- return null;
16562
- }
16563
- }
16564
- }
16565
- return state.f(stream, state);
16566
- },
16567
- innerMode: function(state) {
16568
- if (state.block == htmlBlock)
16569
- return { state: state.htmlState, mode: htmlMode };
16570
- if (state.localState)
16571
- return { state: state.localState, mode: state.localMode };
16572
- return { state, mode };
16573
- },
16574
- indent: function(state, textAfter, line) {
16575
- if (state.block == htmlBlock && htmlMode.indent)
16576
- return htmlMode.indent(state.htmlState, textAfter, line);
16577
- if (state.localState && state.localMode.indent)
16578
- return state.localMode.indent(state.localState, textAfter, line);
16579
- return CodeMirror.Pass;
16580
- },
16581
- blankLine,
16582
- getType,
16583
- blockCommentStart: "<!--",
16584
- blockCommentEnd: "-->",
16585
- closeBrackets: "()[]{}''\"\"``",
16586
- fold: "markdown"
16587
- };
16588
- return mode;
16589
- }, "xml");
16590
- CodeMirror.defineMIME("text/markdown", "markdown");
16591
- CodeMirror.defineMIME("text/x-markdown", "markdown");
16592
- });
16593
- })();
16594
- (function(module, exports) {
16595
- (function(mod) {
16596
- mod(requireCodemirror());
16597
- })(function(CodeMirror) {
16598
- CodeMirror.defineSimpleMode = function(name, states) {
16599
- CodeMirror.defineMode(name, function(config) {
16600
- return CodeMirror.simpleMode(config, states);
16601
- });
16602
- };
16603
- CodeMirror.simpleMode = function(config, states) {
16604
- ensureState(states, "start");
16605
- var states_ = {}, meta2 = states.meta || {}, hasIndentation = false;
16606
- for (var state in states)
16607
- if (state != meta2 && states.hasOwnProperty(state)) {
16608
- var list = states_[state] = [], orig = states[state];
16609
- for (var i = 0; i < orig.length; i++) {
16610
- var data = orig[i];
16611
- list.push(new Rule(data, states));
16612
- if (data.indent || data.dedent)
16613
- hasIndentation = true;
16614
- }
16615
- }
16616
- var mode = {
16617
- startState: function() {
16618
- return {
16619
- state: "start",
16620
- pending: null,
16621
- local: null,
16622
- localState: null,
16623
- indent: hasIndentation ? [] : null
16624
- };
16625
- },
16626
- copyState: function(state2) {
16627
- var s = {
16628
- state: state2.state,
16629
- pending: state2.pending,
16630
- local: state2.local,
16631
- localState: null,
16632
- indent: state2.indent && state2.indent.slice(0)
16633
- };
16634
- if (state2.localState)
16635
- s.localState = CodeMirror.copyState(state2.local.mode, state2.localState);
16636
- if (state2.stack)
16637
- s.stack = state2.stack.slice(0);
16638
- for (var pers = state2.persistentStates; pers; pers = pers.next)
16639
- s.persistentStates = {
16640
- mode: pers.mode,
16641
- spec: pers.spec,
16642
- state: pers.state == state2.localState ? s.localState : CodeMirror.copyState(pers.mode, pers.state),
16643
- next: s.persistentStates
16644
- };
16645
- return s;
16646
- },
16647
- token: tokenFunction(states_, config),
16648
- innerMode: function(state2) {
16649
- return state2.local && { mode: state2.local.mode, state: state2.localState };
16650
- },
16651
- indent: indentFunction(states_, meta2)
16652
- };
16653
- if (meta2) {
16654
- for (var prop in meta2)
16655
- if (meta2.hasOwnProperty(prop))
16656
- mode[prop] = meta2[prop];
16657
- }
16658
- return mode;
16659
- };
16660
- function ensureState(states, name) {
16661
- if (!states.hasOwnProperty(name))
16662
- throw new Error("Undefined state " + name + " in simple mode");
16663
- }
16664
- function toRegex(val, caret) {
16665
- if (!val)
16666
- return /(?:)/;
16667
- var flags = "";
16668
- if (val instanceof RegExp) {
16669
- if (val.ignoreCase)
16670
- flags = "i";
16671
- if (val.unicode)
16672
- flags += "u";
16673
- val = val.source;
16674
- } else {
16675
- val = String(val);
16676
- }
16677
- return new RegExp((caret === false ? "" : "^") + "(?:" + val + ")", flags);
16678
- }
16679
- function asToken(val) {
16680
- if (!val)
16681
- return null;
16682
- if (val.apply)
16683
- return val;
16684
- if (typeof val == "string")
16685
- return val.replace(/\./g, " ");
16686
- var result = [];
16687
- for (var i = 0; i < val.length; i++)
16688
- result.push(val[i] && val[i].replace(/\./g, " "));
16689
- return result;
16690
- }
16691
- function Rule(data, states) {
16692
- if (data.next || data.push)
16693
- ensureState(states, data.next || data.push);
16694
- this.regex = toRegex(data.regex);
16695
- this.token = asToken(data.token);
16696
- this.data = data;
16697
- }
16698
- function tokenFunction(states, config) {
16699
- return function(stream, state) {
16700
- if (state.pending) {
16701
- var pend = state.pending.shift();
16702
- if (state.pending.length == 0)
16703
- state.pending = null;
16704
- stream.pos += pend.text.length;
16705
- return pend.token;
16706
- }
16707
- if (state.local) {
16708
- if (state.local.end && stream.match(state.local.end)) {
16709
- var tok = state.local.endToken || null;
16710
- state.local = state.localState = null;
16711
- return tok;
16712
- } else {
16713
- var tok = state.local.mode.token(stream, state.localState), m;
16714
- if (state.local.endScan && (m = state.local.endScan.exec(stream.current())))
16715
- stream.pos = stream.start + m.index;
16716
- return tok;
16717
- }
16718
- }
16719
- var curState = states[state.state];
16720
- for (var i = 0; i < curState.length; i++) {
16721
- var rule = curState[i];
16722
- var matches = (!rule.data.sol || stream.sol()) && stream.match(rule.regex);
16723
- if (matches) {
16724
- if (rule.data.next) {
16725
- state.state = rule.data.next;
16726
- } else if (rule.data.push) {
16727
- (state.stack || (state.stack = [])).push(state.state);
16728
- state.state = rule.data.push;
16729
- } else if (rule.data.pop && state.stack && state.stack.length) {
16730
- state.state = state.stack.pop();
16731
- }
16732
- if (rule.data.mode)
16733
- enterLocalMode(config, state, rule.data.mode, rule.token);
16734
- if (rule.data.indent)
16735
- state.indent.push(stream.indentation() + config.indentUnit);
16736
- if (rule.data.dedent)
16737
- state.indent.pop();
16738
- var token = rule.token;
16739
- if (token && token.apply)
16740
- token = token(matches);
16741
- if (matches.length > 2 && rule.token && typeof rule.token != "string") {
16742
- for (var j = 2; j < matches.length; j++)
16743
- if (matches[j])
16744
- (state.pending || (state.pending = [])).push({ text: matches[j], token: rule.token[j - 1] });
16745
- stream.backUp(matches[0].length - (matches[1] ? matches[1].length : 0));
16746
- return token[0];
16747
- } else if (token && token.join) {
16748
- return token[0];
16749
- } else {
16750
- return token;
16751
- }
16752
- }
16753
- }
16754
- stream.next();
16755
- return null;
16756
- };
16757
- }
16758
- function cmp(a, b) {
16759
- if (a === b)
16760
- return true;
16761
- if (!a || typeof a != "object" || !b || typeof b != "object")
16762
- return false;
16763
- var props = 0;
16764
- for (var prop in a)
16765
- if (a.hasOwnProperty(prop)) {
16766
- if (!b.hasOwnProperty(prop) || !cmp(a[prop], b[prop]))
16767
- return false;
16768
- props++;
16769
- }
16770
- for (var prop in b)
16771
- if (b.hasOwnProperty(prop))
16772
- props--;
16773
- return props == 0;
16774
- }
16775
- function enterLocalMode(config, state, spec, token) {
16776
- var pers;
16777
- if (spec.persistent) {
16778
- for (var p = state.persistentStates; p && !pers; p = p.next)
16779
- if (spec.spec ? cmp(spec.spec, p.spec) : spec.mode == p.mode)
16780
- pers = p;
16781
- }
16782
- var mode = pers ? pers.mode : spec.mode || CodeMirror.getMode(config, spec.spec);
16783
- var lState = pers ? pers.state : CodeMirror.startState(mode);
16784
- if (spec.persistent && !pers)
16785
- state.persistentStates = { mode, spec: spec.spec, state: lState, next: state.persistentStates };
16786
- state.localState = lState;
16787
- state.local = {
16788
- mode,
16789
- end: spec.end && toRegex(spec.end),
16790
- endScan: spec.end && spec.forceEnd !== false && toRegex(spec.end, false),
16791
- endToken: token && token.join ? token[token.length - 1] : token
16792
- };
16793
- }
16794
- function indexOf(val, arr) {
16795
- for (var i = 0; i < arr.length; i++)
16796
- if (arr[i] === val)
16797
- return true;
16798
- }
16799
- function indentFunction(states, meta2) {
16800
- return function(state, textAfter, line) {
16801
- if (state.local && state.local.mode.indent)
16802
- return state.local.mode.indent(state.localState, textAfter, line);
16803
- if (state.indent == null || state.local || meta2.dontIndentStates && indexOf(state.state, meta2.dontIndentStates) > -1)
16804
- return CodeMirror.Pass;
16805
- var pos = state.indent.length - 1, rules = states[state.state];
16806
- scan:
16807
- for (; ; ) {
16808
- for (var i = 0; i < rules.length; i++) {
16809
- var rule = rules[i];
16810
- if (rule.data.dedent && rule.data.dedentIfLineStart !== false) {
16811
- var m = rule.regex.exec(textAfter);
16812
- if (m && m[0]) {
16813
- pos--;
16814
- if (rule.next || rule.push)
16815
- rules = states[rule.next || rule.push];
16816
- textAfter = textAfter.slice(m[0].length);
16817
- continue scan;
16818
- }
16819
- }
16820
- }
16821
- break;
16822
- }
16823
- return pos < 0 ? 0 : state.indent[pos];
16824
- };
16825
- }
16826
- });
16827
- })();
16828
15576
  export {
16829
- codemirror as default
15577
+ codemirror$1 as default
16830
15578
  };
16831
- //# sourceMappingURL=codeMirrorModule-CcviAl53.js.map
15579
+ //# sourceMappingURL=codeMirrorModule-f03b1a3e.js.map