c0ckp1t 1.0.0

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 (676) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +5 -0
  3. package/c0ckp1t-demo/Constants.mjs +125 -0
  4. package/c0ckp1t-demo/components/sidebar.vue +82 -0
  5. package/c0ckp1t-demo/main.vue +39 -0
  6. package/c0ckp1t-demo/pages/devices.vue +63 -0
  7. package/c0ckp1t-demo/pages/homepage.vue +63 -0
  8. package/c0ckp1t-demo/pages/report.vue +63 -0
  9. package/c0ckp1t-demo/store.mjs +133 -0
  10. package/components/ExecButton.vue +62 -0
  11. package/components/FsTree.vue +550 -0
  12. package/components/Markdown.mjs +274 -0
  13. package/components/MarkdownUtils.mjs +180 -0
  14. package/components/Tree.mjs +175 -0
  15. package/components/code-mirror.vue +445 -0
  16. package/components/vue3-ace-editor.vue +331 -0
  17. package/components/xbutton.vue +45 -0
  18. package/components/xcard-h.vue +175 -0
  19. package/components/xcard.vue +76 -0
  20. package/components/xcheck.vue +35 -0
  21. package/components/xcheckbox.vue +52 -0
  22. package/components/xcode.vue +139 -0
  23. package/components/xcollapse.vue +52 -0
  24. package/components/xcolor.vue +84 -0
  25. package/components/xdropdown.vue +104 -0
  26. package/components/xdropdown2.vue +140 -0
  27. package/components/xhidden.vue +30 -0
  28. package/components/xinput.vue +101 -0
  29. package/components/xinput2.vue +101 -0
  30. package/components/xjson.vue +95 -0
  31. package/components/xkv.vue +41 -0
  32. package/components/xlabel.vue +56 -0
  33. package/components/xlist.vue +83 -0
  34. package/components/xmap.vue +106 -0
  35. package/components/xmarkdown.vue +269 -0
  36. package/components/xnav.vue +98 -0
  37. package/components/xsection.vue +164 -0
  38. package/components/xsound.vue +251 -0
  39. package/components/xtable-open.vue +179 -0
  40. package/components/xtabs.vue +72 -0
  41. package/components/xterminal.vue +456 -0
  42. package/components/xtextarea.vue +83 -0
  43. package/components/xtoggle.vue +68 -0
  44. package/components/xtoggle3.vue +67 -0
  45. package/components/xtree.vue +140 -0
  46. package/components/xupload.vue +129 -0
  47. package/core/Content.mjs +92 -0
  48. package/core/DocUtils.mjs +189 -0
  49. package/core/GlobalStore.mjs +329 -0
  50. package/core/Island.mjs +429 -0
  51. package/core/IslandDefault.mjs +229 -0
  52. package/core/JsUtils.mjs +483 -0
  53. package/core/Logging.mjs +59 -0
  54. package/core/Page404.vue +152 -0
  55. package/core/PageFallback.vue +168 -0
  56. package/core/PageMain.vue +181 -0
  57. package/core/Theme.mjs +1759 -0
  58. package/core/VueUtils.mjs +200 -0
  59. package/core/WsUtils.mjs +274 -0
  60. package/core/img/Flag_of_the_United_States.svg +25 -0
  61. package/core/img/logo_v1.svg +98 -0
  62. package/core/img/logo_v2.svg +98 -0
  63. package/core/img/state-uniqueId-8k.wav +0 -0
  64. package/core/main-offcanvas.vue +99 -0
  65. package/core/nodes/_api.vue +82 -0
  66. package/core/nodes/node-container.vue +103 -0
  67. package/core/nodes/node.vue +246 -0
  68. package/core/nodes/place-holder.vue +47 -0
  69. package/core/nodes/root.vue +52 -0
  70. package/core/notify/NotifyUtils.mjs +150 -0
  71. package/core/notify/toast.vue +150 -0
  72. package/core/pages/About.vue +57 -0
  73. package/core/pages/Cache.vue +155 -0
  74. package/core/pages/Connection.vue +192 -0
  75. package/core/pages/Connections.vue +102 -0
  76. package/core/pages/Documentation.vue +263 -0
  77. package/core/pages/Notifies.vue +156 -0
  78. package/core/pages/Traffic.vue +152 -0
  79. package/core/pages/connections/connection-header-details.vue +80 -0
  80. package/core/pages/connections/page-connection-default.vue +92 -0
  81. package/core/pages/connections/page-connection.vue +176 -0
  82. package/core/pages/connections/ws-connection.vue +146 -0
  83. package/core/pages/frontend/Bootstrap.vue +1140 -0
  84. package/core/pages/frontend/Components.vue +56 -0
  85. package/core/pages/frontend/ComponentsAdv.vue +203 -0
  86. package/core/pages/frontend/ComponentsBasic.vue +336 -0
  87. package/core/pages/frontend/Theme.vue +473 -0
  88. package/core/pages/frontend/component-view.vue +65 -0
  89. package/core/pages/traffic/WsLogUtils.mjs +91 -0
  90. package/core/pages/traffic/log-ws-exec.vue +124 -0
  91. package/core/pages/traffic/log-ws-exec2.vue +129 -0
  92. package/core/sfc/code-item.vue +169 -0
  93. package/core/sfc/connection-header.vue +62 -0
  94. package/core/sfc/info-api.vue +158 -0
  95. package/core/sfc/md-toc.vue +346 -0
  96. package/core/sfc/scroll-to-top.vue +69 -0
  97. package/core/sfc/task.vue +98 -0
  98. package/core/sfc/text-to-md.vue +25 -0
  99. package/core/sfc/toc-list.vue +175 -0
  100. package/core/ws-client/AuthNState.mjs +84 -0
  101. package/core/ws-client/Connection.mjs +580 -0
  102. package/core/ws-client/Session.mjs +72 -0
  103. package/core/ws-client/WsClient.mjs +230 -0
  104. package/core/ws-client/WsLogUtils.mjs +91 -0
  105. package/core/ws-client/ws-connection.vue +144 -0
  106. package/css/Changa-Medium.ttf +0 -0
  107. package/css/Makefile +10 -0
  108. package/css/README.md +25 -0
  109. package/css/bootstrap-c0ckp1t.css +11861 -0
  110. package/css/bootstrap.min.css +6 -0
  111. package/css/fontawesome/brands.min.css +6 -0
  112. package/css/fontawesome/fontawesome.min.css +8 -0
  113. package/css/fontawesome/regular.min.css +6 -0
  114. package/css/fontawesome/solid.min.css +6 -0
  115. package/css/webfonts/fa-brands-400.woff2 +0 -0
  116. package/css/webfonts/fa-regular-400.woff2 +0 -0
  117. package/css/webfonts/fa-solid-900.woff2 +0 -0
  118. package/docs/Introduction.md +3 -0
  119. package/favicon-192x192.png +0 -0
  120. package/favicon-32x32.png +0 -0
  121. package/favicon-64x64.png +0 -0
  122. package/favicon.ico +0 -0
  123. package/index-cdn.html +66 -0
  124. package/js_ext/Makefile +26 -0
  125. package/js_ext/ace-editor/ace.js +22037 -0
  126. package/js_ext/ace-editor/ext-beautify.js +343 -0
  127. package/js_ext/ace-editor/ext-code_lens.js +204 -0
  128. package/js_ext/ace-editor/ext-command_bar.js +469 -0
  129. package/js_ext/ace-editor/ext-diff.js +4265 -0
  130. package/js_ext/ace-editor/ext-elastic_tabstops_lite.js +238 -0
  131. package/js_ext/ace-editor/ext-emmet.js +1303 -0
  132. package/js_ext/ace-editor/ext-error_marker.js +9 -0
  133. package/js_ext/ace-editor/ext-hardwrap.js +127 -0
  134. package/js_ext/ace-editor/ext-inline_autocomplete.js +3547 -0
  135. package/js_ext/ace-editor/ext-keybinding_menu.js +185 -0
  136. package/js_ext/ace-editor/ext-language_tools.js +2724 -0
  137. package/js_ext/ace-editor/ext-linking.js +66 -0
  138. package/js_ext/ace-editor/ext-modelist.js +276 -0
  139. package/js_ext/ace-editor/ext-options.js +859 -0
  140. package/js_ext/ace-editor/ext-prompt.js +3161 -0
  141. package/js_ext/ace-editor/ext-rtl.js +146 -0
  142. package/js_ext/ace-editor/ext-searchbox.js +385 -0
  143. package/js_ext/ace-editor/ext-settings_menu.js +859 -0
  144. package/js_ext/ace-editor/ext-simple_tokenizer.js +137 -0
  145. package/js_ext/ace-editor/ext-spellcheck.js +79 -0
  146. package/js_ext/ace-editor/ext-split.js +203 -0
  147. package/js_ext/ace-editor/ext-static_highlight.js +194 -0
  148. package/js_ext/ace-editor/ext-statusbar.js +63 -0
  149. package/js_ext/ace-editor/ext-textarea.js +400 -0
  150. package/js_ext/ace-editor/ext-themelist.js +80 -0
  151. package/js_ext/ace-editor/ext-whitespace.js +201 -0
  152. package/js_ext/ace-editor/keybinding-emacs.js +1067 -0
  153. package/js_ext/ace-editor/keybinding-sublime.js +409 -0
  154. package/js_ext/ace-editor/keybinding-vim.js +7101 -0
  155. package/js_ext/ace-editor/keybinding-vscode.js +255 -0
  156. package/js_ext/ace-editor/mode-abap.js +200 -0
  157. package/js_ext/ace-editor/mode-abc.js +243 -0
  158. package/js_ext/ace-editor/mode-actionscript.js +234 -0
  159. package/js_ext/ace-editor/mode-ada.js +108 -0
  160. package/js_ext/ace-editor/mode-alda.js +279 -0
  161. package/js_ext/ace-editor/mode-apache_conf.js +318 -0
  162. package/js_ext/ace-editor/mode-apex.js +402 -0
  163. package/js_ext/ace-editor/mode-applescript.js +232 -0
  164. package/js_ext/ace-editor/mode-aql.js +92 -0
  165. package/js_ext/ace-editor/mode-asciidoc.js +311 -0
  166. package/js_ext/ace-editor/mode-asl.js +357 -0
  167. package/js_ext/ace-editor/mode-assembly_arm32.js +185 -0
  168. package/js_ext/ace-editor/mode-assembly_x86.js +170 -0
  169. package/js_ext/ace-editor/mode-astro.js +2474 -0
  170. package/js_ext/ace-editor/mode-autohotkey.js +208 -0
  171. package/js_ext/ace-editor/mode-basic.js +201 -0
  172. package/js_ext/ace-editor/mode-batchfile.js +199 -0
  173. package/js_ext/ace-editor/mode-bibtex.js +318 -0
  174. package/js_ext/ace-editor/mode-c9search.js +250 -0
  175. package/js_ext/ace-editor/mode-c_cpp.js +417 -0
  176. package/js_ext/ace-editor/mode-cirru.js +192 -0
  177. package/js_ext/ace-editor/mode-clojure.js +322 -0
  178. package/js_ext/ace-editor/mode-clue.js +361 -0
  179. package/js_ext/ace-editor/mode-cobol.js +82 -0
  180. package/js_ext/ace-editor/mode-coffee.js +335 -0
  181. package/js_ext/ace-editor/mode-coldfusion.js +2409 -0
  182. package/js_ext/ace-editor/mode-crystal.js +586 -0
  183. package/js_ext/ace-editor/mode-csharp.js +413 -0
  184. package/js_ext/ace-editor/mode-csound_document.js +4072 -0
  185. package/js_ext/ace-editor/mode-csound_orchestra.js +2923 -0
  186. package/js_ext/ace-editor/mode-csound_score.js +409 -0
  187. package/js_ext/ace-editor/mode-csp.js +59 -0
  188. package/js_ext/ace-editor/mode-css.js +632 -0
  189. package/js_ext/ace-editor/mode-csv.js +97 -0
  190. package/js_ext/ace-editor/mode-curly.js +2381 -0
  191. package/js_ext/ace-editor/mode-cuttlefish.js +56 -0
  192. package/js_ext/ace-editor/mode-d.js +450 -0
  193. package/js_ext/ace-editor/mode-dart.js +618 -0
  194. package/js_ext/ace-editor/mode-diff.js +129 -0
  195. package/js_ext/ace-editor/mode-django.js +2422 -0
  196. package/js_ext/ace-editor/mode-dockerfile.js +427 -0
  197. package/js_ext/ace-editor/mode-dot.js +348 -0
  198. package/js_ext/ace-editor/mode-drools.js +607 -0
  199. package/js_ext/ace-editor/mode-edifact.js +130 -0
  200. package/js_ext/ace-editor/mode-eiffel.js +120 -0
  201. package/js_ext/ace-editor/mode-ejs.js +3277 -0
  202. package/js_ext/ace-editor/mode-elixir.js +443 -0
  203. package/js_ext/ace-editor/mode-elm.js +274 -0
  204. package/js_ext/ace-editor/mode-erlang.js +836 -0
  205. package/js_ext/ace-editor/mode-flix.js +164 -0
  206. package/js_ext/ace-editor/mode-forth.js +253 -0
  207. package/js_ext/ace-editor/mode-fortran.js +361 -0
  208. package/js_ext/ace-editor/mode-fsharp.js +277 -0
  209. package/js_ext/ace-editor/mode-fsl.js +226 -0
  210. package/js_ext/ace-editor/mode-ftl.js +1255 -0
  211. package/js_ext/ace-editor/mode-gcode.js +74 -0
  212. package/js_ext/ace-editor/mode-gherkin.js +154 -0
  213. package/js_ext/ace-editor/mode-gitignore.js +49 -0
  214. package/js_ext/ace-editor/mode-glsl.js +475 -0
  215. package/js_ext/ace-editor/mode-gobstones.js +1459 -0
  216. package/js_ext/ace-editor/mode-golang.js +341 -0
  217. package/js_ext/ace-editor/mode-graphqlschema.js +174 -0
  218. package/js_ext/ace-editor/mode-groovy.js +1401 -0
  219. package/js_ext/ace-editor/mode-haml.js +1906 -0
  220. package/js_ext/ace-editor/mode-handlebars.js +2438 -0
  221. package/js_ext/ace-editor/mode-haskell.js +324 -0
  222. package/js_ext/ace-editor/mode-haskell_cabal.js +135 -0
  223. package/js_ext/ace-editor/mode-haxe.js +313 -0
  224. package/js_ext/ace-editor/mode-hjson.js +318 -0
  225. package/js_ext/ace-editor/mode-html.js +2339 -0
  226. package/js_ext/ace-editor/mode-html_elixir.js +2845 -0
  227. package/js_ext/ace-editor/mode-html_ruby.js +3294 -0
  228. package/js_ext/ace-editor/mode-ini.js +138 -0
  229. package/js_ext/ace-editor/mode-io.js +210 -0
  230. package/js_ext/ace-editor/mode-ion.js +477 -0
  231. package/js_ext/ace-editor/mode-jack.js +293 -0
  232. package/js_ext/ace-editor/mode-jade.js +2017 -0
  233. package/js_ext/ace-editor/mode-java.js +1565 -0
  234. package/js_ext/ace-editor/mode-javascript.js +1191 -0
  235. package/js_ext/ace-editor/mode-jexl.js +270 -0
  236. package/js_ext/ace-editor/mode-json.js +275 -0
  237. package/js_ext/ace-editor/mode-json5.js +308 -0
  238. package/js_ext/ace-editor/mode-jsoniq.js +2577 -0
  239. package/js_ext/ace-editor/mode-jsp.js +1618 -0
  240. package/js_ext/ace-editor/mode-jssm.js +293 -0
  241. package/js_ext/ace-editor/mode-jsx.js +1209 -0
  242. package/js_ext/ace-editor/mode-julia.js +254 -0
  243. package/js_ext/ace-editor/mode-kotlin.js +445 -0
  244. package/js_ext/ace-editor/mode-latex.js +252 -0
  245. package/js_ext/ace-editor/mode-latte.js +2522 -0
  246. package/js_ext/ace-editor/mode-less.js +742 -0
  247. package/js_ext/ace-editor/mode-liquid.js +2741 -0
  248. package/js_ext/ace-editor/mode-lisp.js +104 -0
  249. package/js_ext/ace-editor/mode-livescript.js +272 -0
  250. package/js_ext/ace-editor/mode-logiql.js +272 -0
  251. package/js_ext/ace-editor/mode-logtalk.js +309 -0
  252. package/js_ext/ace-editor/mode-lsl.js +287 -0
  253. package/js_ext/ace-editor/mode-lua.js +393 -0
  254. package/js_ext/ace-editor/mode-luapage.js +2785 -0
  255. package/js_ext/ace-editor/mode-lucene.js +145 -0
  256. package/js_ext/ace-editor/mode-makefile.js +374 -0
  257. package/js_ext/ace-editor/mode-markdown.js +2935 -0
  258. package/js_ext/ace-editor/mode-mask.js +1757 -0
  259. package/js_ext/ace-editor/mode-matlab.js +239 -0
  260. package/js_ext/ace-editor/mode-maze.js +256 -0
  261. package/js_ext/ace-editor/mode-mediawiki.js +580 -0
  262. package/js_ext/ace-editor/mode-mel.js +213 -0
  263. package/js_ext/ace-editor/mode-mips.js +231 -0
  264. package/js_ext/ace-editor/mode-mixal.js +110 -0
  265. package/js_ext/ace-editor/mode-mushcode.js +642 -0
  266. package/js_ext/ace-editor/mode-mysql.js +150 -0
  267. package/js_ext/ace-editor/mode-nasal.js +513 -0
  268. package/js_ext/ace-editor/mode-nginx.js +262 -0
  269. package/js_ext/ace-editor/mode-nim.js +325 -0
  270. package/js_ext/ace-editor/mode-nix.js +555 -0
  271. package/js_ext/ace-editor/mode-nsis.js +279 -0
  272. package/js_ext/ace-editor/mode-nunjucks.js +2677 -0
  273. package/js_ext/ace-editor/mode-objectivec.js +626 -0
  274. package/js_ext/ace-editor/mode-ocaml.js +378 -0
  275. package/js_ext/ace-editor/mode-odin.js +449 -0
  276. package/js_ext/ace-editor/mode-partiql.js +750 -0
  277. package/js_ext/ace-editor/mode-pascal.js +204 -0
  278. package/js_ext/ace-editor/mode-perl.js +318 -0
  279. package/js_ext/ace-editor/mode-pgsql.js +1860 -0
  280. package/js_ext/ace-editor/mode-php.js +14072 -0
  281. package/js_ext/ace-editor/mode-php_laravel_blade.js +14260 -0
  282. package/js_ext/ace-editor/mode-pig.js +278 -0
  283. package/js_ext/ace-editor/mode-plain_text.js +27 -0
  284. package/js_ext/ace-editor/mode-plsql.js +268 -0
  285. package/js_ext/ace-editor/mode-powershell.js +567 -0
  286. package/js_ext/ace-editor/mode-praat.js +412 -0
  287. package/js_ext/ace-editor/mode-prisma.js +457 -0
  288. package/js_ext/ace-editor/mode-prolog.js +305 -0
  289. package/js_ext/ace-editor/mode-properties.js +69 -0
  290. package/js_ext/ace-editor/mode-protobuf.js +498 -0
  291. package/js_ext/ace-editor/mode-prql.js +323 -0
  292. package/js_ext/ace-editor/mode-puppet.js +316 -0
  293. package/js_ext/ace-editor/mode-python.js +476 -0
  294. package/js_ext/ace-editor/mode-qml.js +346 -0
  295. package/js_ext/ace-editor/mode-r.js +387 -0
  296. package/js_ext/ace-editor/mode-raku.js +516 -0
  297. package/js_ext/ace-editor/mode-razor.js +2697 -0
  298. package/js_ext/ace-editor/mode-rdoc.js +286 -0
  299. package/js_ext/ace-editor/mode-red.js +388 -0
  300. package/js_ext/ace-editor/mode-redshift.js +321 -0
  301. package/js_ext/ace-editor/mode-rhtml.js +2750 -0
  302. package/js_ext/ace-editor/mode-robot.js +168 -0
  303. package/js_ext/ace-editor/mode-rst.js +245 -0
  304. package/js_ext/ace-editor/mode-ruby.js +921 -0
  305. package/js_ext/ace-editor/mode-rust.js +393 -0
  306. package/js_ext/ace-editor/mode-sac.js +349 -0
  307. package/js_ext/ace-editor/mode-sass.js +480 -0
  308. package/js_ext/ace-editor/mode-scad.js +350 -0
  309. package/js_ext/ace-editor/mode-scala.js +1395 -0
  310. package/js_ext/ace-editor/mode-scheme.js +210 -0
  311. package/js_ext/ace-editor/mode-scrypt.js +317 -0
  312. package/js_ext/ace-editor/mode-scss.js +768 -0
  313. package/js_ext/ace-editor/mode-sh.js +387 -0
  314. package/js_ext/ace-editor/mode-sjs.js +1393 -0
  315. package/js_ext/ace-editor/mode-slim.js +4770 -0
  316. package/js_ext/ace-editor/mode-smarty.js +2436 -0
  317. package/js_ext/ace-editor/mode-smithy.js +456 -0
  318. package/js_ext/ace-editor/mode-snippets.js +183 -0
  319. package/js_ext/ace-editor/mode-soy_template.js +2611 -0
  320. package/js_ext/ace-editor/mode-space.js +151 -0
  321. package/js_ext/ace-editor/mode-sparql.js +288 -0
  322. package/js_ext/ace-editor/mode-sql.js +221 -0
  323. package/js_ext/ace-editor/mode-sqlserver.js +391 -0
  324. package/js_ext/ace-editor/mode-stylus.js +443 -0
  325. package/js_ext/ace-editor/mode-svg.js +1487 -0
  326. package/js_ext/ace-editor/mode-swift.js +342 -0
  327. package/js_ext/ace-editor/mode-tcl.js +338 -0
  328. package/js_ext/ace-editor/mode-terraform.js +346 -0
  329. package/js_ext/ace-editor/mode-tex.js +212 -0
  330. package/js_ext/ace-editor/mode-text.js +9 -0
  331. package/js_ext/ace-editor/mode-textile.js +125 -0
  332. package/js_ext/ace-editor/mode-toml.js +129 -0
  333. package/js_ext/ace-editor/mode-tsv.js +124 -0
  334. package/js_ext/ace-editor/mode-tsx.js +1276 -0
  335. package/js_ext/ace-editor/mode-turtle.js +264 -0
  336. package/js_ext/ace-editor/mode-twig.js +2502 -0
  337. package/js_ext/ace-editor/mode-typescript.js +1254 -0
  338. package/js_ext/ace-editor/mode-vala.js +554 -0
  339. package/js_ext/ace-editor/mode-vbscript.js +731 -0
  340. package/js_ext/ace-editor/mode-velocity.js +2580 -0
  341. package/js_ext/ace-editor/mode-verilog.js +98 -0
  342. package/js_ext/ace-editor/mode-vhdl.js +94 -0
  343. package/js_ext/ace-editor/mode-visualforce.js +2454 -0
  344. package/js_ext/ace-editor/mode-vue.js +3834 -0
  345. package/js_ext/ace-editor/mode-wollok.js +1329 -0
  346. package/js_ext/ace-editor/mode-xml.js +477 -0
  347. package/js_ext/ace-editor/mode-xquery.js +2589 -0
  348. package/js_ext/ace-editor/mode-yaml.js +395 -0
  349. package/js_ext/ace-editor/mode-zeek.js +502 -0
  350. package/js_ext/ace-editor/mode-zig.js +585 -0
  351. package/js_ext/ace-editor/snippets/abap.js +9 -0
  352. package/js_ext/ace-editor/snippets/abc.js +16 -0
  353. package/js_ext/ace-editor/snippets/actionscript.js +16 -0
  354. package/js_ext/ace-editor/snippets/ada.js +9 -0
  355. package/js_ext/ace-editor/snippets/alda.js +9 -0
  356. package/js_ext/ace-editor/snippets/apache_conf.js +9 -0
  357. package/js_ext/ace-editor/snippets/apex.js +9 -0
  358. package/js_ext/ace-editor/snippets/applescript.js +9 -0
  359. package/js_ext/ace-editor/snippets/aql.js +9 -0
  360. package/js_ext/ace-editor/snippets/asciidoc.js +9 -0
  361. package/js_ext/ace-editor/snippets/asl.js +9 -0
  362. package/js_ext/ace-editor/snippets/assembly_arm32.js +9 -0
  363. package/js_ext/ace-editor/snippets/assembly_x86.js +9 -0
  364. package/js_ext/ace-editor/snippets/astro.js +9 -0
  365. package/js_ext/ace-editor/snippets/autohotkey.js +9 -0
  366. package/js_ext/ace-editor/snippets/basic.js +9 -0
  367. package/js_ext/ace-editor/snippets/batchfile.js +9 -0
  368. package/js_ext/ace-editor/snippets/bibtex.js +9 -0
  369. package/js_ext/ace-editor/snippets/c9search.js +9 -0
  370. package/js_ext/ace-editor/snippets/c_cpp.js +16 -0
  371. package/js_ext/ace-editor/snippets/cirru.js +9 -0
  372. package/js_ext/ace-editor/snippets/clojure.js +16 -0
  373. package/js_ext/ace-editor/snippets/clue.js +9 -0
  374. package/js_ext/ace-editor/snippets/cobol.js +9 -0
  375. package/js_ext/ace-editor/snippets/coffee.js +16 -0
  376. package/js_ext/ace-editor/snippets/coldfusion.js +9 -0
  377. package/js_ext/ace-editor/snippets/crystal.js +9 -0
  378. package/js_ext/ace-editor/snippets/csharp.js +9 -0
  379. package/js_ext/ace-editor/snippets/csound_document.js +16 -0
  380. package/js_ext/ace-editor/snippets/csound_orchestra.js +16 -0
  381. package/js_ext/ace-editor/snippets/csound_score.js +9 -0
  382. package/js_ext/ace-editor/snippets/csp.js +9 -0
  383. package/js_ext/ace-editor/snippets/css.js +16 -0
  384. package/js_ext/ace-editor/snippets/csv.js +9 -0
  385. package/js_ext/ace-editor/snippets/curly.js +9 -0
  386. package/js_ext/ace-editor/snippets/cuttlefish.js +9 -0
  387. package/js_ext/ace-editor/snippets/d.js +9 -0
  388. package/js_ext/ace-editor/snippets/dart.js +16 -0
  389. package/js_ext/ace-editor/snippets/diff.js +16 -0
  390. package/js_ext/ace-editor/snippets/django.js +16 -0
  391. package/js_ext/ace-editor/snippets/dockerfile.js +9 -0
  392. package/js_ext/ace-editor/snippets/dot.js +9 -0
  393. package/js_ext/ace-editor/snippets/drools.js +16 -0
  394. package/js_ext/ace-editor/snippets/edifact.js +16 -0
  395. package/js_ext/ace-editor/snippets/eiffel.js +9 -0
  396. package/js_ext/ace-editor/snippets/ejs.js +9 -0
  397. package/js_ext/ace-editor/snippets/elixir.js +9 -0
  398. package/js_ext/ace-editor/snippets/elm.js +9 -0
  399. package/js_ext/ace-editor/snippets/erlang.js +16 -0
  400. package/js_ext/ace-editor/snippets/flix.js +9 -0
  401. package/js_ext/ace-editor/snippets/forth.js +9 -0
  402. package/js_ext/ace-editor/snippets/fortran.js +9 -0
  403. package/js_ext/ace-editor/snippets/fsharp.js +9 -0
  404. package/js_ext/ace-editor/snippets/fsl.js +16 -0
  405. package/js_ext/ace-editor/snippets/ftl.js +9 -0
  406. package/js_ext/ace-editor/snippets/gcode.js +9 -0
  407. package/js_ext/ace-editor/snippets/gherkin.js +9 -0
  408. package/js_ext/ace-editor/snippets/gitignore.js +9 -0
  409. package/js_ext/ace-editor/snippets/glsl.js +9 -0
  410. package/js_ext/ace-editor/snippets/gobstones.js +16 -0
  411. package/js_ext/ace-editor/snippets/golang.js +9 -0
  412. package/js_ext/ace-editor/snippets/graphqlschema.js +16 -0
  413. package/js_ext/ace-editor/snippets/groovy.js +9 -0
  414. package/js_ext/ace-editor/snippets/haml.js +16 -0
  415. package/js_ext/ace-editor/snippets/handlebars.js +9 -0
  416. package/js_ext/ace-editor/snippets/haskell.js +16 -0
  417. package/js_ext/ace-editor/snippets/haskell_cabal.js +9 -0
  418. package/js_ext/ace-editor/snippets/haxe.js +9 -0
  419. package/js_ext/ace-editor/snippets/hjson.js +9 -0
  420. package/js_ext/ace-editor/snippets/html.js +16 -0
  421. package/js_ext/ace-editor/snippets/html_elixir.js +9 -0
  422. package/js_ext/ace-editor/snippets/html_ruby.js +9 -0
  423. package/js_ext/ace-editor/snippets/ini.js +9 -0
  424. package/js_ext/ace-editor/snippets/io.js +74 -0
  425. package/js_ext/ace-editor/snippets/ion.js +9 -0
  426. package/js_ext/ace-editor/snippets/jack.js +9 -0
  427. package/js_ext/ace-editor/snippets/jade.js +9 -0
  428. package/js_ext/ace-editor/snippets/java.js +16 -0
  429. package/js_ext/ace-editor/snippets/javascript.js +16 -0
  430. package/js_ext/ace-editor/snippets/jexl.js +9 -0
  431. package/js_ext/ace-editor/snippets/json.js +9 -0
  432. package/js_ext/ace-editor/snippets/json5.js +9 -0
  433. package/js_ext/ace-editor/snippets/jsoniq.js +78 -0
  434. package/js_ext/ace-editor/snippets/jsp.js +16 -0
  435. package/js_ext/ace-editor/snippets/jssm.js +9 -0
  436. package/js_ext/ace-editor/snippets/jsx.js +9 -0
  437. package/js_ext/ace-editor/snippets/julia.js +9 -0
  438. package/js_ext/ace-editor/snippets/kotlin.js +9 -0
  439. package/js_ext/ace-editor/snippets/latex.js +9 -0
  440. package/js_ext/ace-editor/snippets/latte.js +9 -0
  441. package/js_ext/ace-editor/snippets/less.js +9 -0
  442. package/js_ext/ace-editor/snippets/liquid.js +16 -0
  443. package/js_ext/ace-editor/snippets/lisp.js +9 -0
  444. package/js_ext/ace-editor/snippets/livescript.js +9 -0
  445. package/js_ext/ace-editor/snippets/logiql.js +9 -0
  446. package/js_ext/ace-editor/snippets/logtalk.js +9 -0
  447. package/js_ext/ace-editor/snippets/lsl.js +16 -0
  448. package/js_ext/ace-editor/snippets/lua.js +16 -0
  449. package/js_ext/ace-editor/snippets/luapage.js +9 -0
  450. package/js_ext/ace-editor/snippets/lucene.js +9 -0
  451. package/js_ext/ace-editor/snippets/makefile.js +16 -0
  452. package/js_ext/ace-editor/snippets/markdown.js +16 -0
  453. package/js_ext/ace-editor/snippets/mask.js +9 -0
  454. package/js_ext/ace-editor/snippets/matlab.js +9 -0
  455. package/js_ext/ace-editor/snippets/maze.js +16 -0
  456. package/js_ext/ace-editor/snippets/mediawiki.js +9 -0
  457. package/js_ext/ace-editor/snippets/mel.js +9 -0
  458. package/js_ext/ace-editor/snippets/mips.js +9 -0
  459. package/js_ext/ace-editor/snippets/mixal.js +9 -0
  460. package/js_ext/ace-editor/snippets/mushcode.js +9 -0
  461. package/js_ext/ace-editor/snippets/mysql.js +9 -0
  462. package/js_ext/ace-editor/snippets/nasal.js +9 -0
  463. package/js_ext/ace-editor/snippets/nginx.js +9 -0
  464. package/js_ext/ace-editor/snippets/nim.js +9 -0
  465. package/js_ext/ace-editor/snippets/nix.js +9 -0
  466. package/js_ext/ace-editor/snippets/nsis.js +9 -0
  467. package/js_ext/ace-editor/snippets/nunjucks.js +9 -0
  468. package/js_ext/ace-editor/snippets/objectivec.js +9 -0
  469. package/js_ext/ace-editor/snippets/ocaml.js +9 -0
  470. package/js_ext/ace-editor/snippets/odin.js +9 -0
  471. package/js_ext/ace-editor/snippets/partiql.js +9 -0
  472. package/js_ext/ace-editor/snippets/pascal.js +9 -0
  473. package/js_ext/ace-editor/snippets/perl.js +16 -0
  474. package/js_ext/ace-editor/snippets/pgsql.js +9 -0
  475. package/js_ext/ace-editor/snippets/php.js +16 -0
  476. package/js_ext/ace-editor/snippets/php_laravel_blade.js +9 -0
  477. package/js_ext/ace-editor/snippets/pig.js +9 -0
  478. package/js_ext/ace-editor/snippets/plain_text.js +9 -0
  479. package/js_ext/ace-editor/snippets/plsql.js +9 -0
  480. package/js_ext/ace-editor/snippets/powershell.js +9 -0
  481. package/js_ext/ace-editor/snippets/praat.js +9 -0
  482. package/js_ext/ace-editor/snippets/prisma.js +9 -0
  483. package/js_ext/ace-editor/snippets/prolog.js +9 -0
  484. package/js_ext/ace-editor/snippets/properties.js +9 -0
  485. package/js_ext/ace-editor/snippets/protobuf.js +9 -0
  486. package/js_ext/ace-editor/snippets/prql.js +9 -0
  487. package/js_ext/ace-editor/snippets/puppet.js +9 -0
  488. package/js_ext/ace-editor/snippets/python.js +16 -0
  489. package/js_ext/ace-editor/snippets/qml.js +9 -0
  490. package/js_ext/ace-editor/snippets/r.js +16 -0
  491. package/js_ext/ace-editor/snippets/raku.js +9 -0
  492. package/js_ext/ace-editor/snippets/razor.js +16 -0
  493. package/js_ext/ace-editor/snippets/rdoc.js +9 -0
  494. package/js_ext/ace-editor/snippets/red.js +9 -0
  495. package/js_ext/ace-editor/snippets/redshift.js +9 -0
  496. package/js_ext/ace-editor/snippets/rhtml.js +9 -0
  497. package/js_ext/ace-editor/snippets/robot.js +16 -0
  498. package/js_ext/ace-editor/snippets/rst.js +16 -0
  499. package/js_ext/ace-editor/snippets/ruby.js +16 -0
  500. package/js_ext/ace-editor/snippets/rust.js +9 -0
  501. package/js_ext/ace-editor/snippets/sac.js +9 -0
  502. package/js_ext/ace-editor/snippets/sass.js +9 -0
  503. package/js_ext/ace-editor/snippets/scad.js +9 -0
  504. package/js_ext/ace-editor/snippets/scala.js +9 -0
  505. package/js_ext/ace-editor/snippets/scheme.js +9 -0
  506. package/js_ext/ace-editor/snippets/scrypt.js +9 -0
  507. package/js_ext/ace-editor/snippets/scss.js +9 -0
  508. package/js_ext/ace-editor/snippets/sh.js +16 -0
  509. package/js_ext/ace-editor/snippets/sjs.js +9 -0
  510. package/js_ext/ace-editor/snippets/slim.js +9 -0
  511. package/js_ext/ace-editor/snippets/smarty.js +9 -0
  512. package/js_ext/ace-editor/snippets/smithy.js +9 -0
  513. package/js_ext/ace-editor/snippets/snippets.js +16 -0
  514. package/js_ext/ace-editor/snippets/soy_template.js +9 -0
  515. package/js_ext/ace-editor/snippets/space.js +9 -0
  516. package/js_ext/ace-editor/snippets/sparql.js +9 -0
  517. package/js_ext/ace-editor/snippets/sql.js +16 -0
  518. package/js_ext/ace-editor/snippets/sqlserver.js +16 -0
  519. package/js_ext/ace-editor/snippets/stylus.js +9 -0
  520. package/js_ext/ace-editor/snippets/svg.js +9 -0
  521. package/js_ext/ace-editor/snippets/swift.js +9 -0
  522. package/js_ext/ace-editor/snippets/tcl.js +16 -0
  523. package/js_ext/ace-editor/snippets/terraform.js +9 -0
  524. package/js_ext/ace-editor/snippets/tex.js +16 -0
  525. package/js_ext/ace-editor/snippets/text.js +9 -0
  526. package/js_ext/ace-editor/snippets/textile.js +16 -0
  527. package/js_ext/ace-editor/snippets/toml.js +9 -0
  528. package/js_ext/ace-editor/snippets/tsv.js +9 -0
  529. package/js_ext/ace-editor/snippets/tsx.js +9 -0
  530. package/js_ext/ace-editor/snippets/turtle.js +9 -0
  531. package/js_ext/ace-editor/snippets/twig.js +9 -0
  532. package/js_ext/ace-editor/snippets/typescript.js +9 -0
  533. package/js_ext/ace-editor/snippets/vala.js +199 -0
  534. package/js_ext/ace-editor/snippets/vbscript.js +9 -0
  535. package/js_ext/ace-editor/snippets/velocity.js +17 -0
  536. package/js_ext/ace-editor/snippets/verilog.js +9 -0
  537. package/js_ext/ace-editor/snippets/vhdl.js +9 -0
  538. package/js_ext/ace-editor/snippets/visualforce.js +9 -0
  539. package/js_ext/ace-editor/snippets/vue.js +9 -0
  540. package/js_ext/ace-editor/snippets/wollok.js +16 -0
  541. package/js_ext/ace-editor/snippets/xml.js +9 -0
  542. package/js_ext/ace-editor/snippets/xquery.js +78 -0
  543. package/js_ext/ace-editor/snippets/yaml.js +9 -0
  544. package/js_ext/ace-editor/snippets/zeek.js +9 -0
  545. package/js_ext/ace-editor/snippets/zig.js +9 -0
  546. package/js_ext/ace-editor/theme-ambiance.js +18 -0
  547. package/js_ext/ace-editor/theme-chaos.js +18 -0
  548. package/js_ext/ace-editor/theme-chrome.js +18 -0
  549. package/js_ext/ace-editor/theme-cloud9_day.js +19 -0
  550. package/js_ext/ace-editor/theme-cloud9_night.js +18 -0
  551. package/js_ext/ace-editor/theme-cloud9_night_low_color.js +18 -0
  552. package/js_ext/ace-editor/theme-cloud_editor.js +19 -0
  553. package/js_ext/ace-editor/theme-cloud_editor_dark.js +19 -0
  554. package/js_ext/ace-editor/theme-clouds.js +18 -0
  555. package/js_ext/ace-editor/theme-clouds_midnight.js +18 -0
  556. package/js_ext/ace-editor/theme-cobalt.js +18 -0
  557. package/js_ext/ace-editor/theme-crimson_editor.js +18 -0
  558. package/js_ext/ace-editor/theme-dawn.js +18 -0
  559. package/js_ext/ace-editor/theme-dracula.js +19 -0
  560. package/js_ext/ace-editor/theme-dreamweaver.js +18 -0
  561. package/js_ext/ace-editor/theme-eclipse.js +19 -0
  562. package/js_ext/ace-editor/theme-github.js +18 -0
  563. package/js_ext/ace-editor/theme-github_dark.js +18 -0
  564. package/js_ext/ace-editor/theme-github_light_default.js +18 -0
  565. package/js_ext/ace-editor/theme-gob.js +18 -0
  566. package/js_ext/ace-editor/theme-gruvbox.js +18 -0
  567. package/js_ext/ace-editor/theme-gruvbox_dark_hard.js +18 -0
  568. package/js_ext/ace-editor/theme-gruvbox_light_hard.js +18 -0
  569. package/js_ext/ace-editor/theme-idle_fingers.js +18 -0
  570. package/js_ext/ace-editor/theme-iplastic.js +18 -0
  571. package/js_ext/ace-editor/theme-katzenmilch.js +18 -0
  572. package/js_ext/ace-editor/theme-kr_theme.js +18 -0
  573. package/js_ext/ace-editor/theme-kuroir.js +18 -0
  574. package/js_ext/ace-editor/theme-merbivore.js +18 -0
  575. package/js_ext/ace-editor/theme-merbivore_soft.js +18 -0
  576. package/js_ext/ace-editor/theme-mono_industrial.js +18 -0
  577. package/js_ext/ace-editor/theme-monokai.js +18 -0
  578. package/js_ext/ace-editor/theme-nord_dark.js +19 -0
  579. package/js_ext/ace-editor/theme-one_dark.js +18 -0
  580. package/js_ext/ace-editor/theme-pastel_on_dark.js +18 -0
  581. package/js_ext/ace-editor/theme-solarized_dark.js +18 -0
  582. package/js_ext/ace-editor/theme-solarized_light.js +18 -0
  583. package/js_ext/ace-editor/theme-sqlserver.js +18 -0
  584. package/js_ext/ace-editor/theme-terminal.js +18 -0
  585. package/js_ext/ace-editor/theme-textmate.js +16 -0
  586. package/js_ext/ace-editor/theme-tomorrow.js +18 -0
  587. package/js_ext/ace-editor/theme-tomorrow_night.js +18 -0
  588. package/js_ext/ace-editor/theme-tomorrow_night_blue.js +18 -0
  589. package/js_ext/ace-editor/theme-tomorrow_night_bright.js +18 -0
  590. package/js_ext/ace-editor/theme-tomorrow_night_eighties.js +18 -0
  591. package/js_ext/ace-editor/theme-twilight.js +18 -0
  592. package/js_ext/ace-editor/theme-vibrant_ink.js +18 -0
  593. package/js_ext/ace-editor/theme-xcode.js +18 -0
  594. package/js_ext/ace-editor/worker-base.js +1332 -0
  595. package/js_ext/ace-editor/worker-coffee.js +1381 -0
  596. package/js_ext/ace-editor/worker-css.js +8913 -0
  597. package/js_ext/ace-editor/worker-html.js +10843 -0
  598. package/js_ext/ace-editor/worker-javascript.js +15353 -0
  599. package/js_ext/ace-editor/worker-json.js +1626 -0
  600. package/js_ext/ace-editor/worker-lua.js +3519 -0
  601. package/js_ext/ace-editor/worker-php.js +3788 -0
  602. package/js_ext/ace-editor/worker-xml.js +3122 -0
  603. package/js_ext/ace-editor/worker-xquery.js +57579 -0
  604. package/js_ext/ace-editor/worker-yaml.js +5819 -0
  605. package/js_ext/bootstrap.bundle.min.js +7 -0
  606. package/js_ext/highlight/default.min.css +9 -0
  607. package/js_ext/highlight/go.min.js +14 -0
  608. package/js_ext/highlight/highlight.min.js +1207 -0
  609. package/js_ext/highlight/stackoverflow-dark.min.css +13 -0
  610. package/js_ext/idb-keyval-6.2.2.mjs +7 -0
  611. package/js_ext/json-viewer.bundle.js +52 -0
  612. package/js_ext/loglevel-plugin-prefix.min.js +1 -0
  613. package/js_ext/loglevel.min.js +2 -0
  614. package/js_ext/markdown/auto-render.min.js +1 -0
  615. package/js_ext/markdown/auto-render.mjs +245 -0
  616. package/js_ext/markdown/fonts/KaTeX_AMS-Regular.woff +0 -0
  617. package/js_ext/markdown/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  618. package/js_ext/markdown/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  619. package/js_ext/markdown/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  620. package/js_ext/markdown/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  621. package/js_ext/markdown/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  622. package/js_ext/markdown/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  623. package/js_ext/markdown/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  624. package/js_ext/markdown/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  625. package/js_ext/markdown/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  626. package/js_ext/markdown/fonts/KaTeX_Main-Bold.woff +0 -0
  627. package/js_ext/markdown/fonts/KaTeX_Main-Bold.woff2 +0 -0
  628. package/js_ext/markdown/fonts/KaTeX_Main-Italic.woff +0 -0
  629. package/js_ext/markdown/fonts/KaTeX_Main-Italic.woff2 +0 -0
  630. package/js_ext/markdown/fonts/KaTeX_Main-Regular.woff +0 -0
  631. package/js_ext/markdown/fonts/KaTeX_Main-Regular.woff2 +0 -0
  632. package/js_ext/markdown/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  633. package/js_ext/markdown/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  634. package/js_ext/markdown/fonts/KaTeX_Math-Italic.woff +0 -0
  635. package/js_ext/markdown/fonts/KaTeX_Math-Italic.woff2 +0 -0
  636. package/js_ext/markdown/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  637. package/js_ext/markdown/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  638. package/js_ext/markdown/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  639. package/js_ext/markdown/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  640. package/js_ext/markdown/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  641. package/js_ext/markdown/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  642. package/js_ext/markdown/fonts/KaTeX_Script-Regular.ttf +0 -0
  643. package/js_ext/markdown/fonts/KaTeX_Script-Regular.woff +0 -0
  644. package/js_ext/markdown/fonts/KaTeX_Script-Regular.woff2 +0 -0
  645. package/js_ext/markdown/fonts/KaTeX_Size1-Regular.ttf +0 -0
  646. package/js_ext/markdown/fonts/KaTeX_Size1-Regular.woff +0 -0
  647. package/js_ext/markdown/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  648. package/js_ext/markdown/fonts/KaTeX_Size2-Regular.woff +0 -0
  649. package/js_ext/markdown/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  650. package/js_ext/markdown/fonts/KaTeX_Size3-Regular.woff +0 -0
  651. package/js_ext/markdown/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  652. package/js_ext/markdown/fonts/KaTeX_Size4-Regular.ttf +0 -0
  653. package/js_ext/markdown/fonts/KaTeX_Size4-Regular.woff +0 -0
  654. package/js_ext/markdown/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  655. package/js_ext/markdown/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  656. package/js_ext/markdown/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  657. package/js_ext/markdown/katex.min.css +1 -0
  658. package/js_ext/markdown/katex.min.js +1 -0
  659. package/js_ext/markdown/katex.mjs +18416 -0
  660. package/js_ext/markdown/markdown-it.min.js +3 -0
  661. package/js_ext/markdown/markdownItAnchor.umd.js +2 -0
  662. package/js_ext/mitt.mjs +2 -0
  663. package/js_ext/moment.min.js +1 -0
  664. package/js_ext/msgpack.mjs +1612 -0
  665. package/js_ext/rxjs.umd.min.js +195 -0
  666. package/js_ext/rxjs.umd.min.js.map +1 -0
  667. package/js_ext/vue-router.esm-browser.prod.js +6 -0
  668. package/js_ext/vue.esm-browser.min.js +18 -0
  669. package/js_ext/vue.esm-browser.prod.min.js +3 -0
  670. package/js_ext/vue3-sfc-loader.esm.js +1840 -0
  671. package/js_ext/vue3-sfc-loader.esm.js.map +4 -0
  672. package/js_ext/vue3-sfc-loader.js +1839 -0
  673. package/js_ext/wavesurfer.esm.mjs +1 -0
  674. package/js_ext/xstate.web.mjs +15 -0
  675. package/package.json +50 -0
  676. package/style.css +31 -0
@@ -0,0 +1,4770 @@
1
+ ace.define("ace/mode/slim_highlight_rules",["require","exports","module","ace/config","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
2
+ var modes = require("../config").$modes;
3
+ var oop = require("../lib/oop");
4
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
5
+ var SlimHighlightRules = function () {
6
+ this.$rules = {
7
+ "start": [
8
+ {
9
+ token: "keyword",
10
+ regex: /^(\s*)(\w+):\s*/,
11
+ onMatch: function (value, state, stack, line) {
12
+ var indent = /^\s*/.exec(line)[0];
13
+ var m = value.match(/^(\s*)(\w+):/);
14
+ var language = m[2];
15
+ if (!/^(javascript|ruby|coffee|markdown|css|scss|sass|less)$/.test(language))
16
+ language = "";
17
+ stack.unshift("language-embed", [], [indent, language], state);
18
+ return this.token;
19
+ },
20
+ stateName: "language-embed",
21
+ next: [{
22
+ token: "string",
23
+ regex: /^(\s*)/,
24
+ onMatch: function (value, state, stack, line) {
25
+ var indent = stack[2][0];
26
+ if (indent.length >= value.length) {
27
+ stack.splice(0, 3);
28
+ this.next = stack.shift();
29
+ return this.token;
30
+ }
31
+ this.next = "";
32
+ return [{ type: "text", value: indent }];
33
+ },
34
+ next: ""
35
+ }, {
36
+ token: "string",
37
+ regex: /.+/,
38
+ onMatch: function (value, state, stack, line) {
39
+ var indent = stack[2][0];
40
+ var language = stack[2][1];
41
+ var embedState = stack[1];
42
+ if (modes[language]) {
43
+ var data = modes[language].getTokenizer().getLineTokens(line.slice(indent.length), embedState.slice(0));
44
+ stack[1] = data.state;
45
+ return data.tokens;
46
+ }
47
+ return this.token;
48
+ }
49
+ }]
50
+ },
51
+ {
52
+ token: 'constant.begin.javascript.filter.slim',
53
+ regex: '^(\\s*)():$'
54
+ }, {
55
+ token: 'constant.begin..filter.slim',
56
+ regex: '^(\\s*)(ruby):$'
57
+ }, {
58
+ token: 'constant.begin.coffeescript.filter.slim',
59
+ regex: '^(\\s*)():$'
60
+ }, {
61
+ token: 'constant.begin..filter.slim',
62
+ regex: '^(\\s*)(markdown):$'
63
+ }, {
64
+ token: 'constant.begin.css.filter.slim',
65
+ regex: '^(\\s*)():$'
66
+ }, {
67
+ token: 'constant.begin.scss.filter.slim',
68
+ regex: '^(\\s*)():$'
69
+ }, {
70
+ token: 'constant.begin..filter.slim',
71
+ regex: '^(\\s*)(sass):$'
72
+ }, {
73
+ token: 'constant.begin..filter.slim',
74
+ regex: '^(\\s*)(less):$'
75
+ }, {
76
+ token: 'constant.begin..filter.slim',
77
+ regex: '^(\\s*)(erb):$'
78
+ }, {
79
+ token: 'keyword.html.tags.slim',
80
+ regex: '^(\\s*)((:?\\*(\\w)+)|doctype html|abbr|acronym|address|applet|area|article|aside|audio|base|basefont|bdo|big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|command|datalist|dd|del|details|dialog|dfn|dir|div|dl|dt|embed|fieldset|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|link|li|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|source|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video|xmp|b|u|s|em|a)(?:([.#](\\w|\\.)+)+\\s?)?\\b'
81
+ }, {
82
+ token: 'keyword.slim',
83
+ regex: '^(\\s*)(?:([.#](\\w|\\.)+)+\\s?)'
84
+ }, {
85
+ token: "string",
86
+ regex: /^(\s*)('|\||\/|(\/!))\s*/,
87
+ onMatch: function (val, state, stack, line) {
88
+ var indent = /^\s*/.exec(line)[0];
89
+ if (stack.length < 1) {
90
+ stack.push(this.next);
91
+ }
92
+ else {
93
+ stack[0] = "mlString";
94
+ }
95
+ if (stack.length < 2) {
96
+ stack.push(indent.length);
97
+ }
98
+ else {
99
+ stack[1] = indent.length;
100
+ }
101
+ return this.token;
102
+ },
103
+ next: "mlString"
104
+ }, {
105
+ token: 'keyword.control.slim',
106
+ regex: '^(\\s*)(\\-|==|=)',
107
+ push: [{
108
+ token: 'control.end.slim',
109
+ regex: '$',
110
+ next: "pop"
111
+ }, {
112
+ include: "rubyline"
113
+ }, {
114
+ include: "misc"
115
+ }]
116
+ }, {
117
+ token: 'paren',
118
+ regex: '\\(',
119
+ push: [{
120
+ token: 'paren',
121
+ regex: '\\)',
122
+ next: "pop"
123
+ }, {
124
+ include: "misc"
125
+ }]
126
+ }, {
127
+ token: 'paren',
128
+ regex: '\\[',
129
+ push: [{
130
+ token: 'paren',
131
+ regex: '\\]',
132
+ next: "pop"
133
+ }, {
134
+ include: "misc"
135
+ }]
136
+ }, {
137
+ include: "misc"
138
+ }
139
+ ],
140
+ "mlString": [{
141
+ token: "indent",
142
+ regex: /^\s*/,
143
+ onMatch: function (val, state, stack) {
144
+ var curIndent = stack[1];
145
+ if (curIndent >= val.length) {
146
+ this.next = "start";
147
+ stack.splice(0);
148
+ }
149
+ else {
150
+ this.next = "mlString";
151
+ }
152
+ return this.token;
153
+ },
154
+ next: "start"
155
+ }, {
156
+ defaultToken: "string"
157
+ }],
158
+ "rubyline": [{
159
+ token: "keyword.operator.ruby.embedded.slim",
160
+ regex: "(==|=)(<>|><|<'|'<|<|>)?|-"
161
+ }, {
162
+ token: "list.ruby.operators.slim",
163
+ regex: "(\\b)(for|in|do|if|else|elsif|unless|while|yield|not|and|or)\\b"
164
+ }, {
165
+ token: "string",
166
+ regex: "['](.)*?[']"
167
+ }, {
168
+ token: "string",
169
+ regex: "[\"](.)*?[\"]"
170
+ }],
171
+ "misc": [{
172
+ token: 'class.variable.slim',
173
+ regex: '\\@([a-zA-Z_][a-zA-Z0-9_]*)\\b'
174
+ }, {
175
+ token: "list.meta.slim",
176
+ regex: "(\\b)(true|false|nil)(\\b)"
177
+ }, {
178
+ token: 'keyword.operator.equals.slim',
179
+ regex: '='
180
+ }, {
181
+ token: "string",
182
+ regex: "['](.)*?[']"
183
+ }, {
184
+ token: "string",
185
+ regex: "[\"](.)*?[\"]"
186
+ }]
187
+ };
188
+ this.normalizeRules();
189
+ };
190
+ oop.inherits(SlimHighlightRules, TextHighlightRules);
191
+ exports.SlimHighlightRules = SlimHighlightRules;
192
+
193
+ });
194
+
195
+ ace.define("ace/mode/jsdoc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
196
+ var oop = require("../lib/oop");
197
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
198
+ var JsDocCommentHighlightRules = function () {
199
+ this.$rules = {
200
+ "start": [
201
+ {
202
+ token: ["comment.doc.tag", "comment.doc.text", "lparen.doc"],
203
+ regex: "(@(?:param|member|typedef|property|namespace|var|const|callback))(\\s*)({)",
204
+ push: [
205
+ {
206
+ token: "lparen.doc",
207
+ regex: "{",
208
+ push: [
209
+ {
210
+ include: "doc-syntax"
211
+ }, {
212
+ token: "rparen.doc",
213
+ regex: "}|(?=$)",
214
+ next: "pop"
215
+ }
216
+ ]
217
+ }, {
218
+ token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
219
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
220
+ next: "pop"
221
+ }, {
222
+ token: "rparen.doc",
223
+ regex: "}|(?=$)",
224
+ next: "pop"
225
+ }, {
226
+ include: "doc-syntax"
227
+ }, {
228
+ defaultToken: "text.doc"
229
+ }
230
+ ]
231
+ }, {
232
+ token: ["comment.doc.tag", "text.doc", "lparen.doc"],
233
+ regex: "(@(?:returns?|yields|type|this|suppress|public|protected|private|package|modifies|"
234
+ + "implements|external|exception|throws|enum|define|extends))(\\s*)({)",
235
+ push: [
236
+ {
237
+ token: "lparen.doc",
238
+ regex: "{",
239
+ push: [
240
+ {
241
+ include: "doc-syntax"
242
+ }, {
243
+ token: "rparen.doc",
244
+ regex: "}|(?=$)",
245
+ next: "pop"
246
+ }
247
+ ]
248
+ }, {
249
+ token: "rparen.doc",
250
+ regex: "}|(?=$)",
251
+ next: "pop"
252
+ }, {
253
+ include: "doc-syntax"
254
+ }, {
255
+ defaultToken: "text.doc"
256
+ }
257
+ ]
258
+ }, {
259
+ token: ["comment.doc.tag", "text.doc", "variable.parameter.doc"],
260
+ regex: "(@(?:alias|memberof|instance|module|name|lends|namespace|external|this|template|"
261
+ + "requires|param|implements|function|extends|typedef|mixes|constructor|var|"
262
+ + "memberof\\!|event|listens|exports|class|constructs|interface|emits|fires|"
263
+ + "throws|const|callback|borrows|augments))(\\s+)(\\w[\\w#\.:\/~\"\\-]*)?"
264
+ }, {
265
+ token: ["comment.doc.tag", "text.doc", "variable.parameter.doc"],
266
+ regex: "(@method)(\\s+)(\\w[\\w\.\\(\\)]*)"
267
+ }, {
268
+ token: "comment.doc.tag",
269
+ regex: "@access\\s+(?:private|public|protected)"
270
+ }, {
271
+ token: "comment.doc.tag",
272
+ regex: "@kind\\s+(?:class|constant|event|external|file|function|member|mixin|module|namespace|typedef)"
273
+ }, {
274
+ token: "comment.doc.tag",
275
+ regex: "@\\w+(?=\\s|$)"
276
+ },
277
+ JsDocCommentHighlightRules.getTagRule(),
278
+ {
279
+ defaultToken: "comment.doc.body",
280
+ caseInsensitive: true
281
+ }
282
+ ],
283
+ "doc-syntax": [{
284
+ token: "operator.doc",
285
+ regex: /[|:]/
286
+ }, {
287
+ token: "paren.doc",
288
+ regex: /[\[\]]/
289
+ }]
290
+ };
291
+ this.normalizeRules();
292
+ };
293
+ oop.inherits(JsDocCommentHighlightRules, TextHighlightRules);
294
+ JsDocCommentHighlightRules.getTagRule = function (start) {
295
+ return {
296
+ token: "comment.doc.tag.storage.type",
297
+ regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
298
+ };
299
+ };
300
+ JsDocCommentHighlightRules.getStartRule = function (start) {
301
+ return {
302
+ token: "comment.doc", // doc comment
303
+ regex: /\/\*\*(?!\/)/,
304
+ next: start
305
+ };
306
+ };
307
+ JsDocCommentHighlightRules.getEndRule = function (start) {
308
+ return {
309
+ token: "comment.doc", // closing comment
310
+ regex: "\\*\\/",
311
+ next: start
312
+ };
313
+ };
314
+ exports.JsDocCommentHighlightRules = JsDocCommentHighlightRules;
315
+
316
+ });
317
+
318
+ ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/jsdoc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
319
+ var oop = require("../lib/oop");
320
+ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocCommentHighlightRules;
321
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
322
+ var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
323
+ var JavaScriptHighlightRules = function (options) {
324
+ var keywords = {
325
+ "variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
326
+ "Namespace|QName|XML|XMLList|" + // E4X
327
+ "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
328
+ "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
329
+ "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
330
+ "SyntaxError|TypeError|URIError|" +
331
+ "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
332
+ "isNaN|parseFloat|parseInt|" +
333
+ "JSON|Math|" + // Other
334
+ "this|arguments|prototype|window|document", // Pseudo
335
+ "keyword": "const|yield|import|get|set|async|await|" +
336
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
337
+ "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
338
+ "__parent__|__count__|escape|unescape|with|__proto__|" +
339
+ "class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
340
+ "storage.type": "const|let|var|function",
341
+ "constant.language": "null|Infinity|NaN|undefined",
342
+ "support.function": "alert",
343
+ "constant.language.boolean": "true|false"
344
+ };
345
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
346
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
347
+ var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
348
+ "u[0-9a-fA-F]{4}|" + // unicode
349
+ "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
350
+ "[0-2][0-7]{0,2}|" + // oct
351
+ "3[0-7][0-7]?|" + // oct
352
+ "[4-7][0-7]?|" + //oct
353
+ ".)";
354
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
355
+ var functionCallStartRule = {
356
+ token: ["identifier", "text", "paren.lparen"],
357
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
358
+ };
359
+ this.$rules = {
360
+ "no_regex": [
361
+ DocCommentHighlightRules.getStartRule("doc-start"),
362
+ comments("no_regex"),
363
+ functionCallStartRule,
364
+ {
365
+ token: "string",
366
+ regex: "'(?=.)",
367
+ next: "qstring"
368
+ }, {
369
+ token: "string",
370
+ regex: '"(?=.)',
371
+ next: "qqstring"
372
+ }, {
373
+ token: "constant.numeric", // hexadecimal, octal and binary
374
+ regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
375
+ }, {
376
+ token: "constant.numeric", // decimal integers and floats
377
+ regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
378
+ }, {
379
+ token: [
380
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
381
+ "text", "storage.type", "text", "paren.lparen"
382
+ ],
383
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
384
+ next: "function_arguments"
385
+ }, {
386
+ token: [
387
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
388
+ ],
389
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
390
+ next: "function_arguments"
391
+ }, {
392
+ token: [
393
+ "entity.name.function", "text", "punctuation.operator",
394
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
395
+ ],
396
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
397
+ next: "function_arguments"
398
+ }, {
399
+ token: [
400
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
401
+ ],
402
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
403
+ next: "function_arguments"
404
+ }, {
405
+ token: "keyword",
406
+ regex: "from(?=\\s*('|\"))"
407
+ }, {
408
+ token: "keyword",
409
+ regex: "(?:" + kwBeforeRe + ")\\b",
410
+ next: "start"
411
+ }, {
412
+ token: "support.constant",
413
+ regex: /that\b/
414
+ }, {
415
+ token: ["storage.type", "punctuation.operator", "support.function.firebug"],
416
+ regex: /(console)(\.)(warn|info|log|error|debug|time|trace|timeEnd|assert)\b/
417
+ }, {
418
+ token: keywordMapper,
419
+ regex: identifierRe
420
+ }, {
421
+ token: "punctuation.operator",
422
+ regex: /[.](?![.])/,
423
+ next: "property"
424
+ }, {
425
+ token: "storage.type",
426
+ regex: /=>/,
427
+ next: "start"
428
+ }, {
429
+ token: "keyword.operator",
430
+ regex: /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
431
+ next: "start"
432
+ }, {
433
+ token: "punctuation.operator",
434
+ regex: /[?:,;.]/,
435
+ next: "start"
436
+ }, {
437
+ token: "paren.lparen",
438
+ regex: /[\[({]/,
439
+ next: "start"
440
+ }, {
441
+ token: "paren.rparen",
442
+ regex: /[\])}]/
443
+ }, {
444
+ token: "comment",
445
+ regex: /^#!.*$/
446
+ }
447
+ ],
448
+ property: [{
449
+ token: "text",
450
+ regex: "\\s+"
451
+ }, {
452
+ token: "keyword.operator",
453
+ regex: /=/
454
+ }, {
455
+ token: [
456
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
457
+ ],
458
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
459
+ next: "function_arguments"
460
+ }, {
461
+ token: [
462
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
463
+ ],
464
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
465
+ next: "function_arguments"
466
+ }, {
467
+ token: "punctuation.operator",
468
+ regex: /[.](?![.])/
469
+ }, {
470
+ token: "support.function",
471
+ regex: "prototype"
472
+ }, {
473
+ token: "support.function",
474
+ regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
475
+ }, {
476
+ token: "support.function.dom",
477
+ regex: /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
478
+ }, {
479
+ token: "support.constant",
480
+ regex: /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
481
+ }, {
482
+ token: "identifier",
483
+ regex: identifierRe
484
+ }, {
485
+ regex: "",
486
+ token: "empty",
487
+ next: "no_regex"
488
+ }
489
+ ],
490
+ "start": [
491
+ DocCommentHighlightRules.getStartRule("doc-start"),
492
+ comments("start"),
493
+ {
494
+ token: "string.regexp",
495
+ regex: "\\/",
496
+ next: "regex"
497
+ }, {
498
+ token: "text",
499
+ regex: "\\s+|^$",
500
+ next: "start"
501
+ }, {
502
+ token: "empty",
503
+ regex: "",
504
+ next: "no_regex"
505
+ }
506
+ ],
507
+ "regex": [
508
+ {
509
+ token: "regexp.keyword.operator",
510
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
511
+ }, {
512
+ token: "string.regexp",
513
+ regex: "/[sxngimy]*",
514
+ next: "no_regex"
515
+ }, {
516
+ token: "invalid",
517
+ regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
518
+ }, {
519
+ token: "constant.language.escape",
520
+ regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
521
+ }, {
522
+ token: "constant.language.delimiter",
523
+ regex: /\|/
524
+ }, {
525
+ token: "constant.language.escape",
526
+ regex: /\[\^?/,
527
+ next: "regex_character_class"
528
+ }, {
529
+ token: "empty",
530
+ regex: "$",
531
+ next: "no_regex"
532
+ }, {
533
+ defaultToken: "string.regexp"
534
+ }
535
+ ],
536
+ "regex_character_class": [
537
+ {
538
+ token: "regexp.charclass.keyword.operator",
539
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
540
+ }, {
541
+ token: "constant.language.escape",
542
+ regex: "]",
543
+ next: "regex"
544
+ }, {
545
+ token: "constant.language.escape",
546
+ regex: "-"
547
+ }, {
548
+ token: "empty",
549
+ regex: "$",
550
+ next: "no_regex"
551
+ }, {
552
+ defaultToken: "string.regexp.charachterclass"
553
+ }
554
+ ],
555
+ "default_parameter": [
556
+ {
557
+ token: "string",
558
+ regex: "'(?=.)",
559
+ push: [
560
+ {
561
+ token: "string",
562
+ regex: "'|$",
563
+ next: "pop"
564
+ }, {
565
+ include: "qstring"
566
+ }
567
+ ]
568
+ }, {
569
+ token: "string",
570
+ regex: '"(?=.)',
571
+ push: [
572
+ {
573
+ token: "string",
574
+ regex: '"|$',
575
+ next: "pop"
576
+ }, {
577
+ include: "qqstring"
578
+ }
579
+ ]
580
+ }, {
581
+ token: "constant.language",
582
+ regex: "null|Infinity|NaN|undefined"
583
+ }, {
584
+ token: "constant.numeric", // hexadecimal, octal and binary
585
+ regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
586
+ }, {
587
+ token: "constant.numeric", // decimal integers and floats
588
+ regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
589
+ }, {
590
+ token: "punctuation.operator",
591
+ regex: ",",
592
+ next: "function_arguments"
593
+ }, {
594
+ token: "text",
595
+ regex: "\\s+"
596
+ }, {
597
+ token: "punctuation.operator",
598
+ regex: "$"
599
+ }, {
600
+ token: "empty",
601
+ regex: "",
602
+ next: "no_regex"
603
+ }
604
+ ],
605
+ "function_arguments": [
606
+ comments("function_arguments"),
607
+ {
608
+ token: "variable.parameter",
609
+ regex: identifierRe
610
+ }, {
611
+ token: "punctuation.operator",
612
+ regex: ","
613
+ }, {
614
+ token: "text",
615
+ regex: "\\s+"
616
+ }, {
617
+ token: "punctuation.operator",
618
+ regex: "$"
619
+ }, {
620
+ token: "empty",
621
+ regex: "",
622
+ next: "no_regex"
623
+ }
624
+ ],
625
+ "qqstring": [
626
+ {
627
+ token: "constant.language.escape",
628
+ regex: escapedRe
629
+ }, {
630
+ token: "string",
631
+ regex: "\\\\$",
632
+ consumeLineEnd: true
633
+ }, {
634
+ token: "string",
635
+ regex: '"|$',
636
+ next: "no_regex"
637
+ }, {
638
+ defaultToken: "string"
639
+ }
640
+ ],
641
+ "qstring": [
642
+ {
643
+ token: "constant.language.escape",
644
+ regex: escapedRe
645
+ }, {
646
+ token: "string",
647
+ regex: "\\\\$",
648
+ consumeLineEnd: true
649
+ }, {
650
+ token: "string",
651
+ regex: "'|$",
652
+ next: "no_regex"
653
+ }, {
654
+ defaultToken: "string"
655
+ }
656
+ ]
657
+ };
658
+ if (!options || !options.noES6) {
659
+ this.$rules.no_regex.unshift({
660
+ regex: "[{}]", onMatch: function (val, state, stack) {
661
+ this.next = val == "{" ? this.nextState : "";
662
+ if (val == "{" && stack.length) {
663
+ stack.unshift("start", state);
664
+ }
665
+ else if (val == "}" && stack.length) {
666
+ stack.shift();
667
+ this.next = stack.shift();
668
+ if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
669
+ return "paren.quasi.end";
670
+ }
671
+ return val == "{" ? "paren.lparen" : "paren.rparen";
672
+ },
673
+ nextState: "start"
674
+ }, {
675
+ token: "string.quasi.start",
676
+ regex: /`/,
677
+ push: [{
678
+ token: "constant.language.escape",
679
+ regex: escapedRe
680
+ }, {
681
+ token: "paren.quasi.start",
682
+ regex: /\${/,
683
+ push: "start"
684
+ }, {
685
+ token: "string.quasi.end",
686
+ regex: /`/,
687
+ next: "pop"
688
+ }, {
689
+ defaultToken: "string.quasi"
690
+ }]
691
+ }, {
692
+ token: ["variable.parameter", "text"],
693
+ regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
694
+ }, {
695
+ token: "paren.lparen",
696
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
697
+ next: "function_arguments"
698
+ }, {
699
+ token: "variable.language",
700
+ regex: "(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\b"
701
+ });
702
+ this.$rules["function_arguments"].unshift({
703
+ token: "keyword.operator",
704
+ regex: "=",
705
+ next: "default_parameter"
706
+ }, {
707
+ token: "keyword.operator",
708
+ regex: "\\.{3}"
709
+ });
710
+ this.$rules["property"].unshift({
711
+ token: "support.function",
712
+ regex: "(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|"
713
+ + "finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\b(?=\\()"
714
+ }, {
715
+ token: "constant.language",
716
+ regex: "(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\b"
717
+ });
718
+ if (!options || options.jsx != false)
719
+ JSX.call(this);
720
+ }
721
+ this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("no_regex")]);
722
+ this.normalizeRules();
723
+ };
724
+ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
725
+ function JSX() {
726
+ var tagRegex = identifierRe.replace("\\d", "\\d\\-");
727
+ var jsxTag = {
728
+ onMatch: function (val, state, stack) {
729
+ var offset = val.charAt(1) == "/" ? 2 : 1;
730
+ if (offset == 1) {
731
+ if (state != this.nextState)
732
+ stack.unshift(this.next, this.nextState, 0);
733
+ else
734
+ stack.unshift(this.next);
735
+ stack[2]++;
736
+ }
737
+ else if (offset == 2) {
738
+ if (state == this.nextState) {
739
+ stack[1]--;
740
+ if (!stack[1] || stack[1] < 0) {
741
+ stack.shift();
742
+ stack.shift();
743
+ }
744
+ }
745
+ }
746
+ return [{
747
+ type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
748
+ value: val.slice(0, offset)
749
+ }, {
750
+ type: "meta.tag.tag-name.xml",
751
+ value: val.substr(offset)
752
+ }];
753
+ },
754
+ regex: "</?(?:" + tagRegex + "|(?=>))",
755
+ next: "jsxAttributes",
756
+ nextState: "jsx"
757
+ };
758
+ this.$rules.start.unshift(jsxTag);
759
+ var jsxJsRule = {
760
+ regex: "{",
761
+ token: "paren.quasi.start",
762
+ push: "start"
763
+ };
764
+ this.$rules.jsx = [
765
+ jsxJsRule,
766
+ jsxTag,
767
+ { include: "reference" }, { defaultToken: "string.xml" }
768
+ ];
769
+ this.$rules.jsxAttributes = [{
770
+ token: "meta.tag.punctuation.tag-close.xml",
771
+ regex: "/?>",
772
+ onMatch: function (value, currentState, stack) {
773
+ if (currentState == stack[0])
774
+ stack.shift();
775
+ if (value.length == 2) {
776
+ if (stack[0] == this.nextState)
777
+ stack[1]--;
778
+ if (!stack[1] || stack[1] < 0) {
779
+ stack.splice(0, 2);
780
+ }
781
+ }
782
+ this.next = stack[0] || "start";
783
+ return [{ type: this.token, value: value }];
784
+ },
785
+ nextState: "jsx"
786
+ },
787
+ jsxJsRule,
788
+ comments("jsxAttributes"),
789
+ {
790
+ token: "entity.other.attribute-name.xml",
791
+ regex: tagRegex
792
+ }, {
793
+ token: "keyword.operator.attribute-equals.xml",
794
+ regex: "="
795
+ }, {
796
+ token: "text.tag-whitespace.xml",
797
+ regex: "\\s+"
798
+ }, {
799
+ token: "string.attribute-value.xml",
800
+ regex: "'",
801
+ stateName: "jsx_attr_q",
802
+ push: [
803
+ { token: "string.attribute-value.xml", regex: "'", next: "pop" },
804
+ { include: "reference" },
805
+ { defaultToken: "string.attribute-value.xml" }
806
+ ]
807
+ }, {
808
+ token: "string.attribute-value.xml",
809
+ regex: '"',
810
+ stateName: "jsx_attr_qq",
811
+ push: [
812
+ { token: "string.attribute-value.xml", regex: '"', next: "pop" },
813
+ { include: "reference" },
814
+ { defaultToken: "string.attribute-value.xml" }
815
+ ]
816
+ },
817
+ jsxTag
818
+ ];
819
+ this.$rules.reference = [{
820
+ token: "constant.language.escape.reference.xml",
821
+ regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
822
+ }];
823
+ }
824
+ function comments(next) {
825
+ return [
826
+ {
827
+ token: "comment", // multi line comment
828
+ regex: /\/\*/,
829
+ next: [
830
+ DocCommentHighlightRules.getTagRule(),
831
+ { token: "comment", regex: "\\*\\/", next: next || "pop" },
832
+ { defaultToken: "comment", caseInsensitive: true }
833
+ ]
834
+ }, {
835
+ token: "comment",
836
+ regex: "\\/\\/",
837
+ next: [
838
+ DocCommentHighlightRules.getTagRule(),
839
+ { token: "comment", regex: "$|^", next: next || "pop" },
840
+ { defaultToken: "comment", caseInsensitive: true }
841
+ ]
842
+ }
843
+ ];
844
+ }
845
+ exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
846
+
847
+ });
848
+
849
+ ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
850
+ var Range = require("../range").Range;
851
+ var MatchingBraceOutdent = function () { };
852
+ (function () {
853
+ this.checkOutdent = function (line, input) {
854
+ if (!/^\s+$/.test(line))
855
+ return false;
856
+ return /^\s*\}/.test(input);
857
+ };
858
+ this.autoOutdent = function (doc, row) {
859
+ var line = doc.getLine(row);
860
+ var match = line.match(/^(\s*\})/);
861
+ if (!match)
862
+ return 0;
863
+ var column = match[1].length;
864
+ var openBracePos = doc.findMatchingBracket({ row: row, column: column });
865
+ if (!openBracePos || openBracePos.row == row)
866
+ return 0;
867
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
868
+ doc.replace(new Range(row, 0, row, column - 1), indent);
869
+ };
870
+ this.$getIndent = function (line) {
871
+ return line.match(/^\s*/)[0];
872
+ };
873
+ }).call(MatchingBraceOutdent.prototype);
874
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
875
+
876
+ });
877
+
878
+ ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
879
+ var oop = require("../../lib/oop");
880
+ var Behaviour = require("../behaviour").Behaviour;
881
+ var TokenIterator = require("../../token_iterator").TokenIterator;
882
+ function is(token, type) {
883
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
884
+ }
885
+ var XmlBehaviour = function () {
886
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
887
+ if (text == '"' || text == "'") {
888
+ var quote = text;
889
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
890
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
891
+ return {
892
+ text: quote + selected + quote,
893
+ selection: false
894
+ };
895
+ }
896
+ var cursor = editor.getCursorPosition();
897
+ var line = session.doc.getLine(cursor.row);
898
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
899
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
900
+ var token = iterator.getCurrentToken();
901
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
902
+ return {
903
+ text: "",
904
+ selection: [1, 1]
905
+ };
906
+ }
907
+ if (!token)
908
+ token = iterator.stepBackward();
909
+ if (!token)
910
+ return;
911
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
912
+ token = iterator.stepBackward();
913
+ }
914
+ var rightSpace = !rightChar || rightChar.match(/\s/);
915
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
916
+ return {
917
+ text: quote + quote,
918
+ selection: [1, 1]
919
+ };
920
+ }
921
+ }
922
+ });
923
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
924
+ var selected = session.doc.getTextRange(range);
925
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
926
+ var line = session.doc.getLine(range.start.row);
927
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
928
+ if (rightChar == selected) {
929
+ range.end.column++;
930
+ return range;
931
+ }
932
+ }
933
+ });
934
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
935
+ if (text == '>') {
936
+ var position = editor.getSelectionRange().start;
937
+ var iterator = new TokenIterator(session, position.row, position.column);
938
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
939
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
940
+ return;
941
+ if (is(token, "reference.attribute-value"))
942
+ return;
943
+ if (is(token, "attribute-value")) {
944
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
945
+ if (position.column < tokenEndColumn)
946
+ return;
947
+ if (position.column == tokenEndColumn) {
948
+ var nextToken = iterator.stepForward();
949
+ if (nextToken && is(nextToken, "attribute-value"))
950
+ return;
951
+ iterator.stepBackward();
952
+ }
953
+ }
954
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
955
+ return;
956
+ while (!is(token, "tag-name")) {
957
+ token = iterator.stepBackward();
958
+ if (token.value == "<") {
959
+ token = iterator.stepForward();
960
+ break;
961
+ }
962
+ }
963
+ var tokenRow = iterator.getCurrentTokenRow();
964
+ var tokenColumn = iterator.getCurrentTokenColumn();
965
+ if (is(iterator.stepBackward(), "end-tag-open"))
966
+ return;
967
+ var element = token.value;
968
+ if (tokenRow == position.row)
969
+ element = element.substring(0, position.column - tokenColumn);
970
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
971
+ return;
972
+ return {
973
+ text: ">" + "</" + element + ">",
974
+ selection: [1, 1]
975
+ };
976
+ }
977
+ });
978
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
979
+ if (text == "\n") {
980
+ var cursor = editor.getCursorPosition();
981
+ var line = session.getLine(cursor.row);
982
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
983
+ var token = iterator.getCurrentToken();
984
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
985
+ if (token.value == "/>")
986
+ return;
987
+ while (token && token.type.indexOf("tag-name") === -1) {
988
+ token = iterator.stepBackward();
989
+ }
990
+ if (!token) {
991
+ return;
992
+ }
993
+ var tag = token.value;
994
+ var row = iterator.getCurrentTokenRow();
995
+ token = iterator.stepBackward();
996
+ if (!token || token.type.indexOf("end-tag") !== -1) {
997
+ return;
998
+ }
999
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
1000
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
1001
+ var line = session.getLine(row);
1002
+ var nextIndent = this.$getIndent(line);
1003
+ var indent = nextIndent + session.getTabString();
1004
+ if (nextToken && nextToken.value === "</") {
1005
+ return {
1006
+ text: "\n" + indent + "\n" + nextIndent,
1007
+ selection: [1, indent.length, 1, indent.length]
1008
+ };
1009
+ }
1010
+ else {
1011
+ return {
1012
+ text: "\n" + indent
1013
+ };
1014
+ }
1015
+ }
1016
+ }
1017
+ }
1018
+ });
1019
+ };
1020
+ oop.inherits(XmlBehaviour, Behaviour);
1021
+ exports.XmlBehaviour = XmlBehaviour;
1022
+
1023
+ });
1024
+
1025
+ ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
1026
+ var oop = require("../../lib/oop");
1027
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1028
+ var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
1029
+ var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
1030
+ var JavaScriptBehaviour = function () {
1031
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
1032
+ this.addBehaviours(xmlBehaviours);
1033
+ this.inherit(CstyleBehaviour);
1034
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
1035
+ if (text == '>') {
1036
+ var position = editor.getSelectionRange().start;
1037
+ var iterator = new TokenIterator(session, position.row, position.column);
1038
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
1039
+ if (!token)
1040
+ return;
1041
+ if (token.value == '<') {
1042
+ return {
1043
+ text: "></>",
1044
+ selection: [1, 1]
1045
+ };
1046
+ }
1047
+ }
1048
+ });
1049
+ };
1050
+ oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
1051
+ exports.JavaScriptBehaviour = JavaScriptBehaviour;
1052
+
1053
+ });
1054
+
1055
+ ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
1056
+ var oop = require("../../lib/oop");
1057
+ var Range = require("../../range").Range;
1058
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1059
+ var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
1060
+ BaseFoldMode.call(this);
1061
+ this.voidElements = voidElements || {};
1062
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
1063
+ if (optionalEndTags)
1064
+ oop.mixin(this.optionalEndTags, optionalEndTags);
1065
+ };
1066
+ oop.inherits(FoldMode, BaseFoldMode);
1067
+ var Tag = function () {
1068
+ this.tagName = "";
1069
+ this.closing = false;
1070
+ this.selfClosing = false;
1071
+ this.start = { row: 0, column: 0 };
1072
+ this.end = { row: 0, column: 0 };
1073
+ };
1074
+ function is(token, type) {
1075
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
1076
+ }
1077
+ (function () {
1078
+ this.getFoldWidget = function (session, foldStyle, row) {
1079
+ var tag = this._getFirstTagInLine(session, row);
1080
+ if (!tag)
1081
+ return this.getCommentFoldWidget(session, row);
1082
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
1083
+ return foldStyle === "markbeginend" ? "end" : "";
1084
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
1085
+ return "";
1086
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
1087
+ return "";
1088
+ return "start";
1089
+ };
1090
+ this.getCommentFoldWidget = function (session, row) {
1091
+ if (/comment/.test(session.getState(row)) && /<!-/.test(session.getLine(row)))
1092
+ return "start";
1093
+ return "";
1094
+ };
1095
+ this._getFirstTagInLine = function (session, row) {
1096
+ var tokens = session.getTokens(row);
1097
+ var tag = new Tag();
1098
+ for (var i = 0; i < tokens.length; i++) {
1099
+ var token = tokens[i];
1100
+ if (is(token, "tag-open")) {
1101
+ tag.end.column = tag.start.column + token.value.length;
1102
+ tag.closing = is(token, "end-tag-open");
1103
+ token = tokens[++i];
1104
+ if (!token)
1105
+ return null;
1106
+ tag.tagName = token.value;
1107
+ if (token.value === "") { //skip empty tag name token for fragment
1108
+ token = tokens[++i];
1109
+ if (!token)
1110
+ return null;
1111
+ tag.tagName = token.value;
1112
+ }
1113
+ tag.end.column += token.value.length;
1114
+ for (i++; i < tokens.length; i++) {
1115
+ token = tokens[i];
1116
+ tag.end.column += token.value.length;
1117
+ if (is(token, "tag-close")) {
1118
+ tag.selfClosing = token.value == '/>';
1119
+ break;
1120
+ }
1121
+ }
1122
+ return tag;
1123
+ }
1124
+ else if (is(token, "tag-close")) {
1125
+ tag.selfClosing = token.value == '/>';
1126
+ return tag;
1127
+ }
1128
+ tag.start.column += token.value.length;
1129
+ }
1130
+ return null;
1131
+ };
1132
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
1133
+ var tokens = session.getTokens(row);
1134
+ var column = 0;
1135
+ for (var i = 0; i < tokens.length; i++) {
1136
+ var token = tokens[i];
1137
+ column += token.value.length;
1138
+ if (column < startColumn - 1)
1139
+ continue;
1140
+ if (is(token, "end-tag-open")) {
1141
+ token = tokens[i + 1];
1142
+ if (is(token, "tag-name") && token.value === "") {
1143
+ token = tokens[i + 2];
1144
+ }
1145
+ if (token && token.value == tagName)
1146
+ return true;
1147
+ }
1148
+ }
1149
+ return false;
1150
+ };
1151
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
1152
+ var firstTag = this._getFirstTagInLine(session, row);
1153
+ if (!firstTag) {
1154
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
1155
+ }
1156
+ var tags = session.getMatchingTags({ row: row, column: 0 });
1157
+ if (tags) {
1158
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
1159
+ }
1160
+ };
1161
+ }).call(FoldMode.prototype);
1162
+
1163
+ });
1164
+
1165
+ ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
1166
+ var oop = require("../../lib/oop");
1167
+ var Range = require("../../range").Range;
1168
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1169
+ var FoldMode = exports.FoldMode = function (commentRegex) {
1170
+ if (commentRegex) {
1171
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
1172
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
1173
+ }
1174
+ };
1175
+ oop.inherits(FoldMode, BaseFoldMode);
1176
+ (function () {
1177
+ this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
1178
+ this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
1179
+ this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
1180
+ this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
1181
+ this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
1182
+ this._getFoldWidgetBase = this.getFoldWidget;
1183
+ this.getFoldWidget = function (session, foldStyle, row) {
1184
+ var line = session.getLine(row);
1185
+ if (this.singleLineBlockCommentRe.test(line)) {
1186
+ if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
1187
+ return "";
1188
+ }
1189
+ var fw = this._getFoldWidgetBase(session, foldStyle, row);
1190
+ if (!fw && this.startRegionRe.test(line))
1191
+ return "start"; // lineCommentRegionStart
1192
+ return fw;
1193
+ };
1194
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
1195
+ var line = session.getLine(row);
1196
+ if (this.startRegionRe.test(line))
1197
+ return this.getCommentRegionBlock(session, line, row);
1198
+ var match = line.match(this.foldingStartMarker);
1199
+ if (match) {
1200
+ var i = match.index;
1201
+ if (match[1])
1202
+ return this.openingBracketBlock(session, match[1], row, i);
1203
+ var range = session.getCommentFoldRange(row, i + match[0].length, 1);
1204
+ if (range && !range.isMultiLine()) {
1205
+ if (forceMultiline) {
1206
+ range = this.getSectionRange(session, row);
1207
+ }
1208
+ else if (foldStyle != "all")
1209
+ range = null;
1210
+ }
1211
+ return range;
1212
+ }
1213
+ if (foldStyle === "markbegin")
1214
+ return;
1215
+ var match = line.match(this.foldingStopMarker);
1216
+ if (match) {
1217
+ var i = match.index + match[0].length;
1218
+ if (match[1])
1219
+ return this.closingBracketBlock(session, match[1], row, i);
1220
+ return session.getCommentFoldRange(row, i, -1);
1221
+ }
1222
+ };
1223
+ this.getSectionRange = function (session, row) {
1224
+ var line = session.getLine(row);
1225
+ var startIndent = line.search(/\S/);
1226
+ var startRow = row;
1227
+ var startColumn = line.length;
1228
+ row = row + 1;
1229
+ var endRow = row;
1230
+ var maxRow = session.getLength();
1231
+ while (++row < maxRow) {
1232
+ line = session.getLine(row);
1233
+ var indent = line.search(/\S/);
1234
+ if (indent === -1)
1235
+ continue;
1236
+ if (startIndent > indent)
1237
+ break;
1238
+ var subRange = this.getFoldWidgetRange(session, "all", row);
1239
+ if (subRange) {
1240
+ if (subRange.start.row <= startRow) {
1241
+ break;
1242
+ }
1243
+ else if (subRange.isMultiLine()) {
1244
+ row = subRange.end.row;
1245
+ }
1246
+ else if (startIndent == indent) {
1247
+ break;
1248
+ }
1249
+ }
1250
+ endRow = row;
1251
+ }
1252
+ return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
1253
+ };
1254
+ this.getCommentRegionBlock = function (session, line, row) {
1255
+ var startColumn = line.search(/\s*$/);
1256
+ var maxRow = session.getLength();
1257
+ var startRow = row;
1258
+ var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
1259
+ var depth = 1;
1260
+ while (++row < maxRow) {
1261
+ line = session.getLine(row);
1262
+ var m = re.exec(line);
1263
+ if (!m)
1264
+ continue;
1265
+ if (m[1])
1266
+ depth--;
1267
+ else
1268
+ depth++;
1269
+ if (!depth)
1270
+ break;
1271
+ }
1272
+ var endRow = row;
1273
+ if (endRow > startRow) {
1274
+ return new Range(startRow, startColumn, endRow, line.length);
1275
+ }
1276
+ };
1277
+ }).call(FoldMode.prototype);
1278
+
1279
+ });
1280
+
1281
+ ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
1282
+ var oop = require("../../lib/oop");
1283
+ var XmlFoldMode = require("./xml").FoldMode;
1284
+ var CFoldMode = require("./cstyle").FoldMode;
1285
+ var FoldMode = exports.FoldMode = function (commentRegex) {
1286
+ if (commentRegex) {
1287
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
1288
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
1289
+ }
1290
+ this.xmlFoldMode = new XmlFoldMode();
1291
+ };
1292
+ oop.inherits(FoldMode, CFoldMode);
1293
+ (function () {
1294
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
1295
+ this.getFoldWidgetBase = this.getFoldWidget;
1296
+ this.getFoldWidget = function (session, foldStyle, row) {
1297
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
1298
+ if (!fw) {
1299
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
1300
+ }
1301
+ return fw;
1302
+ };
1303
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
1304
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
1305
+ if (range)
1306
+ return range;
1307
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
1308
+ };
1309
+ }).call(FoldMode.prototype);
1310
+
1311
+ });
1312
+
1313
+ ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
1314
+ var oop = require("../lib/oop");
1315
+ var TextMode = require("./text").Mode;
1316
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1317
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1318
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
1319
+ var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
1320
+ var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
1321
+ var Mode = function () {
1322
+ this.HighlightRules = JavaScriptHighlightRules;
1323
+ this.$outdent = new MatchingBraceOutdent();
1324
+ this.$behaviour = new JavaScriptBehaviour();
1325
+ this.foldingRules = new JavaScriptFoldMode();
1326
+ };
1327
+ oop.inherits(Mode, TextMode);
1328
+ (function () {
1329
+ this.lineCommentStart = "//";
1330
+ this.blockComment = { start: "/*", end: "*/" };
1331
+ this.$quotes = { '"': '"', "'": "'", "`": "`" };
1332
+ this.$pairQuotesAfter = {
1333
+ "`": /\w/
1334
+ };
1335
+ this.getNextLineIndent = function (state, line, tab) {
1336
+ var indent = this.$getIndent(line);
1337
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
1338
+ var tokens = tokenizedLine.tokens;
1339
+ var endState = tokenizedLine.state;
1340
+ if (tokens.length && tokens[tokens.length - 1].type == "comment") {
1341
+ return indent;
1342
+ }
1343
+ if (state == "start" || state == "no_regex") {
1344
+ var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
1345
+ if (match) {
1346
+ indent += tab;
1347
+ }
1348
+ }
1349
+ else if (state == "doc-start") {
1350
+ if (endState == "start" || endState == "no_regex") {
1351
+ return "";
1352
+ }
1353
+ }
1354
+ return indent;
1355
+ };
1356
+ this.checkOutdent = function (state, line, input) {
1357
+ return this.$outdent.checkOutdent(line, input);
1358
+ };
1359
+ this.autoOutdent = function (state, doc, row) {
1360
+ this.$outdent.autoOutdent(doc, row);
1361
+ };
1362
+ this.createWorker = function (session) {
1363
+ var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
1364
+ worker.attachToDocument(session.getDocument());
1365
+ worker.on("annotate", function (results) {
1366
+ session.setAnnotations(results.data);
1367
+ });
1368
+ worker.on("terminate", function () {
1369
+ session.clearAnnotations();
1370
+ });
1371
+ return worker;
1372
+ };
1373
+ this.$id = "ace/mode/javascript";
1374
+ this.snippetFileId = "ace/snippets/javascript";
1375
+ }).call(Mode.prototype);
1376
+ exports.Mode = Mode;
1377
+
1378
+ });
1379
+
1380
+ ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
1381
+ var oop = require("../lib/oop");
1382
+ var lang = require("../lib/lang");
1383
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1384
+ var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
1385
+ var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
1386
+ var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|flex-end|flex-start|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom";
1387
+ var supportConstantColor = exports.supportConstantColor = "aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen";
1388
+ var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
1389
+ var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))";
1390
+ var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
1391
+ var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
1392
+ var CssHighlightRules = function () {
1393
+ var keywordMapper = this.createKeywordMapper({
1394
+ "support.function": supportFunction,
1395
+ "support.constant": supportConstant,
1396
+ "support.type": supportType,
1397
+ "support.constant.color": supportConstantColor,
1398
+ "support.constant.fonts": supportConstantFonts
1399
+ }, "text", true);
1400
+ this.$rules = {
1401
+ "start": [{
1402
+ include: ["strings", "url", "comments"]
1403
+ }, {
1404
+ token: "paren.lparen",
1405
+ regex: "\\{",
1406
+ next: "ruleset"
1407
+ }, {
1408
+ token: "paren.rparen",
1409
+ regex: "\\}"
1410
+ }, {
1411
+ token: "string",
1412
+ regex: "@(?!viewport)",
1413
+ next: "media"
1414
+ }, {
1415
+ token: "keyword",
1416
+ regex: "#[a-z0-9-_]+"
1417
+ }, {
1418
+ token: "keyword",
1419
+ regex: "%"
1420
+ }, {
1421
+ token: "variable",
1422
+ regex: "\\.[a-z0-9-_]+"
1423
+ }, {
1424
+ token: "string",
1425
+ regex: ":[a-z0-9-_]+"
1426
+ }, {
1427
+ token: "constant.numeric",
1428
+ regex: numRe
1429
+ }, {
1430
+ token: "constant",
1431
+ regex: "[a-z0-9-_]+"
1432
+ }, {
1433
+ caseInsensitive: true
1434
+ }],
1435
+ "media": [{
1436
+ include: ["strings", "url", "comments"]
1437
+ }, {
1438
+ token: "paren.lparen",
1439
+ regex: "\\{",
1440
+ next: "start"
1441
+ }, {
1442
+ token: "paren.rparen",
1443
+ regex: "\\}",
1444
+ next: "start"
1445
+ }, {
1446
+ token: "string",
1447
+ regex: ";",
1448
+ next: "start"
1449
+ }, {
1450
+ token: "keyword",
1451
+ regex: "(?:media|supports|document|charset|import|namespace|media|supports|document"
1452
+ + "|page|font|keyframes|viewport|counter-style|font-feature-values"
1453
+ + "|swash|ornaments|annotation|stylistic|styleset|character-variant)"
1454
+ }],
1455
+ "comments": [{
1456
+ token: "comment", // multi line comment
1457
+ regex: "\\/\\*",
1458
+ push: [{
1459
+ token: "comment",
1460
+ regex: "\\*\\/",
1461
+ next: "pop"
1462
+ }, {
1463
+ defaultToken: "comment"
1464
+ }]
1465
+ }],
1466
+ "ruleset": [{
1467
+ regex: "-(webkit|ms|moz|o)-",
1468
+ token: "text"
1469
+ }, {
1470
+ token: "punctuation.operator",
1471
+ regex: "[:;]"
1472
+ }, {
1473
+ token: "paren.rparen",
1474
+ regex: "\\}",
1475
+ next: "start"
1476
+ }, {
1477
+ include: ["strings", "url", "comments"]
1478
+ }, {
1479
+ token: ["constant.numeric", "keyword"],
1480
+ regex: "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"
1481
+ }, {
1482
+ token: "constant.numeric",
1483
+ regex: numRe
1484
+ }, {
1485
+ token: "constant.numeric", // hex6 color
1486
+ regex: "#[a-f0-9]{6}"
1487
+ }, {
1488
+ token: "constant.numeric", // hex3 color
1489
+ regex: "#[a-f0-9]{3}"
1490
+ }, {
1491
+ token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
1492
+ regex: pseudoElements
1493
+ }, {
1494
+ token: ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
1495
+ regex: pseudoClasses
1496
+ }, {
1497
+ include: "url"
1498
+ }, {
1499
+ token: keywordMapper,
1500
+ regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
1501
+ }, {
1502
+ token: "paren.lparen",
1503
+ regex: "\\{"
1504
+ }, {
1505
+ caseInsensitive: true
1506
+ }],
1507
+ url: [{
1508
+ token: "support.function",
1509
+ regex: "(?:url(:?-prefix)?|domain|regexp)\\(",
1510
+ push: [{
1511
+ token: "support.function",
1512
+ regex: "\\)",
1513
+ next: "pop"
1514
+ }, {
1515
+ defaultToken: "string"
1516
+ }]
1517
+ }],
1518
+ strings: [{
1519
+ token: "string.start",
1520
+ regex: "'",
1521
+ push: [{
1522
+ token: "string.end",
1523
+ regex: "'|$",
1524
+ next: "pop"
1525
+ }, {
1526
+ include: "escapes"
1527
+ }, {
1528
+ token: "constant.language.escape",
1529
+ regex: /\\$/,
1530
+ consumeLineEnd: true
1531
+ }, {
1532
+ defaultToken: "string"
1533
+ }]
1534
+ }, {
1535
+ token: "string.start",
1536
+ regex: '"',
1537
+ push: [{
1538
+ token: "string.end",
1539
+ regex: '"|$',
1540
+ next: "pop"
1541
+ }, {
1542
+ include: "escapes"
1543
+ }, {
1544
+ token: "constant.language.escape",
1545
+ regex: /\\$/,
1546
+ consumeLineEnd: true
1547
+ }, {
1548
+ defaultToken: "string"
1549
+ }]
1550
+ }],
1551
+ escapes: [{
1552
+ token: "constant.language.escape",
1553
+ regex: /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
1554
+ }]
1555
+ };
1556
+ this.normalizeRules();
1557
+ };
1558
+ oop.inherits(CssHighlightRules, TextHighlightRules);
1559
+ exports.CssHighlightRules = CssHighlightRules;
1560
+
1561
+ });
1562
+
1563
+ ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
1564
+ var oop = require("../lib/oop");
1565
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1566
+ var XmlHighlightRules = function (normalize) {
1567
+ var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
1568
+ this.$rules = {
1569
+ start: [
1570
+ { token: "string.cdata.xml", regex: "<\\!\\[CDATA\\[", next: "cdata" },
1571
+ {
1572
+ token: ["punctuation.instruction.xml", "keyword.instruction.xml"],
1573
+ regex: "(<\\?)(" + tagRegex + ")", next: "processing_instruction"
1574
+ },
1575
+ { token: "comment.start.xml", regex: "<\\!--", next: "comment" },
1576
+ {
1577
+ token: ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
1578
+ regex: "(<\\!)(DOCTYPE)(?=[\\s])", next: "doctype", caseInsensitive: true
1579
+ },
1580
+ { include: "tag" },
1581
+ { token: "text.end-tag-open.xml", regex: "</" },
1582
+ { token: "text.tag-open.xml", regex: "<" },
1583
+ { include: "reference" },
1584
+ { defaultToken: "text.xml" }
1585
+ ],
1586
+ processing_instruction: [{
1587
+ token: "entity.other.attribute-name.decl-attribute-name.xml",
1588
+ regex: tagRegex
1589
+ }, {
1590
+ token: "keyword.operator.decl-attribute-equals.xml",
1591
+ regex: "="
1592
+ }, {
1593
+ include: "whitespace"
1594
+ }, {
1595
+ include: "string"
1596
+ }, {
1597
+ token: "punctuation.xml-decl.xml",
1598
+ regex: "\\?>",
1599
+ next: "start"
1600
+ }],
1601
+ doctype: [
1602
+ { include: "whitespace" },
1603
+ { include: "string" },
1604
+ { token: "xml-pe.doctype.xml", regex: ">", next: "start" },
1605
+ { token: "xml-pe.xml", regex: "[-_a-zA-Z0-9:]+" },
1606
+ { token: "punctuation.int-subset", regex: "\\[", push: "int_subset" }
1607
+ ],
1608
+ int_subset: [{
1609
+ token: "text.xml",
1610
+ regex: "\\s+"
1611
+ }, {
1612
+ token: "punctuation.int-subset.xml",
1613
+ regex: "]",
1614
+ next: "pop"
1615
+ }, {
1616
+ token: ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
1617
+ regex: "(<\\!)(" + tagRegex + ")",
1618
+ push: [{
1619
+ token: "text",
1620
+ regex: "\\s+"
1621
+ },
1622
+ {
1623
+ token: "punctuation.markup-decl.xml",
1624
+ regex: ">",
1625
+ next: "pop"
1626
+ },
1627
+ { include: "string" }]
1628
+ }],
1629
+ cdata: [
1630
+ { token: "string.cdata.xml", regex: "\\]\\]>", next: "start" },
1631
+ { token: "text.xml", regex: "\\s+" },
1632
+ { token: "text.xml", regex: "(?:[^\\]]|\\](?!\\]>))+" }
1633
+ ],
1634
+ comment: [
1635
+ { token: "comment.end.xml", regex: "-->", next: "start" },
1636
+ { defaultToken: "comment.xml" }
1637
+ ],
1638
+ reference: [{
1639
+ token: "constant.language.escape.reference.xml",
1640
+ regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1641
+ }],
1642
+ attr_reference: [{
1643
+ token: "constant.language.escape.reference.attribute-value.xml",
1644
+ regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1645
+ }],
1646
+ tag: [{
1647
+ token: ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
1648
+ regex: "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
1649
+ next: [
1650
+ { include: "attributes" },
1651
+ { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start" }
1652
+ ]
1653
+ }],
1654
+ tag_whitespace: [
1655
+ { token: "text.tag-whitespace.xml", regex: "\\s+" }
1656
+ ],
1657
+ whitespace: [
1658
+ { token: "text.whitespace.xml", regex: "\\s+" }
1659
+ ],
1660
+ string: [{
1661
+ token: "string.xml",
1662
+ regex: "'",
1663
+ push: [
1664
+ { token: "string.xml", regex: "'", next: "pop" },
1665
+ { defaultToken: "string.xml" }
1666
+ ]
1667
+ }, {
1668
+ token: "string.xml",
1669
+ regex: '"',
1670
+ push: [
1671
+ { token: "string.xml", regex: '"', next: "pop" },
1672
+ { defaultToken: "string.xml" }
1673
+ ]
1674
+ }],
1675
+ attributes: [{
1676
+ token: "entity.other.attribute-name.xml",
1677
+ regex: tagRegex
1678
+ }, {
1679
+ token: "keyword.operator.attribute-equals.xml",
1680
+ regex: "="
1681
+ }, {
1682
+ include: "tag_whitespace"
1683
+ }, {
1684
+ include: "attribute_value"
1685
+ }],
1686
+ attribute_value: [{
1687
+ token: "string.attribute-value.xml",
1688
+ regex: "'",
1689
+ push: [
1690
+ { token: "string.attribute-value.xml", regex: "'", next: "pop" },
1691
+ { include: "attr_reference" },
1692
+ { defaultToken: "string.attribute-value.xml" }
1693
+ ]
1694
+ }, {
1695
+ token: "string.attribute-value.xml",
1696
+ regex: '"',
1697
+ push: [
1698
+ { token: "string.attribute-value.xml", regex: '"', next: "pop" },
1699
+ { include: "attr_reference" },
1700
+ { defaultToken: "string.attribute-value.xml" }
1701
+ ]
1702
+ }]
1703
+ };
1704
+ if (this.constructor === XmlHighlightRules)
1705
+ this.normalizeRules();
1706
+ };
1707
+ (function () {
1708
+ this.embedTagRules = function (HighlightRules, prefix, tag) {
1709
+ this.$rules.tag.unshift({
1710
+ token: ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
1711
+ regex: "(<)(" + tag + "(?=\\s|>|$))",
1712
+ next: [
1713
+ { include: "attributes" },
1714
+ { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: prefix + "start" }
1715
+ ]
1716
+ });
1717
+ this.$rules[tag + "-end"] = [
1718
+ { include: "attributes" },
1719
+ { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start",
1720
+ onMatch: function (value, currentState, stack) {
1721
+ stack.splice(0);
1722
+ return this.token;
1723
+ } }
1724
+ ];
1725
+ this.embedRules(HighlightRules, prefix, [{
1726
+ token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
1727
+ regex: "(</)(" + tag + "(?=\\s|>|$))",
1728
+ next: tag + "-end"
1729
+ }, {
1730
+ token: "string.cdata.xml",
1731
+ regex: "<\\!\\[CDATA\\["
1732
+ }, {
1733
+ token: "string.cdata.xml",
1734
+ regex: "\\]\\]>"
1735
+ }]);
1736
+ };
1737
+ }).call(TextHighlightRules.prototype);
1738
+ oop.inherits(XmlHighlightRules, TextHighlightRules);
1739
+ exports.XmlHighlightRules = XmlHighlightRules;
1740
+
1741
+ });
1742
+
1743
+ ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module){"use strict";
1744
+ var oop = require("../lib/oop");
1745
+ var lang = require("../lib/lang");
1746
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1747
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1748
+ var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
1749
+ var tagMap = lang.createMap({
1750
+ a: 'anchor',
1751
+ button: 'form',
1752
+ form: 'form',
1753
+ img: 'image',
1754
+ input: 'form',
1755
+ label: 'form',
1756
+ option: 'form',
1757
+ script: 'script',
1758
+ select: 'form',
1759
+ textarea: 'form',
1760
+ style: 'style',
1761
+ table: 'table',
1762
+ tbody: 'table',
1763
+ td: 'table',
1764
+ tfoot: 'table',
1765
+ th: 'table',
1766
+ tr: 'table'
1767
+ });
1768
+ var HtmlHighlightRules = function () {
1769
+ XmlHighlightRules.call(this);
1770
+ this.addRules({
1771
+ attributes: [{
1772
+ include: "tag_whitespace"
1773
+ }, {
1774
+ token: "entity.other.attribute-name.xml",
1775
+ regex: "[-_a-zA-Z0-9:.]+"
1776
+ }, {
1777
+ token: "keyword.operator.attribute-equals.xml",
1778
+ regex: "=",
1779
+ push: [{
1780
+ include: "tag_whitespace"
1781
+ }, {
1782
+ token: "string.unquoted.attribute-value.html",
1783
+ regex: "[^<>='\"`\\s]+",
1784
+ next: "pop"
1785
+ }, {
1786
+ token: "empty",
1787
+ regex: "",
1788
+ next: "pop"
1789
+ }]
1790
+ }, {
1791
+ include: "attribute_value"
1792
+ }],
1793
+ tag: [{
1794
+ token: function (start, tag) {
1795
+ var group = tagMap[tag];
1796
+ return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
1797
+ "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
1798
+ },
1799
+ regex: "(</?)([-_a-zA-Z0-9:.]+)",
1800
+ next: "tag_stuff"
1801
+ }],
1802
+ tag_stuff: [
1803
+ { include: "attributes" },
1804
+ { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start" }
1805
+ ]
1806
+ });
1807
+ this.embedTagRules(CssHighlightRules, "css-", "style");
1808
+ this.embedTagRules(new JavaScriptHighlightRules({ jsx: false }).getRules(), "js-", "script");
1809
+ if (this.constructor === HtmlHighlightRules)
1810
+ this.normalizeRules();
1811
+ };
1812
+ oop.inherits(HtmlHighlightRules, XmlHighlightRules);
1813
+ exports.HtmlHighlightRules = HtmlHighlightRules;
1814
+
1815
+ });
1816
+
1817
+ ace.define("ace/mode/markdown_highlight_rules",["require","exports","module","ace/config","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/html_highlight_rules"], function(require, exports, module){"use strict";
1818
+ var modes = require("../config").$modes;
1819
+ var oop = require("../lib/oop");
1820
+ var lang = require("../lib/lang");
1821
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1822
+ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
1823
+ var escaped = function (ch) {
1824
+ return "(?:[^" + lang.escapeRegExp(ch) + "\\\\]|\\\\.)*";
1825
+ };
1826
+ var MarkdownHighlightRules = function () {
1827
+ HtmlHighlightRules.call(this);
1828
+ var codeBlockStartRule = {
1829
+ token: "support.function",
1830
+ regex: /^\s*(```+[^`]*|~~~+[^~]*)$/,
1831
+ onMatch: function (value, state, stack, line) {
1832
+ var m = value.match(/^(\s*)([`~]+)(.*)/);
1833
+ var language = /[\w-]+|$/.exec(m[3])[0];
1834
+ if (!modes[language])
1835
+ language = "";
1836
+ stack.unshift("githubblock", [], [m[1], m[2], language], state);
1837
+ return this.token;
1838
+ },
1839
+ next: "githubblock"
1840
+ };
1841
+ var codeBlockRules = [{
1842
+ token: "support.function",
1843
+ regex: ".*",
1844
+ onMatch: function (value, state, stack, line) {
1845
+ var embedState = stack[1];
1846
+ var indent = stack[2][0];
1847
+ var endMarker = stack[2][1];
1848
+ var language = stack[2][2];
1849
+ var m = /^(\s*)(`+|~+)\s*$/.exec(value);
1850
+ if (m && m[1].length < indent.length + 3
1851
+ && m[2].length >= endMarker.length && m[2][0] == endMarker[0]) {
1852
+ stack.splice(0, 3);
1853
+ this.next = stack.shift();
1854
+ return this.token;
1855
+ }
1856
+ this.next = "";
1857
+ if (language && modes[language]) {
1858
+ var data = modes[language].getTokenizer().getLineTokens(value, embedState.slice(0));
1859
+ stack[1] = data.state;
1860
+ return data.tokens;
1861
+ }
1862
+ return this.token;
1863
+ }
1864
+ }];
1865
+ this.$rules["start"].unshift({
1866
+ token: "empty_line",
1867
+ regex: '^$',
1868
+ next: "allowBlock"
1869
+ }, {
1870
+ token: "markup.heading.1",
1871
+ regex: "^=+(?=\\s*$)"
1872
+ }, {
1873
+ token: "markup.heading.2",
1874
+ regex: "^\\-+(?=\\s*$)"
1875
+ }, {
1876
+ token: function (value) {
1877
+ return "markup.heading." + value.length;
1878
+ },
1879
+ regex: /^#{1,6}(?=\s|$)/,
1880
+ next: "header"
1881
+ }, codeBlockStartRule, {
1882
+ token: "string.blockquote",
1883
+ regex: "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",
1884
+ next: "blockquote"
1885
+ }, {
1886
+ token: "constant",
1887
+ regex: "^ {0,3}(?:(?:\\* ?){3,}|(?:\\- ?){3,}|(?:\\_ ?){3,})\\s*$",
1888
+ next: "allowBlock"
1889
+ }, {
1890
+ token: "markup.list",
1891
+ regex: "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
1892
+ next: "listblock-start"
1893
+ }, {
1894
+ include: "basic"
1895
+ });
1896
+ this.addRules({
1897
+ "basic": [{
1898
+ token: "constant.language.escape",
1899
+ regex: /\\[\\`*_{}\[\]()#+\-.!]/
1900
+ }, {
1901
+ token: "support.function",
1902
+ regex: "(`+)(.*?[^`])(\\1)"
1903
+ }, {
1904
+ token: ["text", "constant", "text", "url", "string", "text"],
1905
+ regex: "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$"
1906
+ }, {
1907
+ token: ["text", "string", "text", "constant", "text"],
1908
+ regex: "(\\[)(" + escaped("]") + ")(\\]\\s*\\[)(" + escaped("]") + ")(\\])"
1909
+ }, {
1910
+ token: ["text", "string", "text", "markup.underline", "string", "text"],
1911
+ regex: "(\\!?\\[)(" + // [
1912
+ escaped("]") + // link text or alt text
1913
+ ")(\\]\\()" + // ](
1914
+ '((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)' + // href or image
1915
+ '(\\s*"' + escaped('"') + '"\\s*)?' + // "title"
1916
+ "(\\))" // )
1917
+ }, {
1918
+ token: "string.strong",
1919
+ regex: "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"
1920
+ }, {
1921
+ token: "string.emphasis",
1922
+ regex: "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"
1923
+ }, {
1924
+ token: ["text", "url", "text"],
1925
+ regex: "(<)(" +
1926
+ "(?:https?|ftp|dict):[^'\">\\s]+" +
1927
+ "|" +
1928
+ "(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+" +
1929
+ ")(>)"
1930
+ }],
1931
+ "allowBlock": [
1932
+ { token: "support.function", regex: "^ {4}.+", next: "allowBlock" },
1933
+ { token: "empty_line", regex: '^$', next: "allowBlock" },
1934
+ { token: "empty", regex: "", next: "start" }
1935
+ ],
1936
+ "header": [{
1937
+ regex: "$",
1938
+ next: "start"
1939
+ }, {
1940
+ include: "basic"
1941
+ }, {
1942
+ defaultToken: "heading"
1943
+ }],
1944
+ "listblock-start": [{
1945
+ token: "support.variable",
1946
+ regex: /(?:\[[ x]\])?/,
1947
+ next: "listblock"
1948
+ }],
1949
+ "listblock": [{
1950
+ token: "empty_line",
1951
+ regex: "^$",
1952
+ next: "start"
1953
+ }, {
1954
+ token: "markup.list",
1955
+ regex: "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
1956
+ next: "listblock-start"
1957
+ }, {
1958
+ include: "basic", noEscape: true
1959
+ },
1960
+ codeBlockStartRule,
1961
+ {
1962
+ defaultToken: "list" //do not use markup.list to allow stling leading `*` differntly
1963
+ }],
1964
+ "blockquote": [{
1965
+ token: "empty_line",
1966
+ regex: "^\\s*$",
1967
+ next: "start"
1968
+ }, {
1969
+ token: "string.blockquote",
1970
+ regex: "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",
1971
+ next: "blockquote"
1972
+ }, {
1973
+ include: "basic", noEscape: true
1974
+ }, {
1975
+ defaultToken: "string.blockquote"
1976
+ }],
1977
+ "githubblock": codeBlockRules
1978
+ });
1979
+ this.normalizeRules();
1980
+ };
1981
+ oop.inherits(MarkdownHighlightRules, TextHighlightRules);
1982
+ exports.MarkdownHighlightRules = MarkdownHighlightRules;
1983
+
1984
+ });
1985
+
1986
+ ace.define("ace/mode/folding/markdown",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
1987
+ var oop = require("../../lib/oop");
1988
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1989
+ var Range = require("../../range").Range;
1990
+ var FoldMode = exports.FoldMode = function () { };
1991
+ oop.inherits(FoldMode, BaseFoldMode);
1992
+ (function () {
1993
+ this.foldingStartMarker = /^(?:[=-]+\s*$|#{1,6} |`{3})/;
1994
+ this.getFoldWidget = function (session, foldStyle, row) {
1995
+ var line = session.getLine(row);
1996
+ if (!this.foldingStartMarker.test(line))
1997
+ return "";
1998
+ if (line[0] == "`") {
1999
+ if (session.bgTokenizer.getState(row) == "start")
2000
+ return "end";
2001
+ return "start";
2002
+ }
2003
+ return "start";
2004
+ };
2005
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
2006
+ var line = session.getLine(row);
2007
+ var startColumn = line.length;
2008
+ var maxRow = session.getLength();
2009
+ var startRow = row;
2010
+ var endRow = row;
2011
+ if (!line.match(this.foldingStartMarker))
2012
+ return;
2013
+ if (line[0] == "`") {
2014
+ if (session.bgTokenizer.getState(row) !== "start") {
2015
+ while (++row < maxRow) {
2016
+ line = session.getLine(row);
2017
+ if (line[0] == "`" & line.substring(0, 3) == "```")
2018
+ break;
2019
+ }
2020
+ return new Range(startRow, startColumn, row, 0);
2021
+ }
2022
+ else {
2023
+ while (row-- > 0) {
2024
+ line = session.getLine(row);
2025
+ if (line[0] == "`" & line.substring(0, 3) == "```")
2026
+ break;
2027
+ }
2028
+ return new Range(row, line.length, startRow, 0);
2029
+ }
2030
+ }
2031
+ var token;
2032
+ function isHeading(row) {
2033
+ token = session.getTokens(row)[0];
2034
+ return token && token.type.lastIndexOf(heading, 0) === 0;
2035
+ }
2036
+ var heading = "markup.heading";
2037
+ function getLevel() {
2038
+ var ch = token.value[0];
2039
+ if (ch == "=")
2040
+ return 6;
2041
+ if (ch == "-")
2042
+ return 5;
2043
+ return 7 - token.value.search(/[^#]|$/);
2044
+ }
2045
+ if (isHeading(row)) {
2046
+ var startHeadingLevel = getLevel();
2047
+ while (++row < maxRow) {
2048
+ if (!isHeading(row))
2049
+ continue;
2050
+ var level = getLevel();
2051
+ if (level >= startHeadingLevel)
2052
+ break;
2053
+ }
2054
+ endRow = row - (!token || ["=", "-"].indexOf(token.value[0]) == -1 ? 1 : 2);
2055
+ if (endRow > startRow) {
2056
+ while (endRow > startRow && /^\s*$/.test(session.getLine(endRow)))
2057
+ endRow--;
2058
+ }
2059
+ if (endRow > startRow) {
2060
+ var endColumn = session.getLine(endRow).length;
2061
+ return new Range(startRow, startColumn, endRow, endColumn);
2062
+ }
2063
+ }
2064
+ };
2065
+ }).call(FoldMode.prototype);
2066
+
2067
+ });
2068
+
2069
+ ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module){"use strict";
2070
+ var propertyMap = {
2071
+ "background": { "#$0": 1 },
2072
+ "background-color": { "#$0": 1, "transparent": 1, "fixed": 1 },
2073
+ "background-image": { "url('/$0')": 1 },
2074
+ "background-repeat": { "repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1 },
2075
+ "background-position": { "bottom": 2, "center": 2, "left": 2, "right": 2, "top": 2, "inherit": 2 },
2076
+ "background-attachment": { "scroll": 1, "fixed": 1 },
2077
+ "background-size": { "cover": 1, "contain": 1 },
2078
+ "background-clip": { "border-box": 1, "padding-box": 1, "content-box": 1 },
2079
+ "background-origin": { "border-box": 1, "padding-box": 1, "content-box": 1 },
2080
+ "border": { "solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1 },
2081
+ "border-color": { "#$0": 1 },
2082
+ "border-style": { "solid": 2, "dashed": 2, "dotted": 2, "double": 2, "groove": 2, "hidden": 2, "inherit": 2, "inset": 2, "none": 2, "outset": 2, "ridged": 2 },
2083
+ "border-collapse": { "collapse": 1, "separate": 1 },
2084
+ "bottom": { "px": 1, "em": 1, "%": 1 },
2085
+ "clear": { "left": 1, "right": 1, "both": 1, "none": 1 },
2086
+ "color": { "#$0": 1, "rgb(#$00,0,0)": 1 },
2087
+ "cursor": { "default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1 },
2088
+ "display": { "none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1 },
2089
+ "empty-cells": { "show": 1, "hide": 1 },
2090
+ "float": { "left": 1, "right": 1, "none": 1 },
2091
+ "font-family": { "Arial": 2, "Comic Sans MS": 2, "Consolas": 2, "Courier New": 2, "Courier": 2, "Georgia": 2, "Monospace": 2, "Sans-Serif": 2, "Segoe UI": 2, "Tahoma": 2, "Times New Roman": 2, "Trebuchet MS": 2, "Verdana": 1 },
2092
+ "font-size": { "px": 1, "em": 1, "%": 1 },
2093
+ "font-weight": { "bold": 1, "normal": 1 },
2094
+ "font-style": { "italic": 1, "normal": 1 },
2095
+ "font-variant": { "normal": 1, "small-caps": 1 },
2096
+ "height": { "px": 1, "em": 1, "%": 1 },
2097
+ "left": { "px": 1, "em": 1, "%": 1 },
2098
+ "letter-spacing": { "normal": 1 },
2099
+ "line-height": { "normal": 1 },
2100
+ "list-style-type": { "none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1 },
2101
+ "margin": { "px": 1, "em": 1, "%": 1 },
2102
+ "margin-right": { "px": 1, "em": 1, "%": 1 },
2103
+ "margin-left": { "px": 1, "em": 1, "%": 1 },
2104
+ "margin-top": { "px": 1, "em": 1, "%": 1 },
2105
+ "margin-bottom": { "px": 1, "em": 1, "%": 1 },
2106
+ "max-height": { "px": 1, "em": 1, "%": 1 },
2107
+ "max-width": { "px": 1, "em": 1, "%": 1 },
2108
+ "min-height": { "px": 1, "em": 1, "%": 1 },
2109
+ "min-width": { "px": 1, "em": 1, "%": 1 },
2110
+ "overflow": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
2111
+ "overflow-x": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
2112
+ "overflow-y": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
2113
+ "padding": { "px": 1, "em": 1, "%": 1 },
2114
+ "padding-top": { "px": 1, "em": 1, "%": 1 },
2115
+ "padding-right": { "px": 1, "em": 1, "%": 1 },
2116
+ "padding-bottom": { "px": 1, "em": 1, "%": 1 },
2117
+ "padding-left": { "px": 1, "em": 1, "%": 1 },
2118
+ "page-break-after": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
2119
+ "page-break-before": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
2120
+ "position": { "absolute": 1, "relative": 1, "fixed": 1, "static": 1 },
2121
+ "right": { "px": 1, "em": 1, "%": 1 },
2122
+ "table-layout": { "fixed": 1, "auto": 1 },
2123
+ "text-decoration": { "none": 1, "underline": 1, "line-through": 1, "blink": 1 },
2124
+ "text-align": { "left": 1, "right": 1, "center": 1, "justify": 1 },
2125
+ "text-transform": { "capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1 },
2126
+ "top": { "px": 1, "em": 1, "%": 1 },
2127
+ "vertical-align": { "top": 1, "bottom": 1 },
2128
+ "visibility": { "hidden": 1, "visible": 1 },
2129
+ "white-space": { "nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1 },
2130
+ "width": { "px": 1, "em": 1, "%": 1 },
2131
+ "word-spacing": { "normal": 1 },
2132
+ "filter": { "alpha(opacity=$0100)": 1 },
2133
+ "text-shadow": { "$02px 2px 2px #777": 1 },
2134
+ "text-overflow": { "ellipsis-word": 1, "clip": 1, "ellipsis": 1 },
2135
+ "-moz-border-radius": 1,
2136
+ "-moz-border-radius-topright": 1,
2137
+ "-moz-border-radius-bottomright": 1,
2138
+ "-moz-border-radius-topleft": 1,
2139
+ "-moz-border-radius-bottomleft": 1,
2140
+ "-webkit-border-radius": 1,
2141
+ "-webkit-border-top-right-radius": 1,
2142
+ "-webkit-border-top-left-radius": 1,
2143
+ "-webkit-border-bottom-right-radius": 1,
2144
+ "-webkit-border-bottom-left-radius": 1,
2145
+ "-moz-box-shadow": 1,
2146
+ "-webkit-box-shadow": 1,
2147
+ "transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
2148
+ "-moz-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
2149
+ "-webkit-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 }
2150
+ };
2151
+ var CssCompletions = function () {
2152
+ };
2153
+ (function () {
2154
+ this.completionsDefined = false;
2155
+ this.defineCompletions = function () {
2156
+ if (document) {
2157
+ var style = document.createElement('c').style;
2158
+ for (var i in style) {
2159
+ if (typeof style[i] !== 'string')
2160
+ continue;
2161
+ var name = i.replace(/[A-Z]/g, function (x) {
2162
+ return '-' + x.toLowerCase();
2163
+ });
2164
+ if (!propertyMap.hasOwnProperty(name))
2165
+ propertyMap[name] = 1;
2166
+ }
2167
+ }
2168
+ this.completionsDefined = true;
2169
+ };
2170
+ this.getCompletions = function (state, session, pos, prefix) {
2171
+ if (!this.completionsDefined) {
2172
+ this.defineCompletions();
2173
+ }
2174
+ if (state === 'ruleset' || session.$mode.$id == "ace/mode/scss") {
2175
+ var line = session.getLine(pos.row).substr(0, pos.column);
2176
+ var inParens = /\([^)]*$/.test(line);
2177
+ if (inParens) {
2178
+ line = line.substr(line.lastIndexOf('(') + 1);
2179
+ }
2180
+ if (/:[^;]+$/.test(line)) {
2181
+ /([\w\-]+):[^:]*$/.test(line);
2182
+ return this.getPropertyValueCompletions(state, session, pos, prefix);
2183
+ }
2184
+ else {
2185
+ return this.getPropertyCompletions(state, session, pos, prefix, inParens);
2186
+ }
2187
+ }
2188
+ return [];
2189
+ };
2190
+ this.getPropertyCompletions = function (state, session, pos, prefix, skipSemicolon) {
2191
+ skipSemicolon = skipSemicolon || false;
2192
+ var properties = Object.keys(propertyMap);
2193
+ return properties.map(function (property) {
2194
+ return {
2195
+ caption: property,
2196
+ snippet: property + ': $0' + (skipSemicolon ? '' : ';'),
2197
+ meta: "property",
2198
+ score: 1000000
2199
+ };
2200
+ });
2201
+ };
2202
+ this.getPropertyValueCompletions = function (state, session, pos, prefix) {
2203
+ var line = session.getLine(pos.row).substr(0, pos.column);
2204
+ var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
2205
+ if (!property)
2206
+ return [];
2207
+ var values = [];
2208
+ if (property in propertyMap && typeof propertyMap[property] === "object") {
2209
+ values = Object.keys(propertyMap[property]);
2210
+ }
2211
+ return values.map(function (value) {
2212
+ return {
2213
+ caption: value,
2214
+ snippet: value,
2215
+ meta: "property value",
2216
+ score: 1000000
2217
+ };
2218
+ });
2219
+ };
2220
+ }).call(CssCompletions.prototype);
2221
+ exports.CssCompletions = CssCompletions;
2222
+
2223
+ });
2224
+
2225
+ ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module){"use strict";
2226
+ var oop = require("../../lib/oop");
2227
+ var Behaviour = require("../behaviour").Behaviour;
2228
+ var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
2229
+ var TokenIterator = require("../../token_iterator").TokenIterator;
2230
+ var CssBehaviour = function () {
2231
+ this.inherit(CstyleBehaviour);
2232
+ this.add("colon", "insertion", function (state, action, editor, session, text) {
2233
+ if (text === ':' && editor.selection.isEmpty()) {
2234
+ var cursor = editor.getCursorPosition();
2235
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
2236
+ var token = iterator.getCurrentToken();
2237
+ if (token && token.value.match(/\s+/)) {
2238
+ token = iterator.stepBackward();
2239
+ }
2240
+ if (token && token.type === 'support.type') {
2241
+ var line = session.doc.getLine(cursor.row);
2242
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
2243
+ if (rightChar === ':') {
2244
+ return {
2245
+ text: '',
2246
+ selection: [1, 1]
2247
+ };
2248
+ }
2249
+ if (/^(\s+[^;]|\s*$)/.test(line.substring(cursor.column))) {
2250
+ return {
2251
+ text: ':;',
2252
+ selection: [1, 1]
2253
+ };
2254
+ }
2255
+ }
2256
+ }
2257
+ });
2258
+ this.add("colon", "deletion", function (state, action, editor, session, range) {
2259
+ var selected = session.doc.getTextRange(range);
2260
+ if (!range.isMultiLine() && selected === ':') {
2261
+ var cursor = editor.getCursorPosition();
2262
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
2263
+ var token = iterator.getCurrentToken();
2264
+ if (token && token.value.match(/\s+/)) {
2265
+ token = iterator.stepBackward();
2266
+ }
2267
+ if (token && token.type === 'support.type') {
2268
+ var line = session.doc.getLine(range.start.row);
2269
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
2270
+ if (rightChar === ';') {
2271
+ range.end.column++;
2272
+ return range;
2273
+ }
2274
+ }
2275
+ }
2276
+ });
2277
+ this.add("semicolon", "insertion", function (state, action, editor, session, text) {
2278
+ if (text === ';' && editor.selection.isEmpty()) {
2279
+ var cursor = editor.getCursorPosition();
2280
+ var line = session.doc.getLine(cursor.row);
2281
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
2282
+ if (rightChar === ';') {
2283
+ return {
2284
+ text: '',
2285
+ selection: [1, 1]
2286
+ };
2287
+ }
2288
+ }
2289
+ });
2290
+ this.add("!important", "insertion", function (state, action, editor, session, text) {
2291
+ if (text === '!' && editor.selection.isEmpty()) {
2292
+ var cursor = editor.getCursorPosition();
2293
+ var line = session.doc.getLine(cursor.row);
2294
+ if (/^\s*(;|}|$)/.test(line.substring(cursor.column))) {
2295
+ return {
2296
+ text: '!important',
2297
+ selection: [10, 10]
2298
+ };
2299
+ }
2300
+ }
2301
+ });
2302
+ };
2303
+ oop.inherits(CssBehaviour, CstyleBehaviour);
2304
+ exports.CssBehaviour = CssBehaviour;
2305
+
2306
+ });
2307
+
2308
+ ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
2309
+ var oop = require("../lib/oop");
2310
+ var TextMode = require("./text").Mode;
2311
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
2312
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
2313
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
2314
+ var CssCompletions = require("./css_completions").CssCompletions;
2315
+ var CssBehaviour = require("./behaviour/css").CssBehaviour;
2316
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
2317
+ var Mode = function () {
2318
+ this.HighlightRules = CssHighlightRules;
2319
+ this.$outdent = new MatchingBraceOutdent();
2320
+ this.$behaviour = new CssBehaviour();
2321
+ this.$completer = new CssCompletions();
2322
+ this.foldingRules = new CStyleFoldMode();
2323
+ };
2324
+ oop.inherits(Mode, TextMode);
2325
+ (function () {
2326
+ this.foldingRules = "cStyle";
2327
+ this.blockComment = { start: "/*", end: "*/" };
2328
+ this.getNextLineIndent = function (state, line, tab) {
2329
+ var indent = this.$getIndent(line);
2330
+ var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
2331
+ if (tokens.length && tokens[tokens.length - 1].type == "comment") {
2332
+ return indent;
2333
+ }
2334
+ var match = line.match(/^.*\{\s*$/);
2335
+ if (match) {
2336
+ indent += tab;
2337
+ }
2338
+ return indent;
2339
+ };
2340
+ this.checkOutdent = function (state, line, input) {
2341
+ return this.$outdent.checkOutdent(line, input);
2342
+ };
2343
+ this.autoOutdent = function (state, doc, row) {
2344
+ this.$outdent.autoOutdent(doc, row);
2345
+ };
2346
+ this.getCompletions = function (state, session, pos, prefix) {
2347
+ return this.$completer.getCompletions(state, session, pos, prefix);
2348
+ };
2349
+ this.createWorker = function (session) {
2350
+ var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
2351
+ worker.attachToDocument(session.getDocument());
2352
+ worker.on("annotate", function (e) {
2353
+ session.setAnnotations(e.data);
2354
+ });
2355
+ worker.on("terminate", function () {
2356
+ session.clearAnnotations();
2357
+ });
2358
+ return worker;
2359
+ };
2360
+ this.$id = "ace/mode/css";
2361
+ this.snippetFileId = "ace/snippets/css";
2362
+ }).call(Mode.prototype);
2363
+ exports.Mode = Mode;
2364
+
2365
+ });
2366
+
2367
+ ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
2368
+ var oop = require("../../lib/oop");
2369
+ var BaseFoldMode = require("./fold_mode").FoldMode;
2370
+ var FoldMode = exports.FoldMode = function (defaultMode, subModes) {
2371
+ this.defaultMode = defaultMode;
2372
+ this.subModes = subModes;
2373
+ };
2374
+ oop.inherits(FoldMode, BaseFoldMode);
2375
+ (function () {
2376
+ this.$getMode = function (state) {
2377
+ if (typeof state != "string")
2378
+ state = state[0];
2379
+ for (var key in this.subModes) {
2380
+ if (state.indexOf(key) === 0)
2381
+ return this.subModes[key];
2382
+ }
2383
+ return null;
2384
+ };
2385
+ this.$tryMode = function (state, session, foldStyle, row) {
2386
+ var mode = this.$getMode(state);
2387
+ return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
2388
+ };
2389
+ this.getFoldWidget = function (session, foldStyle, row) {
2390
+ return (this.$tryMode(session.getState(row - 1), session, foldStyle, row) ||
2391
+ this.$tryMode(session.getState(row), session, foldStyle, row) ||
2392
+ this.defaultMode.getFoldWidget(session, foldStyle, row));
2393
+ };
2394
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
2395
+ var mode = this.$getMode(session.getState(row - 1));
2396
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
2397
+ mode = this.$getMode(session.getState(row));
2398
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
2399
+ mode = this.defaultMode;
2400
+ return mode.getFoldWidgetRange(session, foldStyle, row);
2401
+ };
2402
+ }).call(FoldMode.prototype);
2403
+
2404
+ });
2405
+
2406
+ ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
2407
+ var oop = require("../../lib/oop");
2408
+ var MixedFoldMode = require("./mixed").FoldMode;
2409
+ var XmlFoldMode = require("./xml").FoldMode;
2410
+ var CStyleFoldMode = require("./cstyle").FoldMode;
2411
+ var FoldMode = exports.FoldMode = function (voidElements, optionalTags) {
2412
+ MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
2413
+ "js-": new CStyleFoldMode(),
2414
+ "css-": new CStyleFoldMode()
2415
+ });
2416
+ };
2417
+ oop.inherits(FoldMode, MixedFoldMode);
2418
+
2419
+ });
2420
+
2421
+ ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module){"use strict";
2422
+ var TokenIterator = require("../token_iterator").TokenIterator;
2423
+ var commonAttributes = [
2424
+ "accesskey",
2425
+ "class",
2426
+ "contenteditable",
2427
+ "contextmenu",
2428
+ "dir",
2429
+ "draggable",
2430
+ "dropzone",
2431
+ "hidden",
2432
+ "id",
2433
+ "inert",
2434
+ "itemid",
2435
+ "itemprop",
2436
+ "itemref",
2437
+ "itemscope",
2438
+ "itemtype",
2439
+ "lang",
2440
+ "spellcheck",
2441
+ "style",
2442
+ "tabindex",
2443
+ "title",
2444
+ "translate"
2445
+ ];
2446
+ var eventAttributes = [
2447
+ "onabort",
2448
+ "onblur",
2449
+ "oncancel",
2450
+ "oncanplay",
2451
+ "oncanplaythrough",
2452
+ "onchange",
2453
+ "onclick",
2454
+ "onclose",
2455
+ "oncontextmenu",
2456
+ "oncuechange",
2457
+ "ondblclick",
2458
+ "ondrag",
2459
+ "ondragend",
2460
+ "ondragenter",
2461
+ "ondragleave",
2462
+ "ondragover",
2463
+ "ondragstart",
2464
+ "ondrop",
2465
+ "ondurationchange",
2466
+ "onemptied",
2467
+ "onended",
2468
+ "onerror",
2469
+ "onfocus",
2470
+ "oninput",
2471
+ "oninvalid",
2472
+ "onkeydown",
2473
+ "onkeypress",
2474
+ "onkeyup",
2475
+ "onload",
2476
+ "onloadeddata",
2477
+ "onloadedmetadata",
2478
+ "onloadstart",
2479
+ "onmousedown",
2480
+ "onmousemove",
2481
+ "onmouseout",
2482
+ "onmouseover",
2483
+ "onmouseup",
2484
+ "onmousewheel",
2485
+ "onpause",
2486
+ "onplay",
2487
+ "onplaying",
2488
+ "onprogress",
2489
+ "onratechange",
2490
+ "onreset",
2491
+ "onscroll",
2492
+ "onseeked",
2493
+ "onseeking",
2494
+ "onselect",
2495
+ "onshow",
2496
+ "onstalled",
2497
+ "onsubmit",
2498
+ "onsuspend",
2499
+ "ontimeupdate",
2500
+ "onvolumechange",
2501
+ "onwaiting"
2502
+ ];
2503
+ var globalAttributes = commonAttributes.concat(eventAttributes);
2504
+ var attributeMap = {
2505
+ "a": { "href": 1, "target": { "_blank": 1, "top": 1 }, "ping": 1, "rel": { "nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1 }, "media": 1, "hreflang": 1, "type": 1 },
2506
+ "abbr": {},
2507
+ "address": {},
2508
+ "area": { "shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1 },
2509
+ "article": { "pubdate": 1 },
2510
+ "aside": {},
2511
+ "audio": { "src": 1, "autobuffer": 1, "autoplay": { "autoplay": 1 }, "loop": { "loop": 1 }, "controls": { "controls": 1 }, "muted": { "muted": 1 }, "preload": { "auto": 1, "metadata": 1, "none": 1 } },
2512
+ "b": {},
2513
+ "base": { "href": 1, "target": 1 },
2514
+ "bdi": {},
2515
+ "bdo": {},
2516
+ "blockquote": { "cite": 1 },
2517
+ "body": { "onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1 },
2518
+ "br": {},
2519
+ "button": { "autofocus": 1, "disabled": { "disabled": 1 }, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": { "button": 1, "submit": 1 } },
2520
+ "canvas": { "width": 1, "height": 1 },
2521
+ "caption": {},
2522
+ "cite": {},
2523
+ "code": {},
2524
+ "col": { "span": 1 },
2525
+ "colgroup": { "span": 1 },
2526
+ "command": { "type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1 },
2527
+ "data": {},
2528
+ "datalist": {},
2529
+ "dd": {},
2530
+ "del": { "cite": 1, "datetime": 1 },
2531
+ "details": { "open": 1 },
2532
+ "dfn": {},
2533
+ "dialog": { "open": 1 },
2534
+ "div": {},
2535
+ "dl": {},
2536
+ "dt": {},
2537
+ "em": {},
2538
+ "embed": { "src": 1, "height": 1, "width": 1, "type": 1 },
2539
+ "fieldset": { "disabled": 1, "form": 1, "name": 1 },
2540
+ "figcaption": {},
2541
+ "figure": {},
2542
+ "footer": {},
2543
+ "form": { "accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": { "multipart/form-data": 1, "application/x-www-form-urlencoded": 1 }, "method": { "get": 1, "post": 1 }, "name": 1, "novalidate": 1, "target": { "_blank": 1, "top": 1 } },
2544
+ "h1": {},
2545
+ "h2": {},
2546
+ "h3": {},
2547
+ "h4": {},
2548
+ "h5": {},
2549
+ "h6": {},
2550
+ "head": {},
2551
+ "header": {},
2552
+ "hr": {},
2553
+ "html": { "manifest": 1 },
2554
+ "i": {},
2555
+ "iframe": { "name": 1, "src": 1, "height": 1, "width": 1, "sandbox": { "allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1 }, "seamless": { "seamless": 1 } },
2556
+ "img": { "alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1 },
2557
+ "input": {
2558
+ "type": { "text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1 },
2559
+ "accept": 1, "alt": 1, "autocomplete": { "on": 1, "off": 1 }, "autofocus": { "autofocus": 1 }, "checked": { "checked": 1 }, "disabled": { "disabled": 1 }, "form": 1, "formaction": 1, "formenctype": { "application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1 }, "formmethod": { "get": 1, "post": 1 }, "formnovalidate": { "formnovalidate": 1 }, "formtarget": { "_blank": 1, "_self": 1, "_parent": 1, "_top": 1 }, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": { "multiple": 1 }, "name": 1, "pattern": 1, "placeholder": 1, "readonly": { "readonly": 1 }, "required": { "required": 1 }, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1
2560
+ },
2561
+ "ins": { "cite": 1, "datetime": 1 },
2562
+ "kbd": {},
2563
+ "keygen": { "autofocus": 1, "challenge": { "challenge": 1 }, "disabled": { "disabled": 1 }, "form": 1, "keytype": { "rsa": 1, "dsa": 1, "ec": 1 }, "name": 1 },
2564
+ "label": { "form": 1, "for": 1 },
2565
+ "legend": {},
2566
+ "li": { "value": 1 },
2567
+ "link": { "href": 1, "hreflang": 1, "rel": { "stylesheet": 1, "icon": 1 }, "media": { "all": 1, "screen": 1, "print": 1 }, "type": { "text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1 }, "sizes": 1 },
2568
+ "main": {},
2569
+ "map": { "name": 1 },
2570
+ "mark": {},
2571
+ "math": {},
2572
+ "menu": { "type": 1, "label": 1 },
2573
+ "meta": { "http-equiv": { "content-type": 1 }, "name": { "description": 1, "keywords": 1 }, "content": { "text/html; charset=UTF-8": 1 }, "charset": 1 },
2574
+ "meter": { "value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1 },
2575
+ "nav": {},
2576
+ "noscript": { "href": 1 },
2577
+ "object": { "param": 1, "data": 1, "type": 1, "height": 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1 },
2578
+ "ol": { "start": 1, "reversed": 1 },
2579
+ "optgroup": { "disabled": 1, "label": 1 },
2580
+ "option": { "disabled": 1, "selected": 1, "label": 1, "value": 1 },
2581
+ "output": { "for": 1, "form": 1, "name": 1 },
2582
+ "p": {},
2583
+ "param": { "name": 1, "value": 1 },
2584
+ "pre": {},
2585
+ "progress": { "value": 1, "max": 1 },
2586
+ "q": { "cite": 1 },
2587
+ "rp": {},
2588
+ "rt": {},
2589
+ "ruby": {},
2590
+ "s": {},
2591
+ "samp": {},
2592
+ "script": { "charset": 1, "type": { "text/javascript": 1 }, "src": 1, "defer": 1, "async": 1 },
2593
+ "select": { "autofocus": 1, "disabled": 1, "form": 1, "multiple": { "multiple": 1 }, "name": 1, "size": 1, "readonly": { "readonly": 1 } },
2594
+ "small": {},
2595
+ "source": { "src": 1, "type": 1, "media": 1 },
2596
+ "span": {},
2597
+ "strong": {},
2598
+ "style": { "type": 1, "media": { "all": 1, "screen": 1, "print": 1 }, "scoped": 1 },
2599
+ "sub": {},
2600
+ "sup": {},
2601
+ "svg": {},
2602
+ "table": { "summary": 1 },
2603
+ "tbody": {},
2604
+ "td": { "headers": 1, "rowspan": 1, "colspan": 1 },
2605
+ "textarea": { "autofocus": { "autofocus": 1 }, "disabled": { "disabled": 1 }, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": { "readonly": 1 }, "required": { "required": 1 }, "rows": 1, "cols": 1, "wrap": { "on": 1, "off": 1, "hard": 1, "soft": 1 } },
2606
+ "tfoot": {},
2607
+ "th": { "headers": 1, "rowspan": 1, "colspan": 1, "scope": 1 },
2608
+ "thead": {},
2609
+ "time": { "datetime": 1 },
2610
+ "title": {},
2611
+ "tr": {},
2612
+ "track": { "kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1 },
2613
+ "section": {},
2614
+ "summary": {},
2615
+ "u": {},
2616
+ "ul": {},
2617
+ "var": {},
2618
+ "video": { "src": 1, "autobuffer": 1, "autoplay": { "autoplay": 1 }, "loop": { "loop": 1 }, "controls": { "controls": 1 }, "width": 1, "height": 1, "poster": 1, "muted": { "muted": 1 }, "preload": { "auto": 1, "metadata": 1, "none": 1 } },
2619
+ "wbr": {}
2620
+ };
2621
+ var elements = Object.keys(attributeMap);
2622
+ function is(token, type) {
2623
+ return token.type.lastIndexOf(type + ".xml") > -1;
2624
+ }
2625
+ function findTagName(session, pos) {
2626
+ var iterator = new TokenIterator(session, pos.row, pos.column);
2627
+ var token = iterator.getCurrentToken();
2628
+ while (token && !is(token, "tag-name")) {
2629
+ token = iterator.stepBackward();
2630
+ }
2631
+ if (token)
2632
+ return token.value;
2633
+ }
2634
+ function findAttributeName(session, pos) {
2635
+ var iterator = new TokenIterator(session, pos.row, pos.column);
2636
+ var token = iterator.getCurrentToken();
2637
+ while (token && !is(token, "attribute-name")) {
2638
+ token = iterator.stepBackward();
2639
+ }
2640
+ if (token)
2641
+ return token.value;
2642
+ }
2643
+ var HtmlCompletions = function () {
2644
+ };
2645
+ (function () {
2646
+ this.getCompletions = function (state, session, pos, prefix) {
2647
+ var token = session.getTokenAt(pos.row, pos.column);
2648
+ if (!token)
2649
+ return [];
2650
+ if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
2651
+ return this.getTagCompletions(state, session, pos, prefix);
2652
+ if (is(token, "tag-whitespace") || is(token, "attribute-name"))
2653
+ return this.getAttributeCompletions(state, session, pos, prefix);
2654
+ if (is(token, "attribute-value"))
2655
+ return this.getAttributeValueCompletions(state, session, pos, prefix);
2656
+ var line = session.getLine(pos.row).substr(0, pos.column);
2657
+ if (/&[a-z]*$/i.test(line))
2658
+ return this.getHTMLEntityCompletions(state, session, pos, prefix);
2659
+ return [];
2660
+ };
2661
+ this.getTagCompletions = function (state, session, pos, prefix) {
2662
+ return elements.map(function (element) {
2663
+ return {
2664
+ value: element,
2665
+ meta: "tag",
2666
+ score: 1000000
2667
+ };
2668
+ });
2669
+ };
2670
+ this.getAttributeCompletions = function (state, session, pos, prefix) {
2671
+ var tagName = findTagName(session, pos);
2672
+ if (!tagName)
2673
+ return [];
2674
+ var attributes = globalAttributes;
2675
+ if (tagName in attributeMap) {
2676
+ attributes = attributes.concat(Object.keys(attributeMap[tagName]));
2677
+ }
2678
+ return attributes.map(function (attribute) {
2679
+ return {
2680
+ caption: attribute,
2681
+ snippet: attribute + '="$0"',
2682
+ meta: "attribute",
2683
+ score: 1000000
2684
+ };
2685
+ });
2686
+ };
2687
+ this.getAttributeValueCompletions = function (state, session, pos, prefix) {
2688
+ var tagName = findTagName(session, pos);
2689
+ var attributeName = findAttributeName(session, pos);
2690
+ if (!tagName)
2691
+ return [];
2692
+ var values = [];
2693
+ if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
2694
+ values = Object.keys(attributeMap[tagName][attributeName]);
2695
+ }
2696
+ return values.map(function (value) {
2697
+ return {
2698
+ caption: value,
2699
+ snippet: value,
2700
+ meta: "attribute value",
2701
+ score: 1000000
2702
+ };
2703
+ });
2704
+ };
2705
+ this.getHTMLEntityCompletions = function (state, session, pos, prefix) {
2706
+ var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;'];
2707
+ return values.map(function (value) {
2708
+ return {
2709
+ caption: value,
2710
+ snippet: value,
2711
+ meta: "html entity",
2712
+ score: 1000000
2713
+ };
2714
+ });
2715
+ };
2716
+ }).call(HtmlCompletions.prototype);
2717
+ exports.HtmlCompletions = HtmlCompletions;
2718
+
2719
+ });
2720
+
2721
+ ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module){"use strict";
2722
+ var oop = require("../lib/oop");
2723
+ var lang = require("../lib/lang");
2724
+ var TextMode = require("./text").Mode;
2725
+ var JavaScriptMode = require("./javascript").Mode;
2726
+ var CssMode = require("./css").Mode;
2727
+ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
2728
+ var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
2729
+ var HtmlFoldMode = require("./folding/html").FoldMode;
2730
+ var HtmlCompletions = require("./html_completions").HtmlCompletions;
2731
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
2732
+ var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
2733
+ var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
2734
+ var Mode = function (options) {
2735
+ this.fragmentContext = options && options.fragmentContext;
2736
+ this.HighlightRules = HtmlHighlightRules;
2737
+ this.$behaviour = new XmlBehaviour();
2738
+ this.$completer = new HtmlCompletions();
2739
+ this.createModeDelegates({
2740
+ "js-": JavaScriptMode,
2741
+ "css-": CssMode
2742
+ });
2743
+ this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
2744
+ };
2745
+ oop.inherits(Mode, TextMode);
2746
+ (function () {
2747
+ this.blockComment = { start: "<!--", end: "-->" };
2748
+ this.voidElements = lang.arrayToMap(voidElements);
2749
+ this.getNextLineIndent = function (state, line, tab) {
2750
+ return this.$getIndent(line);
2751
+ };
2752
+ this.checkOutdent = function (state, line, input) {
2753
+ return false;
2754
+ };
2755
+ this.getCompletions = function (state, session, pos, prefix) {
2756
+ return this.$completer.getCompletions(state, session, pos, prefix);
2757
+ };
2758
+ this.createWorker = function (session) {
2759
+ if (this.constructor != Mode)
2760
+ return;
2761
+ var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
2762
+ worker.attachToDocument(session.getDocument());
2763
+ if (this.fragmentContext)
2764
+ worker.call("setOptions", [{ context: this.fragmentContext }]);
2765
+ worker.on("error", function (e) {
2766
+ session.setAnnotations(e.data);
2767
+ });
2768
+ worker.on("terminate", function () {
2769
+ session.clearAnnotations();
2770
+ });
2771
+ return worker;
2772
+ };
2773
+ this.$id = "ace/mode/html";
2774
+ this.snippetFileId = "ace/snippets/html";
2775
+ }).call(Mode.prototype);
2776
+ exports.Mode = Mode;
2777
+
2778
+ });
2779
+
2780
+ ace.define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
2781
+ var oop = require("../lib/oop");
2782
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
2783
+ var reservedKeywords = exports.reservedKeywords = ('!|{|}|case|do|done|elif|else|' +
2784
+ 'esac|fi|for|if|in|then|until|while|' +
2785
+ '&|;|export|local|read|typeset|unset|' +
2786
+ 'elif|select|set|function|declare|readonly');
2787
+ var languageConstructs = exports.languageConstructs = ('[|]|alias|bg|bind|break|builtin|' +
2788
+ 'cd|command|compgen|complete|continue|' +
2789
+ 'dirs|disown|echo|enable|eval|exec|' +
2790
+ 'exit|fc|fg|getopts|hash|help|history|' +
2791
+ 'jobs|kill|let|logout|popd|printf|pushd|' +
2792
+ 'pwd|return|set|shift|shopt|source|' +
2793
+ 'suspend|test|times|trap|type|ulimit|' +
2794
+ 'umask|unalias|wait');
2795
+ var ShHighlightRules = function () {
2796
+ var keywordMapper = this.createKeywordMapper({
2797
+ "keyword": reservedKeywords,
2798
+ "support.function.builtin": languageConstructs,
2799
+ "invalid.deprecated": "debugger"
2800
+ }, "identifier");
2801
+ var integer = "(?:(?:[1-9]\\d*)|(?:0))";
2802
+ var fraction = "(?:\\.\\d+)";
2803
+ var intPart = "(?:\\d+)";
2804
+ var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
2805
+ var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + ")";
2806
+ var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
2807
+ var fileDescriptor = "(?:&" + intPart + ")";
2808
+ var variableName = "[a-zA-Z_][a-zA-Z0-9_]*";
2809
+ var variable = "(?:" + variableName + "(?==))";
2810
+ var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))";
2811
+ var func = "(?:" + variableName + "\\s*\\(\\))";
2812
+ this.$rules = {
2813
+ "start": [{
2814
+ token: "constant",
2815
+ regex: /\\./
2816
+ }, {
2817
+ token: ["text", "comment"],
2818
+ regex: /(^|\s)(#.*)$/
2819
+ }, {
2820
+ token: "string.start",
2821
+ regex: '"',
2822
+ push: [{
2823
+ token: "constant.language.escape",
2824
+ regex: /\\(?:[$`"\\]|$)/
2825
+ }, {
2826
+ include: "variables"
2827
+ }, {
2828
+ token: "keyword.operator",
2829
+ regex: /`/ // TODO highlight `
2830
+ }, {
2831
+ token: "string.end",
2832
+ regex: '"',
2833
+ next: "pop"
2834
+ }, {
2835
+ defaultToken: "string"
2836
+ }]
2837
+ }, {
2838
+ token: "string",
2839
+ regex: "\\$'",
2840
+ push: [{
2841
+ token: "constant.language.escape",
2842
+ regex: /\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/
2843
+ }, {
2844
+ token: "string",
2845
+ regex: "'",
2846
+ next: "pop"
2847
+ }, {
2848
+ defaultToken: "string"
2849
+ }]
2850
+ }, {
2851
+ regex: "<<<",
2852
+ token: "keyword.operator"
2853
+ }, {
2854
+ stateName: "heredoc",
2855
+ regex: "(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)",
2856
+ onMatch: function (value, currentState, stack) {
2857
+ var next = value[2] == '-' ? "indentedHeredoc" : "heredoc";
2858
+ var tokens = value.split(this.splitRegex);
2859
+ stack.push(next, tokens[4]);
2860
+ return [
2861
+ { type: "constant", value: tokens[1] },
2862
+ { type: "text", value: tokens[2] },
2863
+ { type: "string", value: tokens[3] },
2864
+ { type: "support.class", value: tokens[4] },
2865
+ { type: "string", value: tokens[5] }
2866
+ ];
2867
+ },
2868
+ rules: {
2869
+ heredoc: [{
2870
+ onMatch: function (value, currentState, stack) {
2871
+ if (value === stack[1]) {
2872
+ stack.shift();
2873
+ stack.shift();
2874
+ this.next = stack[0] || "start";
2875
+ return "support.class";
2876
+ }
2877
+ this.next = "";
2878
+ return "string";
2879
+ },
2880
+ regex: ".*$",
2881
+ next: "start"
2882
+ }],
2883
+ indentedHeredoc: [{
2884
+ token: "string",
2885
+ regex: "^\t+"
2886
+ }, {
2887
+ onMatch: function (value, currentState, stack) {
2888
+ if (value === stack[1]) {
2889
+ stack.shift();
2890
+ stack.shift();
2891
+ this.next = stack[0] || "start";
2892
+ return "support.class";
2893
+ }
2894
+ this.next = "";
2895
+ return "string";
2896
+ },
2897
+ regex: ".*$",
2898
+ next: "start"
2899
+ }]
2900
+ }
2901
+ }, {
2902
+ regex: "$",
2903
+ token: "empty",
2904
+ next: function (currentState, stack) {
2905
+ if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc")
2906
+ return stack[0];
2907
+ return currentState;
2908
+ }
2909
+ }, {
2910
+ token: ["keyword", "text", "text", "text", "variable"],
2911
+ regex: /(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/
2912
+ }, {
2913
+ token: "variable.language",
2914
+ regex: builtinVariable
2915
+ }, {
2916
+ token: "variable",
2917
+ regex: variable
2918
+ }, {
2919
+ include: "variables"
2920
+ }, {
2921
+ token: "support.function",
2922
+ regex: func
2923
+ }, {
2924
+ token: "support.function",
2925
+ regex: fileDescriptor
2926
+ }, {
2927
+ token: "string", // ' string
2928
+ start: "'", end: "'"
2929
+ }, {
2930
+ token: "constant.numeric", // float
2931
+ regex: floatNumber
2932
+ }, {
2933
+ token: "constant.numeric", // integer
2934
+ regex: integer + "\\b"
2935
+ }, {
2936
+ token: keywordMapper,
2937
+ regex: "[a-zA-Z_][a-zA-Z0-9_]*\\b"
2938
+ }, {
2939
+ token: "keyword.operator",
2940
+ regex: "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]"
2941
+ }, {
2942
+ token: "punctuation.operator",
2943
+ regex: ";"
2944
+ }, {
2945
+ token: "paren.lparen",
2946
+ regex: "[\\[\\(\\{]"
2947
+ }, {
2948
+ token: "paren.rparen",
2949
+ regex: "[\\]]"
2950
+ }, {
2951
+ token: "paren.rparen",
2952
+ regex: "[\\)\\}]",
2953
+ next: "pop"
2954
+ }],
2955
+ variables: [{
2956
+ token: "variable",
2957
+ regex: /(\$)(\w+)/
2958
+ }, {
2959
+ token: ["variable", "paren.lparen"],
2960
+ regex: /(\$)(\()/,
2961
+ push: "start"
2962
+ }, {
2963
+ token: ["variable", "paren.lparen", "keyword.operator", "variable", "keyword.operator"],
2964
+ regex: /(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/,
2965
+ push: "start"
2966
+ }, {
2967
+ token: "variable",
2968
+ regex: /\$[*@#?\-$!0_]/
2969
+ }, {
2970
+ token: ["variable", "paren.lparen"],
2971
+ regex: /(\$)(\{)/,
2972
+ push: "start"
2973
+ }]
2974
+ };
2975
+ this.normalizeRules();
2976
+ };
2977
+ oop.inherits(ShHighlightRules, TextHighlightRules);
2978
+ exports.ShHighlightRules = ShHighlightRules;
2979
+
2980
+ });
2981
+
2982
+ ace.define("ace/mode/sh",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sh_highlight_rules","ace/range","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
2983
+ var oop = require("../lib/oop");
2984
+ var TextMode = require("./text").Mode;
2985
+ var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules;
2986
+ var Range = require("../range").Range;
2987
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
2988
+ var Mode = function () {
2989
+ this.HighlightRules = ShHighlightRules;
2990
+ this.foldingRules = new CStyleFoldMode();
2991
+ this.$behaviour = this.$defaultBehaviour;
2992
+ };
2993
+ oop.inherits(Mode, TextMode);
2994
+ (function () {
2995
+ this.lineCommentStart = "#";
2996
+ this.getNextLineIndent = function (state, line, tab) {
2997
+ var indent = this.$getIndent(line);
2998
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
2999
+ var tokens = tokenizedLine.tokens;
3000
+ if (tokens.length && tokens[tokens.length - 1].type == "comment") {
3001
+ return indent;
3002
+ }
3003
+ if (state == "start") {
3004
+ var match = line.match(/^.*[\{\(\[:]\s*$/);
3005
+ if (match) {
3006
+ indent += tab;
3007
+ }
3008
+ }
3009
+ return indent;
3010
+ };
3011
+ var outdents = {
3012
+ "pass": 1,
3013
+ "return": 1,
3014
+ "raise": 1,
3015
+ "break": 1,
3016
+ "continue": 1
3017
+ };
3018
+ this.checkOutdent = function (state, line, input) {
3019
+ if (input !== "\r\n" && input !== "\r" && input !== "\n")
3020
+ return false;
3021
+ var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
3022
+ if (!tokens)
3023
+ return false;
3024
+ do {
3025
+ var last = tokens.pop();
3026
+ } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
3027
+ if (!last)
3028
+ return false;
3029
+ return (last.type == "keyword" && outdents[last.value]);
3030
+ };
3031
+ this.autoOutdent = function (state, doc, row) {
3032
+ row += 1;
3033
+ var indent = this.$getIndent(doc.getLine(row));
3034
+ var tab = doc.getTabString();
3035
+ if (indent.slice(-tab.length) == tab)
3036
+ doc.remove(new Range(row, indent.length - tab.length, row, indent.length));
3037
+ };
3038
+ this.$id = "ace/mode/sh";
3039
+ this.snippetFileId = "ace/snippets/sh";
3040
+ }).call(Mode.prototype);
3041
+ exports.Mode = Mode;
3042
+
3043
+ });
3044
+
3045
+ ace.define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml","ace/worker/worker_client"], function(require, exports, module){"use strict";
3046
+ var oop = require("../lib/oop");
3047
+ var lang = require("../lib/lang");
3048
+ var TextMode = require("./text").Mode;
3049
+ var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
3050
+ var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
3051
+ var XmlFoldMode = require("./folding/xml").FoldMode;
3052
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
3053
+ var Mode = function () {
3054
+ this.HighlightRules = XmlHighlightRules;
3055
+ this.$behaviour = new XmlBehaviour();
3056
+ this.foldingRules = new XmlFoldMode();
3057
+ };
3058
+ oop.inherits(Mode, TextMode);
3059
+ (function () {
3060
+ this.voidElements = lang.arrayToMap([]);
3061
+ this.blockComment = { start: "<!--", end: "-->" };
3062
+ this.createWorker = function (session) {
3063
+ var worker = new WorkerClient(["ace"], "ace/mode/xml_worker", "Worker");
3064
+ worker.attachToDocument(session.getDocument());
3065
+ worker.on("error", function (e) {
3066
+ session.setAnnotations(e.data);
3067
+ });
3068
+ worker.on("terminate", function () {
3069
+ session.clearAnnotations();
3070
+ });
3071
+ return worker;
3072
+ };
3073
+ this.$id = "ace/mode/xml";
3074
+ }).call(Mode.prototype);
3075
+ exports.Mode = Mode;
3076
+
3077
+ });
3078
+
3079
+ ace.define("ace/mode/markdown",["require","exports","module","ace/lib/oop","ace/mode/behaviour/cstyle","ace/mode/text","ace/mode/markdown_highlight_rules","ace/mode/folding/markdown","ace/mode/javascript","ace/mode/html","ace/mode/sh","ace/mode/sh","ace/mode/xml","ace/mode/css"], function(require, exports, module){"use strict";
3080
+ var oop = require("../lib/oop");
3081
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
3082
+ var TextMode = require("./text").Mode;
3083
+ var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules;
3084
+ var MarkdownFoldMode = require("./folding/markdown").FoldMode;
3085
+ var Mode = function () {
3086
+ this.HighlightRules = MarkdownHighlightRules;
3087
+ this.createModeDelegates({
3088
+ javascript: require("./javascript").Mode,
3089
+ html: require("./html").Mode,
3090
+ bash: require("./sh").Mode,
3091
+ sh: require("./sh").Mode,
3092
+ xml: require("./xml").Mode,
3093
+ css: require("./css").Mode
3094
+ });
3095
+ this.foldingRules = new MarkdownFoldMode();
3096
+ this.$behaviour = new CstyleBehaviour({ braces: true });
3097
+ };
3098
+ oop.inherits(Mode, TextMode);
3099
+ (function () {
3100
+ this.type = "text";
3101
+ this.blockComment = { start: "<!--", end: "-->" };
3102
+ this.$quotes = { '"': '"', "`": "`" };
3103
+ this.getNextLineIndent = function (state, line, tab) {
3104
+ if (state == "listblock") {
3105
+ var match = /^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(line);
3106
+ if (!match)
3107
+ return "";
3108
+ var marker = match[2];
3109
+ if (!marker)
3110
+ marker = parseInt(match[3], 10) + 1 + ".";
3111
+ return match[1] + marker + match[4];
3112
+ }
3113
+ else {
3114
+ return this.$getIndent(line);
3115
+ }
3116
+ };
3117
+ this.$id = "ace/mode/markdown";
3118
+ this.snippetFileId = "ace/snippets/markdown";
3119
+ }).call(Mode.prototype);
3120
+ exports.Mode = Mode;
3121
+
3122
+ });
3123
+
3124
+ ace.define("ace/mode/coffee_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
3125
+ var oop = require("../lib/oop");
3126
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
3127
+ oop.inherits(CoffeeHighlightRules, TextHighlightRules);
3128
+ function CoffeeHighlightRules() {
3129
+ var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*";
3130
+ var keywords = ("this|throw|then|try|typeof|super|switch|return|break|by|continue|" +
3131
+ "catch|class|in|instanceof|is|isnt|if|else|extends|for|own|" +
3132
+ "finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" +
3133
+ "or|on|unless|until|and|yes|yield|export|import|default");
3134
+ var langConstant = ("true|false|null|undefined|NaN|Infinity");
3135
+ var illegal = ("case|const|function|var|void|with|enum|implements|" +
3136
+ "interface|let|package|private|protected|public|static");
3137
+ var supportClass = ("Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|String|" +
3138
+ "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
3139
+ "SyntaxError|TypeError|URIError|" +
3140
+ "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
3141
+ "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray");
3142
+ var supportFunction = ("Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" +
3143
+ "encodeURIComponent|decodeURI|decodeURIComponent|String|");
3144
+ var variableLanguage = ("window|arguments|prototype|document");
3145
+ var keywordMapper = this.createKeywordMapper({
3146
+ "keyword": keywords,
3147
+ "constant.language": langConstant,
3148
+ "invalid.illegal": illegal,
3149
+ "language.support.class": supportClass,
3150
+ "language.support.function": supportFunction,
3151
+ "variable.language": variableLanguage
3152
+ }, "identifier");
3153
+ var functionRule = {
3154
+ token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"],
3155
+ regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()"'\/])*?)(\))(\s*))?([\-=]>)/.source
3156
+ };
3157
+ var stringEscape = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/;
3158
+ this.$rules = {
3159
+ start: [
3160
+ {
3161
+ token: "constant.numeric",
3162
+ regex: "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)"
3163
+ }, {
3164
+ stateName: "qdoc",
3165
+ token: "string", regex: "'''", next: [
3166
+ { token: "string", regex: "'''", next: "start" },
3167
+ { token: "constant.language.escape", regex: stringEscape },
3168
+ { defaultToken: "string" }
3169
+ ]
3170
+ }, {
3171
+ stateName: "qqdoc",
3172
+ token: "string",
3173
+ regex: '"""',
3174
+ next: [
3175
+ { token: "string", regex: '"""', next: "start" },
3176
+ { token: "paren.string", regex: '#{', push: "start" },
3177
+ { token: "constant.language.escape", regex: stringEscape },
3178
+ { defaultToken: "string" }
3179
+ ]
3180
+ }, {
3181
+ stateName: "qstring",
3182
+ token: "string", regex: "'", next: [
3183
+ { token: "string", regex: "'", next: "start" },
3184
+ { token: "constant.language.escape", regex: stringEscape },
3185
+ { defaultToken: "string" }
3186
+ ]
3187
+ }, {
3188
+ stateName: "qqstring",
3189
+ token: "string.start", regex: '"', next: [
3190
+ { token: "string.end", regex: '"', next: "start" },
3191
+ { token: "paren.string", regex: '#{', push: "start" },
3192
+ { token: "constant.language.escape", regex: stringEscape },
3193
+ { defaultToken: "string" }
3194
+ ]
3195
+ }, {
3196
+ stateName: "js",
3197
+ token: "string", regex: "`", next: [
3198
+ { token: "string", regex: "`", next: "start" },
3199
+ { token: "constant.language.escape", regex: stringEscape },
3200
+ { defaultToken: "string" }
3201
+ ]
3202
+ }, {
3203
+ regex: "[{}]", onMatch: function (val, state, stack) {
3204
+ this.next = "";
3205
+ if (val == "{" && stack.length) {
3206
+ stack.unshift("start", state);
3207
+ return "paren";
3208
+ }
3209
+ if (val == "}" && stack.length) {
3210
+ stack.shift();
3211
+ this.next = stack.shift() || "";
3212
+ if (this.next.indexOf("string") != -1)
3213
+ return "paren.string";
3214
+ }
3215
+ return "paren";
3216
+ }
3217
+ }, {
3218
+ token: "string.regex",
3219
+ regex: "///",
3220
+ next: "heregex"
3221
+ }, {
3222
+ token: "string.regex",
3223
+ regex: /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/
3224
+ }, {
3225
+ token: "comment",
3226
+ regex: "###(?!#)",
3227
+ next: "comment"
3228
+ }, {
3229
+ token: "comment",
3230
+ regex: "#.*"
3231
+ }, {
3232
+ token: ["punctuation.operator", "text", "identifier"],
3233
+ regex: "(\\.)(\\s*)(" + illegal + ")"
3234
+ }, {
3235
+ token: "punctuation.operator",
3236
+ regex: "\\.{1,3}"
3237
+ }, {
3238
+ token: ["keyword", "text", "language.support.class",
3239
+ "text", "keyword", "text", "language.support.class"],
3240
+ regex: "(class)(\\s+)(" + identifier + ")(?:(\\s+)(extends)(\\s+)(" + identifier + "))?"
3241
+ }, {
3242
+ token: ["entity.name.function", "text", "keyword.operator", "text"].concat(functionRule.token),
3243
+ regex: "(" + identifier + ")(\\s*)([=:])(\\s*)" + functionRule.regex
3244
+ },
3245
+ functionRule,
3246
+ {
3247
+ token: "variable",
3248
+ regex: "@(?:" + identifier + ")?"
3249
+ }, {
3250
+ token: keywordMapper,
3251
+ regex: identifier
3252
+ }, {
3253
+ token: "punctuation.operator",
3254
+ regex: "\\,|\\."
3255
+ }, {
3256
+ token: "storage.type",
3257
+ regex: "[\\-=]>"
3258
+ }, {
3259
+ token: "keyword.operator",
3260
+ regex: "(?:[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])"
3261
+ }, {
3262
+ token: "paren.lparen",
3263
+ regex: "[({[]"
3264
+ }, {
3265
+ token: "paren.rparen",
3266
+ regex: "[\\]})]"
3267
+ }, {
3268
+ token: "text",
3269
+ regex: "\\s+"
3270
+ }
3271
+ ],
3272
+ heregex: [{
3273
+ token: "string.regex",
3274
+ regex: '.*?///[imgy]{0,4}',
3275
+ next: "start"
3276
+ }, {
3277
+ token: "comment.regex",
3278
+ regex: "\\s+(?:#.*)?"
3279
+ }, {
3280
+ token: "string.regex",
3281
+ regex: "\\S+"
3282
+ }],
3283
+ comment: [{
3284
+ token: "comment",
3285
+ regex: '###',
3286
+ next: "start"
3287
+ }, {
3288
+ defaultToken: "comment"
3289
+ }]
3290
+ };
3291
+ this.normalizeRules();
3292
+ }
3293
+ exports.CoffeeHighlightRules = CoffeeHighlightRules;
3294
+
3295
+ });
3296
+
3297
+ ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
3298
+ var oop = require("../../lib/oop");
3299
+ var BaseFoldMode = require("./fold_mode").FoldMode;
3300
+ var Range = require("../../range").Range;
3301
+ var FoldMode = exports.FoldMode = function () { };
3302
+ oop.inherits(FoldMode, BaseFoldMode);
3303
+ (function () {
3304
+ this.commentBlock = function (session, row) {
3305
+ var re = /\S/;
3306
+ var line = session.getLine(row);
3307
+ var startLevel = line.search(re);
3308
+ if (startLevel == -1 || line[startLevel] != "#")
3309
+ return;
3310
+ var startColumn = line.length;
3311
+ var maxRow = session.getLength();
3312
+ var startRow = row;
3313
+ var endRow = row;
3314
+ while (++row < maxRow) {
3315
+ line = session.getLine(row);
3316
+ var level = line.search(re);
3317
+ if (level == -1)
3318
+ continue;
3319
+ if (line[level] != "#")
3320
+ break;
3321
+ endRow = row;
3322
+ }
3323
+ if (endRow > startRow) {
3324
+ var endColumn = session.getLine(endRow).length;
3325
+ return new Range(startRow, startColumn, endRow, endColumn);
3326
+ }
3327
+ };
3328
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
3329
+ var range = this.indentationBlock(session, row);
3330
+ if (range)
3331
+ return range;
3332
+ range = this.commentBlock(session, row);
3333
+ if (range)
3334
+ return range;
3335
+ };
3336
+ this.getFoldWidget = function (session, foldStyle, row) {
3337
+ var line = session.getLine(row);
3338
+ var indent = line.search(/\S/);
3339
+ var next = session.getLine(row + 1);
3340
+ var prev = session.getLine(row - 1);
3341
+ var prevIndent = prev.search(/\S/);
3342
+ var nextIndent = next.search(/\S/);
3343
+ if (indent == -1) {
3344
+ session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
3345
+ return "";
3346
+ }
3347
+ if (prevIndent == -1) {
3348
+ if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
3349
+ session.foldWidgets[row - 1] = "";
3350
+ session.foldWidgets[row + 1] = "";
3351
+ return "start";
3352
+ }
3353
+ }
3354
+ else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
3355
+ if (session.getLine(row - 2).search(/\S/) == -1) {
3356
+ session.foldWidgets[row - 1] = "start";
3357
+ session.foldWidgets[row + 1] = "";
3358
+ return "";
3359
+ }
3360
+ }
3361
+ if (prevIndent != -1 && prevIndent < indent)
3362
+ session.foldWidgets[row - 1] = "start";
3363
+ else
3364
+ session.foldWidgets[row - 1] = "";
3365
+ if (indent < nextIndent)
3366
+ return "start";
3367
+ else
3368
+ return "";
3369
+ };
3370
+ }).call(FoldMode.prototype);
3371
+
3372
+ });
3373
+
3374
+ ace.define("ace/mode/coffee",["require","exports","module","ace/mode/coffee_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/coffee","ace/range","ace/mode/text","ace/worker/worker_client","ace/lib/oop"], function(require, exports, module){"use strict";
3375
+ var Rules = require("./coffee_highlight_rules").CoffeeHighlightRules;
3376
+ var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent;
3377
+ var FoldMode = require("./folding/coffee").FoldMode;
3378
+ var Range = require("../range").Range;
3379
+ var TextMode = require("./text").Mode;
3380
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
3381
+ var oop = require("../lib/oop");
3382
+ function Mode() {
3383
+ this.HighlightRules = Rules;
3384
+ this.$outdent = new Outdent();
3385
+ this.foldingRules = new FoldMode();
3386
+ }
3387
+ oop.inherits(Mode, TextMode);
3388
+ (function () {
3389
+ var indenter = /(?:[({[=:]|[-=]>|\b(?:else|try|(?:swi|ca)tch(?:\s+[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$|^\s*(else\b\s*)?(?:if|for|while|loop)\b(?!.*\bthen\b)/;
3390
+ this.lineCommentStart = "#";
3391
+ this.blockComment = { start: "###", end: "###" };
3392
+ this.getNextLineIndent = function (state, line, tab) {
3393
+ var indent = this.$getIndent(line);
3394
+ var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
3395
+ if (!(tokens.length && tokens[tokens.length - 1].type === 'comment') &&
3396
+ state === 'start' && indenter.test(line))
3397
+ indent += tab;
3398
+ return indent;
3399
+ };
3400
+ this.checkOutdent = function (state, line, input) {
3401
+ return this.$outdent.checkOutdent(line, input);
3402
+ };
3403
+ this.autoOutdent = function (state, doc, row) {
3404
+ this.$outdent.autoOutdent(doc, row);
3405
+ };
3406
+ this.createWorker = function (session) {
3407
+ var worker = new WorkerClient(["ace"], "ace/mode/coffee_worker", "Worker");
3408
+ worker.attachToDocument(session.getDocument());
3409
+ worker.on("annotate", function (e) {
3410
+ session.setAnnotations(e.data);
3411
+ });
3412
+ worker.on("terminate", function () {
3413
+ session.clearAnnotations();
3414
+ });
3415
+ return worker;
3416
+ };
3417
+ this.$id = "ace/mode/coffee";
3418
+ this.snippetFileId = "ace/snippets/coffee";
3419
+ }).call(Mode.prototype);
3420
+ exports.Mode = Mode;
3421
+
3422
+ });
3423
+
3424
+ ace.define("ace/mode/scss_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/css_highlight_rules"], function(require, exports, module){"use strict";
3425
+ var oop = require("../lib/oop");
3426
+ var lang = require("../lib/lang");
3427
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
3428
+ var CssHighlightRules = require("./css_highlight_rules");
3429
+ var ScssHighlightRules = function () {
3430
+ var properties = lang.arrayToMap(CssHighlightRules.supportType.split("|"));
3431
+ var functions = lang.arrayToMap(("hsl|hsla|rgb|rgba|url|attr|counter|counters|abs|adjust_color|adjust_hue|" +
3432
+ "alpha|join|blue|ceil|change_color|comparable|complement|darken|desaturate|" +
3433
+ "floor|grayscale|green|hue|if|invert|join|length|lighten|lightness|mix|" +
3434
+ "nth|opacify|opacity|percentage|quote|red|round|saturate|saturation|" +
3435
+ "scale_color|transparentize|type_of|unit|unitless|unquote").split("|"));
3436
+ var constants = lang.arrayToMap(CssHighlightRules.supportConstant.split("|"));
3437
+ var colors = lang.arrayToMap(CssHighlightRules.supportConstantColor.split("|"));
3438
+ var keywords = lang.arrayToMap(("@mixin|@extend|@include|@import|@media|@debug|@warn|@if|@for|@each|@while|@else|@font-face|@-webkit-keyframes|if|and|!default|module|def|end|declare").split("|"));
3439
+ var tags = lang.arrayToMap(("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|" +
3440
+ "big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|" +
3441
+ "command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|" +
3442
+ "figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|" +
3443
+ "header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|" +
3444
+ "link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|" +
3445
+ "option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|" +
3446
+ "small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|" +
3447
+ "textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp").split("|"));
3448
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
3449
+ this.$rules = {
3450
+ "start": [
3451
+ {
3452
+ token: "comment",
3453
+ regex: "\\/\\/.*$"
3454
+ },
3455
+ {
3456
+ token: "comment", // multi line comment
3457
+ regex: "\\/\\*",
3458
+ next: "comment"
3459
+ }, {
3460
+ token: "string", // single line
3461
+ regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
3462
+ }, {
3463
+ token: "string", // multi line string start
3464
+ regex: '["].*\\\\$',
3465
+ next: "qqstring"
3466
+ }, {
3467
+ token: "string", // single line
3468
+ regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
3469
+ }, {
3470
+ token: "string", // multi line string start
3471
+ regex: "['].*\\\\$",
3472
+ next: "qstring"
3473
+ }, {
3474
+ token: "constant.numeric",
3475
+ regex: numRe + "(?:ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"
3476
+ }, {
3477
+ token: "constant.numeric", // hex6 color
3478
+ regex: "#[a-f0-9]{6}"
3479
+ }, {
3480
+ token: "constant.numeric", // hex3 color
3481
+ regex: "#[a-f0-9]{3}"
3482
+ }, {
3483
+ token: "constant.numeric",
3484
+ regex: numRe
3485
+ }, {
3486
+ token: ["support.function", "string", "support.function"],
3487
+ regex: "(url\\()(.*)(\\))"
3488
+ }, {
3489
+ token: function (value) {
3490
+ if (properties.hasOwnProperty(value.toLowerCase()))
3491
+ return "support.type";
3492
+ if (keywords.hasOwnProperty(value))
3493
+ return "keyword";
3494
+ else if (constants.hasOwnProperty(value))
3495
+ return "constant.language";
3496
+ else if (functions.hasOwnProperty(value))
3497
+ return "support.function";
3498
+ else if (colors.hasOwnProperty(value.toLowerCase()))
3499
+ return "support.constant.color";
3500
+ else if (tags.hasOwnProperty(value.toLowerCase()))
3501
+ return "variable.language";
3502
+ else
3503
+ return "text";
3504
+ },
3505
+ regex: "\\-?[@a-z_][@a-z0-9_\\-]*"
3506
+ }, {
3507
+ token: "variable",
3508
+ regex: "[a-z_\\-$][a-z0-9_\\-$]*\\b"
3509
+ }, {
3510
+ token: "variable.language",
3511
+ regex: "#[a-z0-9-_]+"
3512
+ }, {
3513
+ token: "variable.language",
3514
+ regex: "\\.[a-z0-9-_]+"
3515
+ }, {
3516
+ token: "variable.language",
3517
+ regex: ":[a-z0-9-_]+"
3518
+ }, {
3519
+ token: "constant",
3520
+ regex: "[a-z0-9-_]+"
3521
+ }, {
3522
+ token: "keyword.operator",
3523
+ regex: "<|>|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*"
3524
+ }, {
3525
+ token: "paren.lparen",
3526
+ regex: "[[({]"
3527
+ }, {
3528
+ token: "paren.rparen",
3529
+ regex: "[\\])}]"
3530
+ }, {
3531
+ token: "text",
3532
+ regex: "\\s+"
3533
+ }, {
3534
+ caseInsensitive: true
3535
+ }
3536
+ ],
3537
+ "comment": [
3538
+ {
3539
+ token: "comment", // closing comment
3540
+ regex: "\\*\\/",
3541
+ next: "start"
3542
+ }, {
3543
+ defaultToken: "comment"
3544
+ }
3545
+ ],
3546
+ "qqstring": [
3547
+ {
3548
+ token: "string",
3549
+ regex: '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
3550
+ next: "start"
3551
+ }, {
3552
+ token: "string",
3553
+ regex: '.+'
3554
+ }
3555
+ ],
3556
+ "qstring": [
3557
+ {
3558
+ token: "string",
3559
+ regex: "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
3560
+ next: "start"
3561
+ }, {
3562
+ token: "string",
3563
+ regex: '.+'
3564
+ }
3565
+ ]
3566
+ };
3567
+ };
3568
+ oop.inherits(ScssHighlightRules, TextHighlightRules);
3569
+ exports.ScssHighlightRules = ScssHighlightRules;
3570
+
3571
+ });
3572
+
3573
+ ace.define("ace/mode/scss",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/scss_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/css","ace/mode/folding/cstyle","ace/mode/css_completions"], function(require, exports, module){"use strict";
3574
+ var oop = require("../lib/oop");
3575
+ var TextMode = require("./text").Mode;
3576
+ var ScssHighlightRules = require("./scss_highlight_rules").ScssHighlightRules;
3577
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
3578
+ var CssBehaviour = require("./behaviour/css").CssBehaviour;
3579
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
3580
+ var CssCompletions = require("./css_completions").CssCompletions;
3581
+ var Mode = function () {
3582
+ this.HighlightRules = ScssHighlightRules;
3583
+ this.$outdent = new MatchingBraceOutdent();
3584
+ this.$behaviour = new CssBehaviour();
3585
+ this.$completer = new CssCompletions();
3586
+ this.foldingRules = new CStyleFoldMode();
3587
+ };
3588
+ oop.inherits(Mode, TextMode);
3589
+ (function () {
3590
+ this.lineCommentStart = "//";
3591
+ this.blockComment = { start: "/*", end: "*/" };
3592
+ this.getNextLineIndent = function (state, line, tab) {
3593
+ var indent = this.$getIndent(line);
3594
+ var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
3595
+ if (tokens.length && tokens[tokens.length - 1].type == "comment") {
3596
+ return indent;
3597
+ }
3598
+ var match = line.match(/^.*\{\s*$/);
3599
+ if (match) {
3600
+ indent += tab;
3601
+ }
3602
+ return indent;
3603
+ };
3604
+ this.checkOutdent = function (state, line, input) {
3605
+ return this.$outdent.checkOutdent(line, input);
3606
+ };
3607
+ this.autoOutdent = function (state, doc, row) {
3608
+ this.$outdent.autoOutdent(doc, row);
3609
+ };
3610
+ this.getCompletions = function (state, session, pos, prefix) {
3611
+ return this.$completer.getCompletions(state, session, pos, prefix);
3612
+ };
3613
+ this.$id = "ace/mode/scss";
3614
+ }).call(Mode.prototype);
3615
+ exports.Mode = Mode;
3616
+
3617
+ });
3618
+
3619
+ ace.define("ace/mode/sass_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/scss_highlight_rules"], function(require, exports, module){"use strict";
3620
+ var oop = require("../lib/oop");
3621
+ var lang = require("../lib/lang");
3622
+ var ScssHighlightRules = require("./scss_highlight_rules").ScssHighlightRules;
3623
+ var SassHighlightRules = function () {
3624
+ ScssHighlightRules.call(this);
3625
+ var start = this.$rules.start;
3626
+ if (start[1].token == "comment") {
3627
+ start.splice(1, 1, {
3628
+ onMatch: function (value, currentState, stack) {
3629
+ stack.unshift(this.next, -1, value.length - 2, currentState);
3630
+ return "comment";
3631
+ },
3632
+ regex: /^\s*\/\*/,
3633
+ next: "comment"
3634
+ }, {
3635
+ token: "error.invalid",
3636
+ regex: "/\\*|[{;}]"
3637
+ }, {
3638
+ token: "support.type",
3639
+ regex: /^\s*:[\w\-]+\s/
3640
+ });
3641
+ this.$rules.comment = [
3642
+ { regex: /^\s*/, onMatch: function (value, currentState, stack) {
3643
+ if (stack[1] === -1)
3644
+ stack[1] = Math.max(stack[2], value.length - 1);
3645
+ if (value.length <= stack[1]) { stack.shift();
3646
+ stack.shift();
3647
+ stack.shift();
3648
+ this.next = stack.shift();
3649
+ return "text";
3650
+ }
3651
+ else {
3652
+ this.next = "";
3653
+ return "comment";
3654
+ }
3655
+ }, next: "start" },
3656
+ { defaultToken: "comment" }
3657
+ ];
3658
+ }
3659
+ };
3660
+ oop.inherits(SassHighlightRules, ScssHighlightRules);
3661
+ exports.SassHighlightRules = SassHighlightRules;
3662
+
3663
+ });
3664
+
3665
+ ace.define("ace/mode/sass",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sass_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module){"use strict";
3666
+ var oop = require("../lib/oop");
3667
+ var TextMode = require("./text").Mode;
3668
+ var SassHighlightRules = require("./sass_highlight_rules").SassHighlightRules;
3669
+ var FoldMode = require("./folding/coffee").FoldMode;
3670
+ var Mode = function () {
3671
+ this.HighlightRules = SassHighlightRules;
3672
+ this.foldingRules = new FoldMode();
3673
+ this.$behaviour = this.$defaultBehaviour;
3674
+ };
3675
+ oop.inherits(Mode, TextMode);
3676
+ (function () {
3677
+ this.lineCommentStart = "//";
3678
+ this.$id = "ace/mode/sass";
3679
+ }).call(Mode.prototype);
3680
+ exports.Mode = Mode;
3681
+
3682
+ });
3683
+
3684
+ ace.define("ace/mode/less_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/css_highlight_rules"], function(require, exports, module){"use strict";
3685
+ var oop = require("../lib/oop");
3686
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
3687
+ var CssHighlightRules = require('./css_highlight_rules');
3688
+ var LessHighlightRules = function () {
3689
+ var keywordList = "@import|@media|@font-face|@keyframes|@-webkit-keyframes|@supports|" +
3690
+ "@charset|@plugin|@namespace|@document|@page|@viewport|@-ms-viewport|" +
3691
+ "or|and|when|not";
3692
+ var keywords = keywordList.split('|');
3693
+ var properties = CssHighlightRules.supportType.split('|');
3694
+ var keywordMapper = this.createKeywordMapper({
3695
+ "support.constant": CssHighlightRules.supportConstant,
3696
+ "keyword": keywordList,
3697
+ "support.constant.color": CssHighlightRules.supportConstantColor,
3698
+ "support.constant.fonts": CssHighlightRules.supportConstantFonts
3699
+ }, "identifier", true);
3700
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
3701
+ this.$rules = {
3702
+ "start": [
3703
+ {
3704
+ token: "comment",
3705
+ regex: "\\/\\/.*$"
3706
+ },
3707
+ {
3708
+ token: "comment", // multi line comment
3709
+ regex: "\\/\\*",
3710
+ next: "comment"
3711
+ }, {
3712
+ token: "string", // single line
3713
+ regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
3714
+ }, {
3715
+ token: "string", // single line
3716
+ regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
3717
+ }, {
3718
+ token: ["constant.numeric", "keyword"],
3719
+ regex: "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
3720
+ }, {
3721
+ token: "constant.numeric", // hex6 color
3722
+ regex: "#[a-f0-9]{6}"
3723
+ }, {
3724
+ token: "constant.numeric", // hex3 color
3725
+ regex: "#[a-f0-9]{3}"
3726
+ }, {
3727
+ token: "constant.numeric",
3728
+ regex: numRe
3729
+ }, {
3730
+ token: ["support.function", "paren.lparen", "string", "paren.rparen"],
3731
+ regex: "(url)(\\()(.*)(\\))"
3732
+ }, {
3733
+ token: ["support.function", "paren.lparen"],
3734
+ regex: "(:extend|[a-z0-9_\\-]+)(\\()"
3735
+ }, {
3736
+ token: function (value) {
3737
+ if (keywords.indexOf(value.toLowerCase()) > -1)
3738
+ return "keyword";
3739
+ else
3740
+ return "variable";
3741
+ },
3742
+ regex: "[@\\$][a-z0-9_\\-@\\$]*\\b"
3743
+ }, {
3744
+ token: "variable",
3745
+ regex: "[@\\$]\\{[a-z0-9_\\-@\\$]*\\}"
3746
+ }, {
3747
+ token: function (first, second) {
3748
+ if (properties.indexOf(first.toLowerCase()) > -1) {
3749
+ return ["support.type.property", "text"];
3750
+ }
3751
+ else {
3752
+ return ["support.type.unknownProperty", "text"];
3753
+ }
3754
+ },
3755
+ regex: "([a-z0-9-_]+)(\\s*:)"
3756
+ }, {
3757
+ token: "keyword",
3758
+ regex: "&" // special case - always treat as keyword
3759
+ }, {
3760
+ token: keywordMapper,
3761
+ regex: "\\-?[@a-z_][@a-z0-9_\\-]*"
3762
+ }, {
3763
+ token: "variable.language",
3764
+ regex: "#[a-z0-9-_]+"
3765
+ }, {
3766
+ token: "variable.language",
3767
+ regex: "\\.[a-z0-9-_]+"
3768
+ }, {
3769
+ token: "variable.language",
3770
+ regex: ":[a-z_][a-z0-9-_]*"
3771
+ }, {
3772
+ token: "constant",
3773
+ regex: "[a-z0-9-_]+"
3774
+ }, {
3775
+ token: "keyword.operator",
3776
+ regex: "<|>|<=|>=|=|!=|-|%|\\+|\\*"
3777
+ }, {
3778
+ token: "paren.lparen",
3779
+ regex: "[[({]"
3780
+ }, {
3781
+ token: "paren.rparen",
3782
+ regex: "[\\])}]"
3783
+ }, {
3784
+ token: "text",
3785
+ regex: "\\s+"
3786
+ }, {
3787
+ caseInsensitive: true
3788
+ }
3789
+ ],
3790
+ "comment": [
3791
+ {
3792
+ token: "comment", // closing comment
3793
+ regex: "\\*\\/",
3794
+ next: "start"
3795
+ }, {
3796
+ defaultToken: "comment"
3797
+ }
3798
+ ]
3799
+ };
3800
+ this.normalizeRules();
3801
+ };
3802
+ oop.inherits(LessHighlightRules, TextHighlightRules);
3803
+ exports.LessHighlightRules = LessHighlightRules;
3804
+
3805
+ });
3806
+
3807
+ ace.define("ace/mode/less",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/less_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/css","ace/mode/css_completions","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
3808
+ var oop = require("../lib/oop");
3809
+ var TextMode = require("./text").Mode;
3810
+ var LessHighlightRules = require("./less_highlight_rules").LessHighlightRules;
3811
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
3812
+ var CssBehaviour = require("./behaviour/css").CssBehaviour;
3813
+ var CssCompletions = require("./css_completions").CssCompletions;
3814
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
3815
+ var Mode = function () {
3816
+ this.HighlightRules = LessHighlightRules;
3817
+ this.$outdent = new MatchingBraceOutdent();
3818
+ this.$behaviour = new CssBehaviour();
3819
+ this.$completer = new CssCompletions();
3820
+ this.foldingRules = new CStyleFoldMode();
3821
+ };
3822
+ oop.inherits(Mode, TextMode);
3823
+ (function () {
3824
+ this.lineCommentStart = "//";
3825
+ this.blockComment = { start: "/*", end: "*/" };
3826
+ this.getNextLineIndent = function (state, line, tab) {
3827
+ var indent = this.$getIndent(line);
3828
+ var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
3829
+ if (tokens.length && tokens[tokens.length - 1].type == "comment") {
3830
+ return indent;
3831
+ }
3832
+ var match = line.match(/^.*\{\s*$/);
3833
+ if (match) {
3834
+ indent += tab;
3835
+ }
3836
+ return indent;
3837
+ };
3838
+ this.checkOutdent = function (state, line, input) {
3839
+ return this.$outdent.checkOutdent(line, input);
3840
+ };
3841
+ this.autoOutdent = function (state, doc, row) {
3842
+ this.$outdent.autoOutdent(doc, row);
3843
+ };
3844
+ this.getCompletions = function (state, session, pos, prefix) {
3845
+ return this.$completer.getCompletions("ruleset", session, pos, prefix);
3846
+ };
3847
+ this.$id = "ace/mode/less";
3848
+ }).call(Mode.prototype);
3849
+ exports.Mode = Mode;
3850
+
3851
+ });
3852
+
3853
+ ace.define("ace/mode/ruby_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
3854
+ var oop = require("../lib/oop");
3855
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
3856
+ var constantOtherSymbol = exports.constantOtherSymbol = {
3857
+ token: "constant.other.symbol.ruby", // symbol
3858
+ regex: "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?"
3859
+ };
3860
+ exports.qString = {
3861
+ token: "string", // single line
3862
+ regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
3863
+ };
3864
+ exports.qqString = {
3865
+ token: "string", // single line
3866
+ regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
3867
+ };
3868
+ exports.tString = {
3869
+ token: "string", // backtick string
3870
+ regex: "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]"
3871
+ };
3872
+ var constantNumericHex = exports.constantNumericHex = {
3873
+ token: "constant.numeric", // hex
3874
+ regex: "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b"
3875
+ };
3876
+ var constantNumericBinary = exports.constantNumericBinary = {
3877
+ token: "constant.numeric",
3878
+ regex: /\b(0[bB][01](?:[01]|_(?=[01]))*)\b/
3879
+ };
3880
+ var constantNumericDecimal = exports.constantNumericDecimal = {
3881
+ token: "constant.numeric",
3882
+ regex: /\b(0[dD](?:[1-9](?:[\d]|_(?=[\d]))*|0))\b/
3883
+ };
3884
+ var constantNumericOctal = exports.constantNumericOctal = {
3885
+ token: "constant.numeric",
3886
+ regex: /\b(0[oO]?(?:[1-7](?:[0-7]|_(?=[0-7]))*|0))\b/
3887
+ };
3888
+ var constantNumericRational = exports.constantNumericRational = {
3889
+ token: "constant.numeric", //rational + complex
3890
+ regex: /\b([\d]+(?:[./][\d]+)?ri?)\b/
3891
+ };
3892
+ var constantNumericComplex = exports.constantNumericComplex = {
3893
+ token: "constant.numeric", //simple complex numbers
3894
+ regex: /\b([\d]i)\b/
3895
+ };
3896
+ var constantNumericFloat = exports.constantNumericFloat = {
3897
+ token: "constant.numeric", // float + complex
3898
+ regex: "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?i?\\b"
3899
+ };
3900
+ var instanceVariable = exports.instanceVariable = {
3901
+ token: "variable.instance", // instance variable
3902
+ regex: "@{1,2}[a-zA-Z_\\d]+"
3903
+ };
3904
+ var RubyHighlightRules = function () {
3905
+ var builtinFunctions = ("abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" +
3906
+ "assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" +
3907
+ "assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|" +
3908
+ "assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|" +
3909
+ "assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|" +
3910
+ "assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|" +
3911
+ "attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|" +
3912
+ "caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|" +
3913
+ "exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|" +
3914
+ "gsub!|get_via_redirect|host!|https?|https!|include|Integer|lambda|link_to|" +
3915
+ "link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|" +
3916
+ "p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|" +
3917
+ "raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|" +
3918
+ "set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|" +
3919
+ "throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|" +
3920
+ "render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|" +
3921
+ "content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|" +
3922
+ "fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|" +
3923
+ "time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|" +
3924
+ "select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|" +
3925
+ "file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|" +
3926
+ "protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|" +
3927
+ "send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|" +
3928
+ "validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|" +
3929
+ "validates_inclusion_of|validates_numericality_of|validates_with|validates_each|" +
3930
+ "authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|" +
3931
+ "filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" +
3932
+ "translate|localize|extract_locale_from_tld|caches_page|expire_page|caches_action|expire_action|" +
3933
+ "cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" +
3934
+ "has_many|has_one|belongs_to|has_and_belongs_to_many|p|warn|refine|using|module_function|extend|alias_method|" +
3935
+ "private_class_method|remove_method|undef_method");
3936
+ var keywords = ("alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" +
3937
+ "__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" +
3938
+ "redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield|__ENCODING__|prepend");
3939
+ var buildinConstants = ("true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" +
3940
+ "RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING|RUBY_PATCHLEVEL|RUBY_REVISION|RUBY_COPYRIGHT|RUBY_ENGINE|RUBY_ENGINE_VERSION|RUBY_DESCRIPTION");
3941
+ var builtinVariables = ("$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE|" +
3942
+ "$!|root_url|flash|session|cookies|params|request|response|logger|self");
3943
+ var keywordMapper = this.$keywords = this.createKeywordMapper({
3944
+ "keyword": keywords,
3945
+ "constant.language": buildinConstants,
3946
+ "variable.language": builtinVariables,
3947
+ "support.function": builtinFunctions,
3948
+ "invalid.deprecated": "debugger" // TODO is this a remnant from js mode?
3949
+ }, "identifier");
3950
+ var escapedChars = "\\\\(?:n(?:[1-7][0-7]{0,2}|0)|[nsrtvfbae'\"\\\\]|c(?:\\\\M-)?.|M-(?:\\\\C-|\\\\c)?.|C-(?:\\\\M-)?.|[0-7]{3}|x[\\da-fA-F]{2}|u[\\da-fA-F]{4}|u{[\\da-fA-F]{1,6}(?:\\s[\\da-fA-F]{1,6})*})";
3951
+ var closeParen = {
3952
+ "(": ")",
3953
+ "[": "]",
3954
+ "{": "}",
3955
+ "<": ">",
3956
+ "^": "^",
3957
+ "|": "|",
3958
+ "%": "%"
3959
+ };
3960
+ this.$rules = {
3961
+ "start": [
3962
+ {
3963
+ token: "comment",
3964
+ regex: "#.*$"
3965
+ }, {
3966
+ token: "comment.multiline", // multi line comment
3967
+ regex: "^=begin(?=$|\\s.*$)",
3968
+ next: "comment"
3969
+ }, {
3970
+ token: "string.regexp",
3971
+ regex: /[/](?=.*\/)/,
3972
+ next: "regex"
3973
+ },
3974
+ [{
3975
+ token: ["constant.other.symbol.ruby", "string.start"],
3976
+ regex: /(:)?(")/,
3977
+ push: [{
3978
+ token: "constant.language.escape",
3979
+ regex: escapedChars
3980
+ }, {
3981
+ token: "paren.start",
3982
+ regex: /#{/,
3983
+ push: "start"
3984
+ }, {
3985
+ token: "string.end",
3986
+ regex: /"/,
3987
+ next: "pop"
3988
+ }, {
3989
+ defaultToken: "string"
3990
+ }]
3991
+ }, {
3992
+ token: "string.start",
3993
+ regex: /`/,
3994
+ push: [{
3995
+ token: "constant.language.escape",
3996
+ regex: escapedChars
3997
+ }, {
3998
+ token: "paren.start",
3999
+ regex: /#{/,
4000
+ push: "start"
4001
+ }, {
4002
+ token: "string.end",
4003
+ regex: /`/,
4004
+ next: "pop"
4005
+ }, {
4006
+ defaultToken: "string"
4007
+ }]
4008
+ }, {
4009
+ token: ["constant.other.symbol.ruby", "string.start"],
4010
+ regex: /(:)?(')/,
4011
+ push: [{
4012
+ token: "constant.language.escape",
4013
+ regex: /\\['\\]/
4014
+ }, {
4015
+ token: "string.end",
4016
+ regex: /'/,
4017
+ next: "pop"
4018
+ }, {
4019
+ defaultToken: "string"
4020
+ }]
4021
+ }, {
4022
+ token: "string.start", //doesn't see any differences between strings and array of strings in highlighting
4023
+ regex: /%[qwx]([(\[<{^|%])/, onMatch: function (val, state, stack) {
4024
+ if (stack.length)
4025
+ stack = [];
4026
+ var paren = val[val.length - 1];
4027
+ stack.unshift(paren, state);
4028
+ this.next = "qStateWithoutInterpolation";
4029
+ return this.token;
4030
+ }
4031
+ }, {
4032
+ token: "string.start", //doesn't see any differences between strings and array of strings in highlighting
4033
+ regex: /%[QWX]?([(\[<{^|%])/, onMatch: function (val, state, stack) {
4034
+ if (stack.length)
4035
+ stack = [];
4036
+ var paren = val[val.length - 1];
4037
+ stack.unshift(paren, state);
4038
+ this.next = "qStateWithInterpolation";
4039
+ return this.token;
4040
+ }
4041
+ }, {
4042
+ token: "constant.other.symbol.ruby", //doesn't see any differences between symbols and array of symbols in highlighting
4043
+ regex: /%[si]([(\[<{^|%])/, onMatch: function (val, state, stack) {
4044
+ if (stack.length)
4045
+ stack = [];
4046
+ var paren = val[val.length - 1];
4047
+ stack.unshift(paren, state);
4048
+ this.next = "sStateWithoutInterpolation";
4049
+ return this.token;
4050
+ }
4051
+ }, {
4052
+ token: "constant.other.symbol.ruby", //doesn't see any differences between symbols and array of symbols in highlighting
4053
+ regex: /%[SI]([(\[<{^|%])/, onMatch: function (val, state, stack) {
4054
+ if (stack.length)
4055
+ stack = [];
4056
+ var paren = val[val.length - 1];
4057
+ stack.unshift(paren, state);
4058
+ this.next = "sStateWithInterpolation";
4059
+ return this.token;
4060
+ }
4061
+ }, {
4062
+ token: "string.regexp",
4063
+ regex: /%[r]([(\[<{^|%])/, onMatch: function (val, state, stack) {
4064
+ if (stack.length)
4065
+ stack = [];
4066
+ var paren = val[val.length - 1];
4067
+ stack.unshift(paren, state);
4068
+ this.next = "rState";
4069
+ return this.token;
4070
+ }
4071
+ }],
4072
+ {
4073
+ token: "punctuation", // namespaces aren't symbols
4074
+ regex: "::"
4075
+ },
4076
+ instanceVariable,
4077
+ {
4078
+ token: "variable.global", // global variable
4079
+ regex: "[$][a-zA-Z_\\d]+"
4080
+ }, {
4081
+ token: "support.class", // class name
4082
+ regex: "[A-Z][a-zA-Z_\\d]*"
4083
+ }, {
4084
+ token: ["punctuation.operator", "support.function"],
4085
+ regex: /(\.)([a-zA-Z_\d]+)(?=\()/
4086
+ }, {
4087
+ token: ["punctuation.operator", "identifier"],
4088
+ regex: /(\.)([a-zA-Z_][a-zA-Z_\d]*)/
4089
+ }, {
4090
+ token: "string.character",
4091
+ regex: "\\B\\?(?:" + escapedChars + "|\\S)"
4092
+ }, {
4093
+ token: "punctuation.operator",
4094
+ regex: /\?(?=.+:)/
4095
+ },
4096
+ constantNumericRational,
4097
+ constantNumericComplex,
4098
+ constantOtherSymbol,
4099
+ constantNumericHex,
4100
+ constantNumericFloat,
4101
+ constantNumericBinary,
4102
+ constantNumericDecimal,
4103
+ constantNumericOctal,
4104
+ {
4105
+ token: "constant.language.boolean",
4106
+ regex: "(?:true|false)\\b"
4107
+ }, {
4108
+ token: keywordMapper,
4109
+ regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
4110
+ }, {
4111
+ token: "punctuation.separator.key-value",
4112
+ regex: "=>"
4113
+ }, {
4114
+ stateName: "heredoc",
4115
+ onMatch: function (value, currentState, stack) {
4116
+ var next = (value[2] == '-' || value[2] == '~') ? "indentedHeredoc" : "heredoc";
4117
+ var tokens = value.split(this.splitRegex);
4118
+ stack.push(next, tokens[3]);
4119
+ return [
4120
+ { type: "constant", value: tokens[1] },
4121
+ { type: "string", value: tokens[2] },
4122
+ { type: "support.class", value: tokens[3] },
4123
+ { type: "string", value: tokens[4] }
4124
+ ];
4125
+ },
4126
+ regex: "(<<[-~]?)(['\"`]?)([\\w]+)(['\"`]?)",
4127
+ rules: {
4128
+ heredoc: [{
4129
+ onMatch: function (value, currentState, stack) {
4130
+ if (value === stack[1]) {
4131
+ stack.shift();
4132
+ stack.shift();
4133
+ this.next = stack[0] || "start";
4134
+ return "support.class";
4135
+ }
4136
+ this.next = "";
4137
+ return "string";
4138
+ },
4139
+ regex: ".*$",
4140
+ next: "start"
4141
+ }],
4142
+ indentedHeredoc: [{
4143
+ token: "string",
4144
+ regex: "^ +"
4145
+ }, {
4146
+ onMatch: function (value, currentState, stack) {
4147
+ if (value === stack[1]) {
4148
+ stack.shift();
4149
+ stack.shift();
4150
+ this.next = stack[0] || "start";
4151
+ return "support.class";
4152
+ }
4153
+ this.next = "";
4154
+ return "string";
4155
+ },
4156
+ regex: ".*$",
4157
+ next: "start"
4158
+ }]
4159
+ }
4160
+ }, {
4161
+ regex: "$",
4162
+ token: "empty",
4163
+ next: function (currentState, stack) {
4164
+ if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc")
4165
+ return stack[0];
4166
+ return currentState;
4167
+ }
4168
+ }, {
4169
+ token: "keyword.operator",
4170
+ regex: "!|\\$|%|&|\\*|/|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\||\\b(?:in|instanceof|new|delete|typeof|void)"
4171
+ }, {
4172
+ token: "paren.lparen",
4173
+ regex: "[[({]"
4174
+ }, {
4175
+ token: "paren.rparen",
4176
+ regex: "[\\])}]",
4177
+ onMatch: function (value, currentState, stack) {
4178
+ this.next = '';
4179
+ if (value == "}" && stack.length > 1 && stack[1] != "start") {
4180
+ stack.shift();
4181
+ this.next = stack.shift();
4182
+ }
4183
+ return this.token;
4184
+ }
4185
+ }, {
4186
+ token: "text",
4187
+ regex: "\\s+"
4188
+ }, {
4189
+ token: "punctuation.operator",
4190
+ regex: /[?:,;.]/
4191
+ }
4192
+ ],
4193
+ "comment": [
4194
+ {
4195
+ token: "comment.multiline", // closing comment
4196
+ regex: "^=end(?=$|\\s.*$)",
4197
+ next: "start"
4198
+ }, {
4199
+ token: "comment", // comment spanning whole line
4200
+ regex: ".+"
4201
+ }
4202
+ ],
4203
+ "qStateWithInterpolation": [{
4204
+ token: "string.start", // excluded nested |^% due to difficulty in realization
4205
+ regex: /[(\[<{]/, onMatch: function (val, state, stack) {
4206
+ if (stack.length && val === stack[0]) {
4207
+ stack.unshift(val, state);
4208
+ return this.token;
4209
+ }
4210
+ return "string";
4211
+ }
4212
+ }, {
4213
+ token: "constant.language.escape",
4214
+ regex: escapedChars
4215
+ }, {
4216
+ token: "constant.language.escape",
4217
+ regex: /\\./
4218
+ }, {
4219
+ token: "paren.start",
4220
+ regex: /#{/,
4221
+ push: "start"
4222
+ }, {
4223
+ token: "string.end",
4224
+ regex: /[)\]>}^|%]/, onMatch: function (val, state, stack) {
4225
+ if (stack.length && val === closeParen[stack[0]]) {
4226
+ stack.shift();
4227
+ this.next = stack.shift();
4228
+ return this.token;
4229
+ }
4230
+ this.next = '';
4231
+ return "string";
4232
+ }
4233
+ }, {
4234
+ defaultToken: "string"
4235
+ }],
4236
+ "qStateWithoutInterpolation": [{
4237
+ token: "string.start", // excluded nested |^% due to difficulty in realization
4238
+ regex: /[(\[<{]/, onMatch: function (val, state, stack) {
4239
+ if (stack.length && val === stack[0]) {
4240
+ stack.unshift(val, state);
4241
+ return this.token;
4242
+ }
4243
+ return "string";
4244
+ }
4245
+ }, {
4246
+ token: "constant.language.escape",
4247
+ regex: /\\['\\]/
4248
+ }, {
4249
+ token: "constant.language.escape",
4250
+ regex: /\\./
4251
+ }, {
4252
+ token: "string.end",
4253
+ regex: /[)\]>}^|%]/, onMatch: function (val, state, stack) {
4254
+ if (stack.length && val === closeParen[stack[0]]) {
4255
+ stack.shift();
4256
+ this.next = stack.shift();
4257
+ return this.token;
4258
+ }
4259
+ this.next = '';
4260
+ return "string";
4261
+ }
4262
+ }, {
4263
+ defaultToken: "string"
4264
+ }],
4265
+ "sStateWithoutInterpolation": [{
4266
+ token: "constant.other.symbol.ruby", // excluded nested |^% due to difficulty in realization
4267
+ regex: /[(\[<{]/, onMatch: function (val, state, stack) {
4268
+ if (stack.length && val === stack[0]) {
4269
+ stack.unshift(val, state);
4270
+ return this.token;
4271
+ }
4272
+ return "constant.other.symbol.ruby";
4273
+ }
4274
+ }, {
4275
+ token: "constant.other.symbol.ruby",
4276
+ regex: /[)\]>}^|%]/, onMatch: function (val, state, stack) {
4277
+ if (stack.length && val === closeParen[stack[0]]) {
4278
+ stack.shift();
4279
+ this.next = stack.shift();
4280
+ return this.token;
4281
+ }
4282
+ this.next = '';
4283
+ return "constant.other.symbol.ruby";
4284
+ }
4285
+ }, {
4286
+ defaultToken: "constant.other.symbol.ruby"
4287
+ }],
4288
+ "sStateWithInterpolation": [{
4289
+ token: "constant.other.symbol.ruby", // excluded nested |^% due to difficulty in realization
4290
+ regex: /[(\[<{]/, onMatch: function (val, state, stack) {
4291
+ if (stack.length && val === stack[0]) {
4292
+ stack.unshift(val, state);
4293
+ return this.token;
4294
+ }
4295
+ return "constant.other.symbol.ruby";
4296
+ }
4297
+ }, {
4298
+ token: "constant.language.escape",
4299
+ regex: escapedChars
4300
+ }, {
4301
+ token: "constant.language.escape",
4302
+ regex: /\\./
4303
+ }, {
4304
+ token: "paren.start",
4305
+ regex: /#{/,
4306
+ push: "start"
4307
+ }, {
4308
+ token: "constant.other.symbol.ruby",
4309
+ regex: /[)\]>}^|%]/, onMatch: function (val, state, stack) {
4310
+ if (stack.length && val === closeParen[stack[0]]) {
4311
+ stack.shift();
4312
+ this.next = stack.shift();
4313
+ return this.token;
4314
+ }
4315
+ this.next = '';
4316
+ return "constant.other.symbol.ruby";
4317
+ }
4318
+ }, {
4319
+ defaultToken: "constant.other.symbol.ruby"
4320
+ }],
4321
+ "rState": [{
4322
+ token: "string.regexp", // excluded nested |^% due to difficulty in realization
4323
+ regex: /[(\[<{]/, onMatch: function (val, state, stack) {
4324
+ if (stack.length && val === stack[0]) {
4325
+ stack.unshift(val, state);
4326
+ return this.token;
4327
+ }
4328
+ return "constant.language.escape";
4329
+ }
4330
+ }, {
4331
+ token: "paren.start",
4332
+ regex: /#{/,
4333
+ push: "start"
4334
+ }, {
4335
+ token: "string.regexp",
4336
+ regex: /\//
4337
+ }, {
4338
+ token: "string.regexp",
4339
+ regex: /[)\]>}^|%][imxouesn]*/, onMatch: function (val, state, stack) {
4340
+ if (stack.length && val[0] === closeParen[stack[0]]) {
4341
+ stack.shift();
4342
+ this.next = stack.shift();
4343
+ return this.token;
4344
+ }
4345
+ this.next = '';
4346
+ return "constant.language.escape";
4347
+ }
4348
+ },
4349
+ { include: "regex" },
4350
+ {
4351
+ defaultToken: "string.regexp"
4352
+ }],
4353
+ "regex": [
4354
+ {
4355
+ token: "regexp.keyword",
4356
+ regex: /\\[wWdDhHsS]/
4357
+ }, {
4358
+ token: "constant.language.escape",
4359
+ regex: /\\[AGbBzZ]/
4360
+ }, {
4361
+ token: "constant.language.escape",
4362
+ regex: /\\g<[a-zA-Z0-9]*>/
4363
+ }, {
4364
+ token: ["constant.language.escape", "regexp.keyword", "constant.language.escape"],
4365
+ regex: /(\\p{\^?)(Alnum|Alpha|Blank|Cntrl|Digit|Graph|Lower|Print|Punct|Space|Upper|XDigit|Word|ASCII|Any|Assigned|Arabic|Armenian|Balinese|Bengali|Bopomofo|Braille|Buginese|Buhid|Canadian_Aboriginal|Carian|Cham|Cherokee|Common|Coptic|Cuneiform|Cypriot|Cyrillic|Deseret|Devanagari|Ethiopic|Georgian|Glagolitic|Gothic|Greek|Gujarati|Gurmukhi|Han|Hangul|Hanunoo|Hebrew|Hiragana|Inherited|Kannada|Katakana|Kayah_Li|Kharoshthi|Khmer|Lao|Latin|Lepcha|Limbu|Linear_B|Lycian|Lydian|Malayalam|Mongolian|Myanmar|New_Tai_Lue|Nko|Ogham|Ol_Chiki|Old_Italic|Old_Persian|Oriya|Osmanya|Phags_Pa|Phoenician|Rejang|Runic|Saurashtra|Shavian|Sinhala|Sundanese|Syloti_Nagri|Syriac|Tagalog|Tagbanwa|Tai_Le|Tamil|Telugu|Thaana|Thai|Tibetan|Tifinagh|Ugaritic|Vai|Yi|Ll|Lm|Lt|Lu|Lo|Mn|Mc|Me|Nd|Nl|Pc|Pd|Ps|Pe|Pi|Pf|Po|No|Sm|Sc|Sk|So|Zs|Zl|Zp|Cc|Cf|Cn|Co|Cs|N|L|M|P|S|Z|C)(})/
4366
+ }, {
4367
+ token: ["constant.language.escape", "invalid", "constant.language.escape"],
4368
+ regex: /(\\p{\^?)([^/]*)(})/
4369
+ }, {
4370
+ token: "regexp.keyword.operator",
4371
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
4372
+ }, {
4373
+ token: "string.regexp",
4374
+ regex: /[/][imxouesn]*/,
4375
+ next: "start"
4376
+ }, {
4377
+ token: "invalid",
4378
+ regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
4379
+ }, {
4380
+ token: "constant.language.escape",
4381
+ regex: /\(\?(?:[:=!>]|<'?[a-zA-Z]*'?>|<[=!])|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
4382
+ }, {
4383
+ token: "constant.language.delimiter",
4384
+ regex: /\|/
4385
+ }, {
4386
+ token: "regexp.keyword",
4387
+ regex: /\[\[:(?:alnum|alpha|blank|cntrl|digit|graph|lower|print|punct|space|upper|xdigit|word|ascii):\]\]/
4388
+ }, {
4389
+ token: "constant.language.escape",
4390
+ regex: /\[\^?/,
4391
+ push: "regex_character_class"
4392
+ }, {
4393
+ defaultToken: "string.regexp"
4394
+ }
4395
+ ],
4396
+ "regex_character_class": [
4397
+ {
4398
+ token: "regexp.keyword",
4399
+ regex: /\\[wWdDhHsS]/
4400
+ }, {
4401
+ token: "regexp.charclass.keyword.operator",
4402
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
4403
+ }, {
4404
+ token: "constant.language.escape",
4405
+ regex: /&?&?\[\^?/,
4406
+ push: "regex_character_class"
4407
+ }, {
4408
+ token: "constant.language.escape",
4409
+ regex: "]",
4410
+ next: "pop"
4411
+ }, {
4412
+ token: "constant.language.escape",
4413
+ regex: "-"
4414
+ }, {
4415
+ defaultToken: "string.regexp.characterclass"
4416
+ }
4417
+ ]
4418
+ };
4419
+ this.normalizeRules();
4420
+ };
4421
+ oop.inherits(RubyHighlightRules, TextHighlightRules);
4422
+ exports.RubyHighlightRules = RubyHighlightRules;
4423
+
4424
+ });
4425
+
4426
+ ace.define("ace/mode/folding/ruby",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"], function(require, exports, module){"use strict";
4427
+ var oop = require("../../lib/oop");
4428
+ var BaseFoldMode = require("./fold_mode").FoldMode;
4429
+ var Range = require("../../range").Range;
4430
+ var TokenIterator = require("../../token_iterator").TokenIterator;
4431
+ var FoldMode = exports.FoldMode = function () {
4432
+ };
4433
+ oop.inherits(FoldMode, BaseFoldMode);
4434
+ (function () {
4435
+ this.indentKeywords = {
4436
+ "class": 1,
4437
+ "def": 1,
4438
+ "module": 1,
4439
+ "do": 1,
4440
+ "unless": 1,
4441
+ "if": 1,
4442
+ "while": 1,
4443
+ "for": 1,
4444
+ "until": 1,
4445
+ "begin": 1,
4446
+ "else": 0,
4447
+ "elsif": 0,
4448
+ "rescue": 0,
4449
+ "ensure": 0,
4450
+ "when": 0,
4451
+ "end": -1,
4452
+ "case": 1,
4453
+ "=begin": 1,
4454
+ "=end": -1
4455
+ };
4456
+ this.foldingStartMarker = /(?:\s|^)(def|do|while|class|unless|module|if|for|until|begin|else|elsif|case|rescue|ensure|when)\b|({\s*$)|(=begin)/;
4457
+ this.foldingStopMarker = /(=end(?=$|\s.*$))|(^\s*})|\b(end)\b/;
4458
+ this.getFoldWidget = function (session, foldStyle, row) {
4459
+ var line = session.getLine(row);
4460
+ var isStart = this.foldingStartMarker.test(line);
4461
+ var isEnd = this.foldingStopMarker.test(line);
4462
+ if (isStart && !isEnd) {
4463
+ var match = line.match(this.foldingStartMarker);
4464
+ if (match[1]) {
4465
+ if (match[1] == "if" || match[1] == "else" || match[1] == "while" || match[1] == "until" || match[1] == "unless") {
4466
+ if (match[1] == "else" && /^\s*else\s*$/.test(line) === false) {
4467
+ return;
4468
+ }
4469
+ if (/^\s*(?:if|else|while|until|unless)\s*/.test(line) === false) {
4470
+ return;
4471
+ }
4472
+ }
4473
+ if (match[1] == "when") {
4474
+ if (/\sthen\s/.test(line) === true) {
4475
+ return;
4476
+ }
4477
+ }
4478
+ if (session.getTokenAt(row, match.index + 2).type === "keyword")
4479
+ return "start";
4480
+ }
4481
+ else if (match[3]) {
4482
+ if (session.getTokenAt(row, match.index + 1).type === "comment.multiline")
4483
+ return "start";
4484
+ }
4485
+ else {
4486
+ return "start";
4487
+ }
4488
+ }
4489
+ if (foldStyle != "markbeginend" || !isEnd || isStart && isEnd)
4490
+ return "";
4491
+ var match = line.match(this.foldingStopMarker);
4492
+ if (match[3] === "end") {
4493
+ if (session.getTokenAt(row, match.index + 1).type === "keyword")
4494
+ return "end";
4495
+ }
4496
+ else if (match[1]) {
4497
+ if (session.getTokenAt(row, match.index + 1).type === "comment.multiline")
4498
+ return "end";
4499
+ }
4500
+ else
4501
+ return "end";
4502
+ };
4503
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
4504
+ var line = session.doc.getLine(row);
4505
+ var match = this.foldingStartMarker.exec(line);
4506
+ if (match) {
4507
+ if (match[1] || match[3])
4508
+ return this.rubyBlock(session, row, match.index + 2);
4509
+ return this.openingBracketBlock(session, "{", row, match.index);
4510
+ }
4511
+ var match = this.foldingStopMarker.exec(line);
4512
+ if (match) {
4513
+ if (match[3] === "end") {
4514
+ if (session.getTokenAt(row, match.index + 1).type === "keyword")
4515
+ return this.rubyBlock(session, row, match.index + 1);
4516
+ }
4517
+ if (match[1] === "=end") {
4518
+ if (session.getTokenAt(row, match.index + 1).type === "comment.multiline")
4519
+ return this.rubyBlock(session, row, match.index + 1);
4520
+ }
4521
+ return this.closingBracketBlock(session, "}", row, match.index + match[0].length);
4522
+ }
4523
+ };
4524
+ this.rubyBlock = function (session, row, column, tokenRange) {
4525
+ var stream = new TokenIterator(session, row, column);
4526
+ var token = stream.getCurrentToken();
4527
+ if (!token || (token.type != "keyword" && token.type != "comment.multiline"))
4528
+ return;
4529
+ var val = token.value;
4530
+ var line = session.getLine(row);
4531
+ switch (token.value) {
4532
+ case "if":
4533
+ case "unless":
4534
+ case "while":
4535
+ case "until":
4536
+ var checkToken = new RegExp("^\\s*" + token.value);
4537
+ if (!checkToken.test(line)) {
4538
+ return;
4539
+ }
4540
+ var dir = this.indentKeywords[val];
4541
+ break;
4542
+ case "when":
4543
+ if (/\sthen\s/.test(line)) {
4544
+ return;
4545
+ }
4546
+ case "elsif":
4547
+ case "rescue":
4548
+ case "ensure":
4549
+ var dir = 1;
4550
+ break;
4551
+ case "else":
4552
+ var checkToken = new RegExp("^\\s*" + token.value + "\\s*$");
4553
+ if (!checkToken.test(line)) {
4554
+ return;
4555
+ }
4556
+ var dir = 1;
4557
+ break;
4558
+ default:
4559
+ var dir = this.indentKeywords[val];
4560
+ break;
4561
+ }
4562
+ var stack = [val];
4563
+ if (!dir)
4564
+ return;
4565
+ var startColumn = dir === -1 ? session.getLine(row - 1).length : session.getLine(row).length;
4566
+ var startRow = row;
4567
+ var ranges = [];
4568
+ ranges.push(stream.getCurrentTokenRange());
4569
+ stream.step = dir === -1 ? stream.stepBackward : stream.stepForward;
4570
+ if (token.type == "comment.multiline") {
4571
+ while (token = stream.step()) {
4572
+ if (token.type !== "comment.multiline")
4573
+ continue;
4574
+ if (dir == 1) {
4575
+ startColumn = 6;
4576
+ if (token.value == "=end") {
4577
+ break;
4578
+ }
4579
+ }
4580
+ else {
4581
+ if (token.value == "=begin") {
4582
+ break;
4583
+ }
4584
+ }
4585
+ }
4586
+ }
4587
+ else {
4588
+ while (token = stream.step()) {
4589
+ var ignore = false;
4590
+ if (token.type !== "keyword")
4591
+ continue;
4592
+ var level = dir * this.indentKeywords[token.value];
4593
+ line = session.getLine(stream.getCurrentTokenRow());
4594
+ switch (token.value) {
4595
+ case "do":
4596
+ for (var i = stream.$tokenIndex - 1; i >= 0; i--) {
4597
+ var prevToken = stream.$rowTokens[i];
4598
+ if (prevToken && (prevToken.value == "while" || prevToken.value == "until" || prevToken.value == "for")) {
4599
+ level = 0;
4600
+ break;
4601
+ }
4602
+ }
4603
+ break;
4604
+ case "else":
4605
+ var checkToken = new RegExp("^\\s*" + token.value + "\\s*$");
4606
+ if (!checkToken.test(line) || val == "case") {
4607
+ level = 0;
4608
+ ignore = true;
4609
+ }
4610
+ break;
4611
+ case "if":
4612
+ case "unless":
4613
+ case "while":
4614
+ case "until":
4615
+ var checkToken = new RegExp("^\\s*" + token.value);
4616
+ if (!checkToken.test(line)) {
4617
+ level = 0;
4618
+ ignore = true;
4619
+ }
4620
+ break;
4621
+ case "when":
4622
+ if (/\sthen\s/.test(line) || val == "case") {
4623
+ level = 0;
4624
+ ignore = true;
4625
+ }
4626
+ break;
4627
+ }
4628
+ if (level > 0) {
4629
+ stack.unshift(token.value);
4630
+ }
4631
+ else if (level <= 0 && ignore === false) {
4632
+ stack.shift();
4633
+ if (!stack.length) {
4634
+ if ((val == "while" || val == "until" || val == "for") && token.value != "do") {
4635
+ break;
4636
+ }
4637
+ if (token.value == "do" && dir == -1 && level != 0)
4638
+ break;
4639
+ if (token.value != "do")
4640
+ break;
4641
+ }
4642
+ if (level === 0) {
4643
+ stack.unshift(token.value);
4644
+ }
4645
+ }
4646
+ }
4647
+ }
4648
+ if (!token)
4649
+ return null;
4650
+ if (tokenRange) {
4651
+ ranges.push(stream.getCurrentTokenRange());
4652
+ return ranges;
4653
+ }
4654
+ var row = stream.getCurrentTokenRow();
4655
+ if (dir === -1) {
4656
+ if (token.type === "comment.multiline") {
4657
+ var endColumn = 6;
4658
+ }
4659
+ else {
4660
+ var endColumn = session.getLine(row).length;
4661
+ }
4662
+ return new Range(row, endColumn, startRow - 1, startColumn);
4663
+ }
4664
+ else
4665
+ return new Range(startRow, startColumn, row - 1, session.getLine(row - 1).length);
4666
+ };
4667
+ }).call(FoldMode.prototype);
4668
+
4669
+ });
4670
+
4671
+ ace.define("ace/mode/ruby",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ruby_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/folding/ruby"], function(require, exports, module){"use strict";
4672
+ var oop = require("../lib/oop");
4673
+ var TextMode = require("./text").Mode;
4674
+ var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules;
4675
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
4676
+ var Range = require("../range").Range;
4677
+ var FoldMode = require("./folding/ruby").FoldMode;
4678
+ var Mode = function () {
4679
+ this.HighlightRules = RubyHighlightRules;
4680
+ this.$outdent = new MatchingBraceOutdent();
4681
+ this.$behaviour = this.$defaultBehaviour;
4682
+ this.foldingRules = new FoldMode();
4683
+ this.indentKeywords = this.foldingRules.indentKeywords;
4684
+ };
4685
+ oop.inherits(Mode, TextMode);
4686
+ (function () {
4687
+ this.lineCommentStart = "#";
4688
+ this.getNextLineIndent = function (state, line, tab) {
4689
+ var indent = this.$getIndent(line);
4690
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
4691
+ var tokens = tokenizedLine.tokens;
4692
+ if (tokens.length && tokens[tokens.length - 1].type == "comment") {
4693
+ return indent;
4694
+ }
4695
+ if (state == "start") {
4696
+ var match = line.match(/^.*[\{\(\[]\s*$/);
4697
+ var startingClassOrMethod = line.match(/^\s*(class|def|module)\s.*$/);
4698
+ var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/);
4699
+ var startingConditional = line.match(/^\s*(if|else|when|elsif|unless|while|for|begin|rescue|ensure)\s*/);
4700
+ if (match || startingClassOrMethod || startingDoBlock || startingConditional) {
4701
+ indent += tab;
4702
+ }
4703
+ }
4704
+ return indent;
4705
+ };
4706
+ this.checkOutdent = function (state, line, input) {
4707
+ return /^\s+(end|else|rescue|ensure)$/.test(line + input) || this.$outdent.checkOutdent(line, input);
4708
+ };
4709
+ this.autoOutdent = function (state, session, row) {
4710
+ var line = session.getLine(row);
4711
+ if (/}/.test(line))
4712
+ return this.$outdent.autoOutdent(session, row);
4713
+ var indent = this.$getIndent(line);
4714
+ var prevLine = session.getLine(row - 1);
4715
+ var prevIndent = this.$getIndent(prevLine);
4716
+ var tab = session.getTabString();
4717
+ if (prevIndent.length <= indent.length) {
4718
+ if (indent.slice(-tab.length) == tab)
4719
+ session.remove(new Range(row, indent.length - tab.length, row, indent.length));
4720
+ }
4721
+ };
4722
+ this.getMatching = function (session, row, column) {
4723
+ if (row == undefined) {
4724
+ var pos = session.selection.lead;
4725
+ column = pos.column;
4726
+ row = pos.row;
4727
+ }
4728
+ var startToken = session.getTokenAt(row, column);
4729
+ if (startToken && startToken.value in this.indentKeywords)
4730
+ return this.foldingRules.rubyBlock(session, row, column, true);
4731
+ };
4732
+ this.$id = "ace/mode/ruby";
4733
+ this.snippetFileId = "ace/snippets/ruby";
4734
+ }).call(Mode.prototype);
4735
+ exports.Mode = Mode;
4736
+
4737
+ });
4738
+
4739
+ ace.define("ace/mode/slim",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/slim_highlight_rules","ace/mode/javascript","ace/mode/markdown","ace/mode/coffee","ace/mode/scss","ace/mode/sass","ace/mode/less","ace/mode/ruby","ace/mode/css"], function(require, exports, module){"use strict";
4740
+ var oop = require("../lib/oop");
4741
+ var TextMode = require("./text").Mode;
4742
+ var SlimHighlightRules = require("./slim_highlight_rules").SlimHighlightRules;
4743
+ var Mode = function () {
4744
+ TextMode.call(this);
4745
+ this.HighlightRules = SlimHighlightRules;
4746
+ this.createModeDelegates({
4747
+ javascript: require("./javascript").Mode,
4748
+ markdown: require("./markdown").Mode,
4749
+ coffee: require("./coffee").Mode,
4750
+ scss: require("./scss").Mode,
4751
+ sass: require("./sass").Mode,
4752
+ less: require("./less").Mode,
4753
+ ruby: require("./ruby").Mode,
4754
+ css: require("./css").Mode
4755
+ });
4756
+ };
4757
+ oop.inherits(Mode, TextMode);
4758
+ (function () {
4759
+ this.$id = "ace/mode/slim";
4760
+ }).call(Mode.prototype);
4761
+ exports.Mode = Mode;
4762
+
4763
+ }); (function() {
4764
+ ace.require(["ace/mode/slim"], function(m) {
4765
+ if (typeof module == "object" && typeof exports == "object" && module) {
4766
+ module.exports = m;
4767
+ }
4768
+ });
4769
+ })();
4770
+