ace-oqc 1.4.13

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 (401) hide show
  1. package/package.json +7 -0
  2. package/src-noconflict/ace.js +21402 -0
  3. package/src-noconflict/ext-beautify.js +331 -0
  4. package/src-noconflict/ext-elastic_tabstops_lite.js +277 -0
  5. package/src-noconflict/ext-emmet.js +1331 -0
  6. package/src-noconflict/ext-error_marker.js +9 -0
  7. package/src-noconflict/ext-keybinding_menu.js +193 -0
  8. package/src-noconflict/ext-language_tools.js +2166 -0
  9. package/src-noconflict/ext-linking.js +64 -0
  10. package/src-noconflict/ext-modelist.js +248 -0
  11. package/src-noconflict/ext-options.js +799 -0
  12. package/src-noconflict/ext-prompt.js +2806 -0
  13. package/src-noconflict/ext-rtl.js +122 -0
  14. package/src-noconflict/ext-searchbox.js +514 -0
  15. package/src-noconflict/ext-settings_menu.js +820 -0
  16. package/src-noconflict/ext-spellcheck.js +73 -0
  17. package/src-noconflict/ext-split.js +207 -0
  18. package/src-noconflict/ext-static_highlight.js +229 -0
  19. package/src-noconflict/ext-statusbar.js +56 -0
  20. package/src-noconflict/ext-textarea.js +430 -0
  21. package/src-noconflict/ext-themelist.js +67 -0
  22. package/src-noconflict/ext-whitespace.js +213 -0
  23. package/src-noconflict/keybinding-emacs.js +1169 -0
  24. package/src-noconflict/keybinding-sublime.js +422 -0
  25. package/src-noconflict/keybinding-vim.js +6198 -0
  26. package/src-noconflict/mode-abap.js +221 -0
  27. package/src-noconflict/mode-abc.js +271 -0
  28. package/src-noconflict/mode-actionscript.js +275 -0
  29. package/src-noconflict/mode-ada.js +137 -0
  30. package/src-noconflict/mode-apache_conf.js +363 -0
  31. package/src-noconflict/mode-apex.js +457 -0
  32. package/src-noconflict/mode-applescript.js +278 -0
  33. package/src-noconflict/mode-aql.js +102 -0
  34. package/src-noconflict/mode-asciidoc.js +349 -0
  35. package/src-noconflict/mode-asl.js +422 -0
  36. package/src-noconflict/mode-assembly_x86.js +193 -0
  37. package/src-noconflict/mode-autohotkey.js +244 -0
  38. package/src-noconflict/mode-batchfile.js +230 -0
  39. package/src-noconflict/mode-c9search.js +293 -0
  40. package/src-noconflict/mode-c_cpp.js +503 -0
  41. package/src-noconflict/mode-cirru.js +210 -0
  42. package/src-noconflict/mode-clojure.js +315 -0
  43. package/src-noconflict/mode-cobol.js +101 -0
  44. package/src-noconflict/mode-coffee.js +400 -0
  45. package/src-noconflict/mode-coldfusion.js +2596 -0
  46. package/src-noconflict/mode-crystal.js +642 -0
  47. package/src-noconflict/mode-csharp.js +502 -0
  48. package/src-noconflict/mode-csound_document.js +4105 -0
  49. package/src-noconflict/mode-csound_orchestra.js +3035 -0
  50. package/src-noconflict/mode-csound_score.js +462 -0
  51. package/src-noconflict/mode-csp.js +59 -0
  52. package/src-noconflict/mode-css.js +720 -0
  53. package/src-noconflict/mode-curly.js +2564 -0
  54. package/src-noconflict/mode-d.js +520 -0
  55. package/src-noconflict/mode-dart.js +715 -0
  56. package/src-noconflict/mode-diff.js +147 -0
  57. package/src-noconflict/mode-django.js +2595 -0
  58. package/src-noconflict/mode-dockerfile.js +500 -0
  59. package/src-noconflict/mode-dot.js +417 -0
  60. package/src-noconflict/mode-drools.js +498 -0
  61. package/src-noconflict/mode-edifact.js +166 -0
  62. package/src-noconflict/mode-eiffel.js +135 -0
  63. package/src-noconflict/mode-ejs.js +3533 -0
  64. package/src-noconflict/mode-elixir.js +501 -0
  65. package/src-noconflict/mode-elm.js +306 -0
  66. package/src-noconflict/mode-erlang.js +1010 -0
  67. package/src-noconflict/mode-forth.js +297 -0
  68. package/src-noconflict/mode-fortran.js +430 -0
  69. package/src-noconflict/mode-fsharp.js +316 -0
  70. package/src-noconflict/mode-fsl.js +259 -0
  71. package/src-noconflict/mode-ftl.js +1193 -0
  72. package/src-noconflict/mode-gcode.js +93 -0
  73. package/src-noconflict/mode-gherkin.js +168 -0
  74. package/src-noconflict/mode-gitignore.js +59 -0
  75. package/src-noconflict/mode-glsl.js +580 -0
  76. package/src-noconflict/mode-gobstones.js +1090 -0
  77. package/src-noconflict/mode-golang.js +413 -0
  78. package/src-noconflict/mode-graphqlschema.js +214 -0
  79. package/src-noconflict/mode-groovy.js +989 -0
  80. package/src-noconflict/mode-haml.js +1873 -0
  81. package/src-noconflict/mode-handlebars.js +2622 -0
  82. package/src-noconflict/mode-haskell.js +380 -0
  83. package/src-noconflict/mode-haskell_cabal.js +141 -0
  84. package/src-noconflict/mode-haxe.js +386 -0
  85. package/src-noconflict/mode-hjson.js +353 -0
  86. package/src-noconflict/mode-html.js +2509 -0
  87. package/src-noconflict/mode-html_elixir.js +3088 -0
  88. package/src-noconflict/mode-html_ruby.js +3550 -0
  89. package/src-noconflict/mode-ini.js +162 -0
  90. package/src-noconflict/mode-io.js +248 -0
  91. package/src-noconflict/mode-jack.js +346 -0
  92. package/src-noconflict/mode-jade.js +2025 -0
  93. package/src-noconflict/mode-java.js +1038 -0
  94. package/src-noconflict/mode-javascript.js +798 -0
  95. package/src-noconflict/mode-json.js +329 -0
  96. package/src-noconflict/mode-jsoniq.js +2632 -0
  97. package/src-noconflict/mode-jsp.js +1433 -0
  98. package/src-noconflict/mode-jssm.js +325 -0
  99. package/src-noconflict/mode-jsx.js +411 -0
  100. package/src-noconflict/mode-julia.js +303 -0
  101. package/src-noconflict/mode-kotlin.js +797 -0
  102. package/src-noconflict/mode-latex.js +296 -0
  103. package/src-noconflict/mode-less.js +839 -0
  104. package/src-noconflict/mode-liquid.js +2742 -0
  105. package/src-noconflict/mode-lisp.js +112 -0
  106. package/src-noconflict/mode-livescript.js +279 -0
  107. package/src-noconflict/mode-logiql.js +317 -0
  108. package/src-noconflict/mode-logtalk.js +352 -0
  109. package/src-noconflict/mode-lsl.js +343 -0
  110. package/src-noconflict/mode-lua.js +452 -0
  111. package/src-noconflict/mode-luapage.js +3028 -0
  112. package/src-noconflict/mode-lucene.js +154 -0
  113. package/src-noconflict/mode-makefile.js +412 -0
  114. package/src-noconflict/mode-markdown.js +3194 -0
  115. package/src-noconflict/mode-mask.js +1803 -0
  116. package/src-noconflict/mode-matlab.js +263 -0
  117. package/src-noconflict/mode-maze.js +292 -0
  118. package/src-noconflict/mode-mel.js +263 -0
  119. package/src-noconflict/mode-mixal.js +122 -0
  120. package/src-noconflict/mode-mushcode.js +681 -0
  121. package/src-noconflict/mode-mysql.js +167 -0
  122. package/src-noconflict/mode-nginx.js +298 -0
  123. package/src-noconflict/mode-nim.js +363 -0
  124. package/src-noconflict/mode-nix.js +647 -0
  125. package/src-noconflict/mode-nsis.js +312 -0
  126. package/src-noconflict/mode-objectivec.js +740 -0
  127. package/src-noconflict/mode-ocaml.js +421 -0
  128. package/src-noconflict/mode-pascal.js +223 -0
  129. package/src-noconflict/mode-perl.js +381 -0
  130. package/src-noconflict/mode-pgsql.js +1743 -0
  131. package/src-noconflict/mode-php.js +13110 -0
  132. package/src-noconflict/mode-php_laravel_blade.js +13311 -0
  133. package/src-noconflict/mode-pig.js +310 -0
  134. package/src-noconflict/mode-plain_text.js +32 -0
  135. package/src-noconflict/mode-powershell.js +418 -0
  136. package/src-noconflict/mode-praat.js +478 -0
  137. package/src-noconflict/mode-prolog.js +371 -0
  138. package/src-noconflict/mode-properties.js +80 -0
  139. package/src-noconflict/mode-protobuf.js +593 -0
  140. package/src-noconflict/mode-puppet.js +368 -0
  141. package/src-noconflict/mode-python.js +508 -0
  142. package/src-noconflict/mode-r.js +312 -0
  143. package/src-noconflict/mode-razor.js +2875 -0
  144. package/src-noconflict/mode-rdoc.js +243 -0
  145. package/src-noconflict/mode-red.js +450 -0
  146. package/src-noconflict/mode-redshift.js +360 -0
  147. package/src-noconflict/mode-rhtml.js +2808 -0
  148. package/src-noconflict/mode-rst.js +257 -0
  149. package/src-noconflict/mode-ruby.js +1003 -0
  150. package/src-noconflict/mode-rust.js +282 -0
  151. package/src-noconflict/mode-sass.js +529 -0
  152. package/src-noconflict/mode-scad.js +414 -0
  153. package/src-noconflict/mode-scala.js +984 -0
  154. package/src-noconflict/mode-scheme.js +232 -0
  155. package/src-noconflict/mode-scss.js +873 -0
  156. package/src-noconflict/mode-sh.js +449 -0
  157. package/src-noconflict/mode-sjs.js +1015 -0
  158. package/src-noconflict/mode-slim.js +5240 -0
  159. package/src-noconflict/mode-smarty.js +2635 -0
  160. package/src-noconflict/mode-snippets.js +207 -0
  161. package/src-noconflict/mode-soy_template.js +2848 -0
  162. package/src-noconflict/mode-space.js +167 -0
  163. package/src-noconflict/mode-sparql.js +320 -0
  164. package/src-noconflict/mode-sql.js +271 -0
  165. package/src-noconflict/mode-sqlserver.js +445 -0
  166. package/src-noconflict/mode-stylus.js +472 -0
  167. package/src-noconflict/mode-svg.js +1582 -0
  168. package/src-noconflict/mode-swift.js +395 -0
  169. package/src-noconflict/mode-tcl.js +387 -0
  170. package/src-noconflict/mode-terraform.js +400 -0
  171. package/src-noconflict/mode-tex.js +160 -0
  172. package/src-noconflict/mode-text.js +9 -0
  173. package/src-noconflict/mode-textile.js +150 -0
  174. package/src-noconflict/mode-toml.js +153 -0
  175. package/src-noconflict/mode-tsx.js +888 -0
  176. package/src-noconflict/mode-turtle.js +296 -0
  177. package/src-noconflict/mode-twig.js +2693 -0
  178. package/src-noconflict/mode-typescript.js +869 -0
  179. package/src-noconflict/mode-vala.js +677 -0
  180. package/src-noconflict/mode-vbscript.js +635 -0
  181. package/src-noconflict/mode-velocity.js +2792 -0
  182. package/src-noconflict/mode-verilog.js +118 -0
  183. package/src-noconflict/mode-vhdl.js +116 -0
  184. package/src-noconflict/mode-visualforce.js +2640 -0
  185. package/src-noconflict/mode-wollok.js +914 -0
  186. package/src-noconflict/mode-xml.js +676 -0
  187. package/src-noconflict/mode-xquery.js +2644 -0
  188. package/src-noconflict/mode-yaml.js +330 -0
  189. package/src-noconflict/mode-zeek.js +539 -0
  190. package/src-noconflict/qurator-mode.js +120 -0
  191. package/src-noconflict/qurator-worker.js +91 -0
  192. package/src-noconflict/snippets/abap.js +9 -0
  193. package/src-noconflict/snippets/abc.js +45 -0
  194. package/src-noconflict/snippets/actionscript.js +171 -0
  195. package/src-noconflict/snippets/ada.js +9 -0
  196. package/src-noconflict/snippets/apache_conf.js +9 -0
  197. package/src-noconflict/snippets/apex.js +9 -0
  198. package/src-noconflict/snippets/applescript.js +9 -0
  199. package/src-noconflict/snippets/aql.js +9 -0
  200. package/src-noconflict/snippets/asciidoc.js +9 -0
  201. package/src-noconflict/snippets/asl.js +9 -0
  202. package/src-noconflict/snippets/assembly_x86.js +9 -0
  203. package/src-noconflict/snippets/autohotkey.js +9 -0
  204. package/src-noconflict/snippets/batchfile.js +9 -0
  205. package/src-noconflict/snippets/c9search.js +9 -0
  206. package/src-noconflict/snippets/c_cpp.js +145 -0
  207. package/src-noconflict/snippets/cirru.js +9 -0
  208. package/src-noconflict/snippets/clojure.js +104 -0
  209. package/src-noconflict/snippets/cobol.js +9 -0
  210. package/src-noconflict/snippets/coffee.js +109 -0
  211. package/src-noconflict/snippets/coldfusion.js +9 -0
  212. package/src-noconflict/snippets/crystal.js +9 -0
  213. package/src-noconflict/snippets/csharp.js +9 -0
  214. package/src-noconflict/snippets/csound_document.js +24 -0
  215. package/src-noconflict/snippets/csound_orchestra.js +61 -0
  216. package/src-noconflict/snippets/csound_score.js +9 -0
  217. package/src-noconflict/snippets/csp.js +9 -0
  218. package/src-noconflict/snippets/css.js +981 -0
  219. package/src-noconflict/snippets/curly.js +9 -0
  220. package/src-noconflict/snippets/d.js +9 -0
  221. package/src-noconflict/snippets/dart.js +97 -0
  222. package/src-noconflict/snippets/diff.js +25 -0
  223. package/src-noconflict/snippets/django.js +122 -0
  224. package/src-noconflict/snippets/dockerfile.js +9 -0
  225. package/src-noconflict/snippets/dot.js +9 -0
  226. package/src-noconflict/snippets/drools.js +33 -0
  227. package/src-noconflict/snippets/edifact.js +254 -0
  228. package/src-noconflict/snippets/eiffel.js +9 -0
  229. package/src-noconflict/snippets/ejs.js +9 -0
  230. package/src-noconflict/snippets/elixir.js +9 -0
  231. package/src-noconflict/snippets/elm.js +9 -0
  232. package/src-noconflict/snippets/erlang.js +174 -0
  233. package/src-noconflict/snippets/forth.js +9 -0
  234. package/src-noconflict/snippets/fortran.js +9 -0
  235. package/src-noconflict/snippets/fsharp.js +9 -0
  236. package/src-noconflict/snippets/fsl.js +14 -0
  237. package/src-noconflict/snippets/ftl.js +9 -0
  238. package/src-noconflict/snippets/gcode.js +9 -0
  239. package/src-noconflict/snippets/gherkin.js +9 -0
  240. package/src-noconflict/snippets/gitignore.js +9 -0
  241. package/src-noconflict/snippets/glsl.js +9 -0
  242. package/src-noconflict/snippets/gobstones.js +1718 -0
  243. package/src-noconflict/snippets/golang.js +9 -0
  244. package/src-noconflict/snippets/graphqlschema.js +46 -0
  245. package/src-noconflict/snippets/groovy.js +9 -0
  246. package/src-noconflict/snippets/haml.js +34 -0
  247. package/src-noconflict/snippets/handlebars.js +9 -0
  248. package/src-noconflict/snippets/haskell.js +96 -0
  249. package/src-noconflict/snippets/haskell_cabal.js +9 -0
  250. package/src-noconflict/snippets/haxe.js +9 -0
  251. package/src-noconflict/snippets/hjson.js +9 -0
  252. package/src-noconflict/snippets/html.js +867 -0
  253. package/src-noconflict/snippets/html_elixir.js +9 -0
  254. package/src-noconflict/snippets/html_ruby.js +9 -0
  255. package/src-noconflict/snippets/ini.js +9 -0
  256. package/src-noconflict/snippets/io.js +76 -0
  257. package/src-noconflict/snippets/jack.js +9 -0
  258. package/src-noconflict/snippets/jade.js +9 -0
  259. package/src-noconflict/snippets/java.js +254 -0
  260. package/src-noconflict/snippets/javascript.js +209 -0
  261. package/src-noconflict/snippets/json.js +9 -0
  262. package/src-noconflict/snippets/jsoniq.js +75 -0
  263. package/src-noconflict/snippets/jsp.js +113 -0
  264. package/src-noconflict/snippets/jssm.js +9 -0
  265. package/src-noconflict/snippets/jsx.js +9 -0
  266. package/src-noconflict/snippets/julia.js +9 -0
  267. package/src-noconflict/snippets/kotlin.js +9 -0
  268. package/src-noconflict/snippets/latex.js +9 -0
  269. package/src-noconflict/snippets/less.js +9 -0
  270. package/src-noconflict/snippets/liquid.js +895 -0
  271. package/src-noconflict/snippets/lisp.js +9 -0
  272. package/src-noconflict/snippets/livescript.js +9 -0
  273. package/src-noconflict/snippets/logiql.js +9 -0
  274. package/src-noconflict/snippets/logtalk.js +9 -0
  275. package/src-noconflict/snippets/lsl.js +1246 -0
  276. package/src-noconflict/snippets/lua.js +35 -0
  277. package/src-noconflict/snippets/luapage.js +9 -0
  278. package/src-noconflict/snippets/lucene.js +9 -0
  279. package/src-noconflict/snippets/makefile.js +18 -0
  280. package/src-noconflict/snippets/markdown.js +102 -0
  281. package/src-noconflict/snippets/mask.js +9 -0
  282. package/src-noconflict/snippets/matlab.js +9 -0
  283. package/src-noconflict/snippets/maze.js +23 -0
  284. package/src-noconflict/snippets/mel.js +9 -0
  285. package/src-noconflict/snippets/mixal.js +9 -0
  286. package/src-noconflict/snippets/mushcode.js +9 -0
  287. package/src-noconflict/snippets/mysql.js +9 -0
  288. package/src-noconflict/snippets/nginx.js +9 -0
  289. package/src-noconflict/snippets/nim.js +9 -0
  290. package/src-noconflict/snippets/nix.js +9 -0
  291. package/src-noconflict/snippets/nsis.js +9 -0
  292. package/src-noconflict/snippets/objectivec.js +9 -0
  293. package/src-noconflict/snippets/ocaml.js +9 -0
  294. package/src-noconflict/snippets/pascal.js +9 -0
  295. package/src-noconflict/snippets/perl.js +361 -0
  296. package/src-noconflict/snippets/pgsql.js +9 -0
  297. package/src-noconflict/snippets/php.js +397 -0
  298. package/src-noconflict/snippets/php_laravel_blade.js +9 -0
  299. package/src-noconflict/snippets/pig.js +9 -0
  300. package/src-noconflict/snippets/plain_text.js +9 -0
  301. package/src-noconflict/snippets/powershell.js +9 -0
  302. package/src-noconflict/snippets/praat.js +9 -0
  303. package/src-noconflict/snippets/prolog.js +9 -0
  304. package/src-noconflict/snippets/properties.js +9 -0
  305. package/src-noconflict/snippets/protobuf.js +9 -0
  306. package/src-noconflict/snippets/puppet.js +9 -0
  307. package/src-noconflict/snippets/python.js +172 -0
  308. package/src-noconflict/snippets/r.js +135 -0
  309. package/src-noconflict/snippets/razor.js +17 -0
  310. package/src-noconflict/snippets/rdoc.js +9 -0
  311. package/src-noconflict/snippets/red.js +9 -0
  312. package/src-noconflict/snippets/redshift.js +9 -0
  313. package/src-noconflict/snippets/rhtml.js +9 -0
  314. package/src-noconflict/snippets/rst.js +36 -0
  315. package/src-noconflict/snippets/ruby.js +942 -0
  316. package/src-noconflict/snippets/rust.js +9 -0
  317. package/src-noconflict/snippets/sass.js +9 -0
  318. package/src-noconflict/snippets/scad.js +9 -0
  319. package/src-noconflict/snippets/scala.js +9 -0
  320. package/src-noconflict/snippets/scheme.js +9 -0
  321. package/src-noconflict/snippets/scss.js +9 -0
  322. package/src-noconflict/snippets/sh.js +97 -0
  323. package/src-noconflict/snippets/sjs.js +9 -0
  324. package/src-noconflict/snippets/slim.js +9 -0
  325. package/src-noconflict/snippets/smarty.js +9 -0
  326. package/src-noconflict/snippets/snippets.js +23 -0
  327. package/src-noconflict/snippets/soy_template.js +9 -0
  328. package/src-noconflict/snippets/space.js +9 -0
  329. package/src-noconflict/snippets/sparql.js +9 -0
  330. package/src-noconflict/snippets/sql.js +40 -0
  331. package/src-noconflict/snippets/sqlserver.js +83 -0
  332. package/src-noconflict/snippets/stylus.js +9 -0
  333. package/src-noconflict/snippets/svg.js +9 -0
  334. package/src-noconflict/snippets/swift.js +9 -0
  335. package/src-noconflict/snippets/tcl.js +106 -0
  336. package/src-noconflict/snippets/terraform.js +9 -0
  337. package/src-noconflict/snippets/tex.js +204 -0
  338. package/src-noconflict/snippets/text.js +9 -0
  339. package/src-noconflict/snippets/textile.js +44 -0
  340. package/src-noconflict/snippets/toml.js +9 -0
  341. package/src-noconflict/snippets/tsx.js +9 -0
  342. package/src-noconflict/snippets/turtle.js +9 -0
  343. package/src-noconflict/snippets/twig.js +9 -0
  344. package/src-noconflict/snippets/typescript.js +9 -0
  345. package/src-noconflict/snippets/vala.js +200 -0
  346. package/src-noconflict/snippets/vbscript.js +9 -0
  347. package/src-noconflict/snippets/velocity.js +43 -0
  348. package/src-noconflict/snippets/verilog.js +9 -0
  349. package/src-noconflict/snippets/vhdl.js +9 -0
  350. package/src-noconflict/snippets/visualforce.js +9 -0
  351. package/src-noconflict/snippets/wollok.js +98 -0
  352. package/src-noconflict/snippets/xml.js +9 -0
  353. package/src-noconflict/snippets/xquery.js +75 -0
  354. package/src-noconflict/snippets/yaml.js +9 -0
  355. package/src-noconflict/snippets/zeek.js +9 -0
  356. package/src-noconflict/theme-ambiance.js +185 -0
  357. package/src-noconflict/theme-chaos.js +163 -0
  358. package/src-noconflict/theme-chrome.js +135 -0
  359. package/src-noconflict/theme-clouds.js +102 -0
  360. package/src-noconflict/theme-clouds_midnight.js +103 -0
  361. package/src-noconflict/theme-cobalt.js +120 -0
  362. package/src-noconflict/theme-crimson_editor.js +125 -0
  363. package/src-noconflict/theme-dawn.js +115 -0
  364. package/src-noconflict/theme-dracula.js +135 -0
  365. package/src-noconflict/theme-dreamweaver.js +148 -0
  366. package/src-noconflict/theme-eclipse.js +105 -0
  367. package/src-noconflict/theme-github.js +110 -0
  368. package/src-noconflict/theme-gob.js +119 -0
  369. package/src-noconflict/theme-gruvbox.js +89 -0
  370. package/src-noconflict/theme-idle_fingers.js +103 -0
  371. package/src-noconflict/theme-iplastic.js +128 -0
  372. package/src-noconflict/theme-katzenmilch.js +128 -0
  373. package/src-noconflict/theme-kr_theme.js +111 -0
  374. package/src-noconflict/theme-kuroir.js +68 -0
  375. package/src-noconflict/theme-merbivore.js +102 -0
  376. package/src-noconflict/theme-merbivore_soft.js +103 -0
  377. package/src-noconflict/theme-mono_industrial.js +114 -0
  378. package/src-noconflict/theme-monokai.js +112 -0
  379. package/src-noconflict/theme-pastel_on_dark.js +115 -0
  380. package/src-noconflict/theme-solarized_dark.js +95 -0
  381. package/src-noconflict/theme-solarized_light.js +98 -0
  382. package/src-noconflict/theme-sqlserver.js +145 -0
  383. package/src-noconflict/theme-terminal.js +121 -0
  384. package/src-noconflict/theme-textmate.js +137 -0
  385. package/src-noconflict/theme-tomorrow.js +115 -0
  386. package/src-noconflict/theme-tomorrow_night.js +115 -0
  387. package/src-noconflict/theme-tomorrow_night_blue.js +113 -0
  388. package/src-noconflict/theme-tomorrow_night_bright.js +128 -0
  389. package/src-noconflict/theme-tomorrow_night_eighties.js +115 -0
  390. package/src-noconflict/theme-twilight.js +116 -0
  391. package/src-noconflict/theme-vibrant_ink.js +101 -0
  392. package/src-noconflict/theme-xcode.js +95 -0
  393. package/src-noconflict/worker-coffee.js +1470 -0
  394. package/src-noconflict/worker-css.js +9000 -0
  395. package/src-noconflict/worker-html.js +10922 -0
  396. package/src-noconflict/worker-javascript.js +15001 -0
  397. package/src-noconflict/worker-json.js +1715 -0
  398. package/src-noconflict/worker-lua.js +3608 -0
  399. package/src-noconflict/worker-php.js +3687 -0
  400. package/src-noconflict/worker-xml.js +3208 -0
  401. package/src-noconflict/worker-xquery.js +57668 -0
@@ -0,0 +1,3194 @@
1
+ ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2
+ "use strict";
3
+
4
+ var oop = require("../lib/oop");
5
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
6
+
7
+ var DocCommentHighlightRules = function() {
8
+ this.$rules = {
9
+ "start" : [ {
10
+ token : "comment.doc.tag",
11
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
12
+ },
13
+ DocCommentHighlightRules.getTagRule(),
14
+ {
15
+ defaultToken : "comment.doc",
16
+ caseInsensitive: true
17
+ }]
18
+ };
19
+ };
20
+
21
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
22
+
23
+ DocCommentHighlightRules.getTagRule = function(start) {
24
+ return {
25
+ token : "comment.doc.tag.storage.type",
26
+ regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
27
+ };
28
+ };
29
+
30
+ DocCommentHighlightRules.getStartRule = function(start) {
31
+ return {
32
+ token : "comment.doc", // doc comment
33
+ regex : "\\/\\*(?=\\*)",
34
+ next : start
35
+ };
36
+ };
37
+
38
+ DocCommentHighlightRules.getEndRule = function (start) {
39
+ return {
40
+ token : "comment.doc", // closing comment
41
+ regex : "\\*\\/",
42
+ next : start
43
+ };
44
+ };
45
+
46
+
47
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
48
+
49
+ });
50
+
51
+ ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
52
+ "use strict";
53
+
54
+ var oop = require("../lib/oop");
55
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
56
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
57
+ var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
58
+
59
+ var JavaScriptHighlightRules = function(options) {
60
+ var keywordMapper = this.createKeywordMapper({
61
+ "variable.language":
62
+ "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
63
+ "Namespace|QName|XML|XMLList|" + // E4X
64
+ "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
65
+ "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
66
+ "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
67
+ "SyntaxError|TypeError|URIError|" +
68
+ "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
69
+ "isNaN|parseFloat|parseInt|" +
70
+ "JSON|Math|" + // Other
71
+ "this|arguments|prototype|window|document" , // Pseudo
72
+ "keyword":
73
+ "const|yield|import|get|set|async|await|" +
74
+ "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
75
+ "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
76
+ "__parent__|__count__|escape|unescape|with|__proto__|" +
77
+ "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
78
+ "storage.type":
79
+ "const|let|var|function",
80
+ "constant.language":
81
+ "null|Infinity|NaN|undefined",
82
+ "support.function":
83
+ "alert",
84
+ "constant.language.boolean": "true|false"
85
+ }, "identifier");
86
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
87
+
88
+ var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
89
+ "u[0-9a-fA-F]{4}|" + // unicode
90
+ "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
91
+ "[0-2][0-7]{0,2}|" + // oct
92
+ "3[0-7][0-7]?|" + // oct
93
+ "[4-7][0-7]?|" + //oct
94
+ ".)";
95
+
96
+ this.$rules = {
97
+ "no_regex" : [
98
+ DocCommentHighlightRules.getStartRule("doc-start"),
99
+ comments("no_regex"),
100
+ {
101
+ token : "string",
102
+ regex : "'(?=.)",
103
+ next : "qstring"
104
+ }, {
105
+ token : "string",
106
+ regex : '"(?=.)',
107
+ next : "qqstring"
108
+ }, {
109
+ token : "constant.numeric", // hexadecimal, octal and binary
110
+ regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
111
+ }, {
112
+ token : "constant.numeric", // decimal integers and floats
113
+ regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
114
+ }, {
115
+ token : [
116
+ "storage.type", "punctuation.operator", "support.function",
117
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
118
+ ],
119
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
120
+ next: "function_arguments"
121
+ }, {
122
+ token : [
123
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
124
+ "keyword.operator", "text", "storage.type", "text", "paren.lparen"
125
+ ],
126
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
127
+ next: "function_arguments"
128
+ }, {
129
+ token : [
130
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
131
+ "text", "paren.lparen"
132
+ ],
133
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
134
+ next: "function_arguments"
135
+ }, {
136
+ token : [
137
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
138
+ "keyword.operator", "text",
139
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
140
+ ],
141
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
142
+ next: "function_arguments"
143
+ }, {
144
+ token : [
145
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
146
+ ],
147
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
148
+ next: "function_arguments"
149
+ }, {
150
+ token : [
151
+ "entity.name.function", "text", "punctuation.operator",
152
+ "text", "storage.type", "text", "paren.lparen"
153
+ ],
154
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
155
+ next: "function_arguments"
156
+ }, {
157
+ token : [
158
+ "text", "text", "storage.type", "text", "paren.lparen"
159
+ ],
160
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
161
+ next: "function_arguments"
162
+ }, {
163
+ token : "keyword",
164
+ regex : "from(?=\\s*('|\"))"
165
+ }, {
166
+ token : "keyword",
167
+ regex : "(?:" + kwBeforeRe + ")\\b",
168
+ next : "start"
169
+ }, {
170
+ token : ["support.constant"],
171
+ regex : /that\b/
172
+ }, {
173
+ token : ["storage.type", "punctuation.operator", "support.function.firebug"],
174
+ regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
175
+ }, {
176
+ token : keywordMapper,
177
+ regex : identifierRe
178
+ }, {
179
+ token : "punctuation.operator",
180
+ regex : /[.](?![.])/,
181
+ next : "property"
182
+ }, {
183
+ token : "storage.type",
184
+ regex : /=>/,
185
+ next : "start"
186
+ }, {
187
+ token : "keyword.operator",
188
+ regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
189
+ next : "start"
190
+ }, {
191
+ token : "punctuation.operator",
192
+ regex : /[?:,;.]/,
193
+ next : "start"
194
+ }, {
195
+ token : "paren.lparen",
196
+ regex : /[\[({]/,
197
+ next : "start"
198
+ }, {
199
+ token : "paren.rparen",
200
+ regex : /[\])}]/
201
+ }, {
202
+ token: "comment",
203
+ regex: /^#!.*$/
204
+ }
205
+ ],
206
+ property: [{
207
+ token : "text",
208
+ regex : "\\s+"
209
+ }, {
210
+ token : [
211
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
212
+ "keyword.operator", "text",
213
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
214
+ ],
215
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
216
+ next: "function_arguments"
217
+ }, {
218
+ token : "punctuation.operator",
219
+ regex : /[.](?![.])/
220
+ }, {
221
+ token : "support.function",
222
+ 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|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|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(?=\()/
223
+ }, {
224
+ token : "support.function.dom",
225
+ 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(?=\()/
226
+ }, {
227
+ token : "support.constant",
228
+ 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/
229
+ }, {
230
+ token : "identifier",
231
+ regex : identifierRe
232
+ }, {
233
+ regex: "",
234
+ token: "empty",
235
+ next: "no_regex"
236
+ }
237
+ ],
238
+ "start": [
239
+ DocCommentHighlightRules.getStartRule("doc-start"),
240
+ comments("start"),
241
+ {
242
+ token: "string.regexp",
243
+ regex: "\\/",
244
+ next: "regex"
245
+ }, {
246
+ token : "text",
247
+ regex : "\\s+|^$",
248
+ next : "start"
249
+ }, {
250
+ token: "empty",
251
+ regex: "",
252
+ next: "no_regex"
253
+ }
254
+ ],
255
+ "regex": [
256
+ {
257
+ token: "regexp.keyword.operator",
258
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
259
+ }, {
260
+ token: "string.regexp",
261
+ regex: "/[sxngimy]*",
262
+ next: "no_regex"
263
+ }, {
264
+ token : "invalid",
265
+ regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
266
+ }, {
267
+ token : "constant.language.escape",
268
+ regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
269
+ }, {
270
+ token : "constant.language.delimiter",
271
+ regex: /\|/
272
+ }, {
273
+ token: "constant.language.escape",
274
+ regex: /\[\^?/,
275
+ next: "regex_character_class"
276
+ }, {
277
+ token: "empty",
278
+ regex: "$",
279
+ next: "no_regex"
280
+ }, {
281
+ defaultToken: "string.regexp"
282
+ }
283
+ ],
284
+ "regex_character_class": [
285
+ {
286
+ token: "regexp.charclass.keyword.operator",
287
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
288
+ }, {
289
+ token: "constant.language.escape",
290
+ regex: "]",
291
+ next: "regex"
292
+ }, {
293
+ token: "constant.language.escape",
294
+ regex: "-"
295
+ }, {
296
+ token: "empty",
297
+ regex: "$",
298
+ next: "no_regex"
299
+ }, {
300
+ defaultToken: "string.regexp.charachterclass"
301
+ }
302
+ ],
303
+ "function_arguments": [
304
+ {
305
+ token: "variable.parameter",
306
+ regex: identifierRe
307
+ }, {
308
+ token: "punctuation.operator",
309
+ regex: "[, ]+"
310
+ }, {
311
+ token: "punctuation.operator",
312
+ regex: "$"
313
+ }, {
314
+ token: "empty",
315
+ regex: "",
316
+ next: "no_regex"
317
+ }
318
+ ],
319
+ "qqstring" : [
320
+ {
321
+ token : "constant.language.escape",
322
+ regex : escapedRe
323
+ }, {
324
+ token : "string",
325
+ regex : "\\\\$",
326
+ consumeLineEnd : true
327
+ }, {
328
+ token : "string",
329
+ regex : '"|$',
330
+ next : "no_regex"
331
+ }, {
332
+ defaultToken: "string"
333
+ }
334
+ ],
335
+ "qstring" : [
336
+ {
337
+ token : "constant.language.escape",
338
+ regex : escapedRe
339
+ }, {
340
+ token : "string",
341
+ regex : "\\\\$",
342
+ consumeLineEnd : true
343
+ }, {
344
+ token : "string",
345
+ regex : "'|$",
346
+ next : "no_regex"
347
+ }, {
348
+ defaultToken: "string"
349
+ }
350
+ ]
351
+ };
352
+
353
+
354
+ if (!options || !options.noES6) {
355
+ this.$rules.no_regex.unshift({
356
+ regex: "[{}]", onMatch: function(val, state, stack) {
357
+ this.next = val == "{" ? this.nextState : "";
358
+ if (val == "{" && stack.length) {
359
+ stack.unshift("start", state);
360
+ }
361
+ else if (val == "}" && stack.length) {
362
+ stack.shift();
363
+ this.next = stack.shift();
364
+ if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
365
+ return "paren.quasi.end";
366
+ }
367
+ return val == "{" ? "paren.lparen" : "paren.rparen";
368
+ },
369
+ nextState: "start"
370
+ }, {
371
+ token : "string.quasi.start",
372
+ regex : /`/,
373
+ push : [{
374
+ token : "constant.language.escape",
375
+ regex : escapedRe
376
+ }, {
377
+ token : "paren.quasi.start",
378
+ regex : /\${/,
379
+ push : "start"
380
+ }, {
381
+ token : "string.quasi.end",
382
+ regex : /`/,
383
+ next : "pop"
384
+ }, {
385
+ defaultToken: "string.quasi"
386
+ }]
387
+ });
388
+
389
+ if (!options || options.jsx != false)
390
+ JSX.call(this);
391
+ }
392
+
393
+ this.embedRules(DocCommentHighlightRules, "doc-",
394
+ [ DocCommentHighlightRules.getEndRule("no_regex") ]);
395
+
396
+ this.normalizeRules();
397
+ };
398
+
399
+ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
400
+
401
+ function JSX() {
402
+ var tagRegex = identifierRe.replace("\\d", "\\d\\-");
403
+ var jsxTag = {
404
+ onMatch : function(val, state, stack) {
405
+ var offset = val.charAt(1) == "/" ? 2 : 1;
406
+ if (offset == 1) {
407
+ if (state != this.nextState)
408
+ stack.unshift(this.next, this.nextState, 0);
409
+ else
410
+ stack.unshift(this.next);
411
+ stack[2]++;
412
+ } else if (offset == 2) {
413
+ if (state == this.nextState) {
414
+ stack[1]--;
415
+ if (!stack[1] || stack[1] < 0) {
416
+ stack.shift();
417
+ stack.shift();
418
+ }
419
+ }
420
+ }
421
+ return [{
422
+ type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
423
+ value: val.slice(0, offset)
424
+ }, {
425
+ type: "meta.tag.tag-name.xml",
426
+ value: val.substr(offset)
427
+ }];
428
+ },
429
+ regex : "</?" + tagRegex + "",
430
+ next: "jsxAttributes",
431
+ nextState: "jsx"
432
+ };
433
+ this.$rules.start.unshift(jsxTag);
434
+ var jsxJsRule = {
435
+ regex: "{",
436
+ token: "paren.quasi.start",
437
+ push: "start"
438
+ };
439
+ this.$rules.jsx = [
440
+ jsxJsRule,
441
+ jsxTag,
442
+ {include : "reference"},
443
+ {defaultToken: "string"}
444
+ ];
445
+ this.$rules.jsxAttributes = [{
446
+ token : "meta.tag.punctuation.tag-close.xml",
447
+ regex : "/?>",
448
+ onMatch : function(value, currentState, stack) {
449
+ if (currentState == stack[0])
450
+ stack.shift();
451
+ if (value.length == 2) {
452
+ if (stack[0] == this.nextState)
453
+ stack[1]--;
454
+ if (!stack[1] || stack[1] < 0) {
455
+ stack.splice(0, 2);
456
+ }
457
+ }
458
+ this.next = stack[0] || "start";
459
+ return [{type: this.token, value: value}];
460
+ },
461
+ nextState: "jsx"
462
+ },
463
+ jsxJsRule,
464
+ comments("jsxAttributes"),
465
+ {
466
+ token : "entity.other.attribute-name.xml",
467
+ regex : tagRegex
468
+ }, {
469
+ token : "keyword.operator.attribute-equals.xml",
470
+ regex : "="
471
+ }, {
472
+ token : "text.tag-whitespace.xml",
473
+ regex : "\\s+"
474
+ }, {
475
+ token : "string.attribute-value.xml",
476
+ regex : "'",
477
+ stateName : "jsx_attr_q",
478
+ push : [
479
+ {token : "string.attribute-value.xml", regex: "'", next: "pop"},
480
+ {include : "reference"},
481
+ {defaultToken : "string.attribute-value.xml"}
482
+ ]
483
+ }, {
484
+ token : "string.attribute-value.xml",
485
+ regex : '"',
486
+ stateName : "jsx_attr_qq",
487
+ push : [
488
+ {token : "string.attribute-value.xml", regex: '"', next: "pop"},
489
+ {include : "reference"},
490
+ {defaultToken : "string.attribute-value.xml"}
491
+ ]
492
+ },
493
+ jsxTag
494
+ ];
495
+ this.$rules.reference = [{
496
+ token : "constant.language.escape.reference.xml",
497
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
498
+ }];
499
+ }
500
+
501
+ function comments(next) {
502
+ return [
503
+ {
504
+ token : "comment", // multi line comment
505
+ regex : /\/\*/,
506
+ next: [
507
+ DocCommentHighlightRules.getTagRule(),
508
+ {token : "comment", regex : "\\*\\/", next : next || "pop"},
509
+ {defaultToken : "comment", caseInsensitive: true}
510
+ ]
511
+ }, {
512
+ token : "comment",
513
+ regex : "\\/\\/",
514
+ next: [
515
+ DocCommentHighlightRules.getTagRule(),
516
+ {token : "comment", regex : "$|^", next : next || "pop"},
517
+ {defaultToken : "comment", caseInsensitive: true}
518
+ ]
519
+ }
520
+ ];
521
+ }
522
+ exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
523
+ });
524
+
525
+ ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
526
+ "use strict";
527
+
528
+ var Range = require("../range").Range;
529
+
530
+ var MatchingBraceOutdent = function() {};
531
+
532
+ (function() {
533
+
534
+ this.checkOutdent = function(line, input) {
535
+ if (! /^\s+$/.test(line))
536
+ return false;
537
+
538
+ return /^\s*\}/.test(input);
539
+ };
540
+
541
+ this.autoOutdent = function(doc, row) {
542
+ var line = doc.getLine(row);
543
+ var match = line.match(/^(\s*\})/);
544
+
545
+ if (!match) return 0;
546
+
547
+ var column = match[1].length;
548
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
549
+
550
+ if (!openBracePos || openBracePos.row == row) return 0;
551
+
552
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
553
+ doc.replace(new Range(row, 0, row, column-1), indent);
554
+ };
555
+
556
+ this.$getIndent = function(line) {
557
+ return line.match(/^\s*/)[0];
558
+ };
559
+
560
+ }).call(MatchingBraceOutdent.prototype);
561
+
562
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
563
+ });
564
+
565
+ ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
566
+ "use strict";
567
+
568
+ var oop = require("../../lib/oop");
569
+ var Range = require("../../range").Range;
570
+ var BaseFoldMode = require("./fold_mode").FoldMode;
571
+
572
+ var FoldMode = exports.FoldMode = function(commentRegex) {
573
+ if (commentRegex) {
574
+ this.foldingStartMarker = new RegExp(
575
+ this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
576
+ );
577
+ this.foldingStopMarker = new RegExp(
578
+ this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
579
+ );
580
+ }
581
+ };
582
+ oop.inherits(FoldMode, BaseFoldMode);
583
+
584
+ (function() {
585
+
586
+ this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
587
+ this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
588
+ this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
589
+ this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
590
+ this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
591
+ this._getFoldWidgetBase = this.getFoldWidget;
592
+ this.getFoldWidget = function(session, foldStyle, row) {
593
+ var line = session.getLine(row);
594
+
595
+ if (this.singleLineBlockCommentRe.test(line)) {
596
+ if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
597
+ return "";
598
+ }
599
+
600
+ var fw = this._getFoldWidgetBase(session, foldStyle, row);
601
+
602
+ if (!fw && this.startRegionRe.test(line))
603
+ return "start"; // lineCommentRegionStart
604
+
605
+ return fw;
606
+ };
607
+
608
+ this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
609
+ var line = session.getLine(row);
610
+
611
+ if (this.startRegionRe.test(line))
612
+ return this.getCommentRegionBlock(session, line, row);
613
+
614
+ var match = line.match(this.foldingStartMarker);
615
+ if (match) {
616
+ var i = match.index;
617
+
618
+ if (match[1])
619
+ return this.openingBracketBlock(session, match[1], row, i);
620
+
621
+ var range = session.getCommentFoldRange(row, i + match[0].length, 1);
622
+
623
+ if (range && !range.isMultiLine()) {
624
+ if (forceMultiline) {
625
+ range = this.getSectionRange(session, row);
626
+ } else if (foldStyle != "all")
627
+ range = null;
628
+ }
629
+
630
+ return range;
631
+ }
632
+
633
+ if (foldStyle === "markbegin")
634
+ return;
635
+
636
+ var match = line.match(this.foldingStopMarker);
637
+ if (match) {
638
+ var i = match.index + match[0].length;
639
+
640
+ if (match[1])
641
+ return this.closingBracketBlock(session, match[1], row, i);
642
+
643
+ return session.getCommentFoldRange(row, i, -1);
644
+ }
645
+ };
646
+
647
+ this.getSectionRange = function(session, row) {
648
+ var line = session.getLine(row);
649
+ var startIndent = line.search(/\S/);
650
+ var startRow = row;
651
+ var startColumn = line.length;
652
+ row = row + 1;
653
+ var endRow = row;
654
+ var maxRow = session.getLength();
655
+ while (++row < maxRow) {
656
+ line = session.getLine(row);
657
+ var indent = line.search(/\S/);
658
+ if (indent === -1)
659
+ continue;
660
+ if (startIndent > indent)
661
+ break;
662
+ var subRange = this.getFoldWidgetRange(session, "all", row);
663
+
664
+ if (subRange) {
665
+ if (subRange.start.row <= startRow) {
666
+ break;
667
+ } else if (subRange.isMultiLine()) {
668
+ row = subRange.end.row;
669
+ } else if (startIndent == indent) {
670
+ break;
671
+ }
672
+ }
673
+ endRow = row;
674
+ }
675
+
676
+ return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
677
+ };
678
+ this.getCommentRegionBlock = function(session, line, row) {
679
+ var startColumn = line.search(/\s*$/);
680
+ var maxRow = session.getLength();
681
+ var startRow = row;
682
+
683
+ var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
684
+ var depth = 1;
685
+ while (++row < maxRow) {
686
+ line = session.getLine(row);
687
+ var m = re.exec(line);
688
+ if (!m) continue;
689
+ if (m[1]) depth--;
690
+ else depth++;
691
+
692
+ if (!depth) break;
693
+ }
694
+
695
+ var endRow = row;
696
+ if (endRow > startRow) {
697
+ return new Range(startRow, startColumn, endRow, line.length);
698
+ }
699
+ };
700
+
701
+ }).call(FoldMode.prototype);
702
+
703
+ });
704
+
705
+ 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/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) {
706
+ "use strict";
707
+
708
+ var oop = require("../lib/oop");
709
+ var TextMode = require("./text").Mode;
710
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
711
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
712
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
713
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
714
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
715
+
716
+ var Mode = function() {
717
+ this.HighlightRules = JavaScriptHighlightRules;
718
+
719
+ this.$outdent = new MatchingBraceOutdent();
720
+ this.$behaviour = new CstyleBehaviour();
721
+ this.foldingRules = new CStyleFoldMode();
722
+ };
723
+ oop.inherits(Mode, TextMode);
724
+
725
+ (function() {
726
+
727
+ this.lineCommentStart = "//";
728
+ this.blockComment = {start: "/*", end: "*/"};
729
+ this.$quotes = {'"': '"', "'": "'", "`": "`"};
730
+
731
+ this.getNextLineIndent = function(state, line, tab) {
732
+ var indent = this.$getIndent(line);
733
+
734
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
735
+ var tokens = tokenizedLine.tokens;
736
+ var endState = tokenizedLine.state;
737
+
738
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
739
+ return indent;
740
+ }
741
+
742
+ if (state == "start" || state == "no_regex") {
743
+ var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
744
+ if (match) {
745
+ indent += tab;
746
+ }
747
+ } else if (state == "doc-start") {
748
+ if (endState == "start" || endState == "no_regex") {
749
+ return "";
750
+ }
751
+ var match = line.match(/^\s*(\/?)\*/);
752
+ if (match) {
753
+ if (match[1]) {
754
+ indent += " ";
755
+ }
756
+ indent += "* ";
757
+ }
758
+ }
759
+
760
+ return indent;
761
+ };
762
+
763
+ this.checkOutdent = function(state, line, input) {
764
+ return this.$outdent.checkOutdent(line, input);
765
+ };
766
+
767
+ this.autoOutdent = function(state, doc, row) {
768
+ this.$outdent.autoOutdent(doc, row);
769
+ };
770
+
771
+ this.createWorker = function(session) {
772
+ var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
773
+ worker.attachToDocument(session.getDocument());
774
+
775
+ worker.on("annotate", function(results) {
776
+ session.setAnnotations(results.data);
777
+ });
778
+
779
+ worker.on("terminate", function() {
780
+ session.clearAnnotations();
781
+ });
782
+
783
+ return worker;
784
+ };
785
+
786
+ this.$id = "ace/mode/javascript";
787
+ this.snippetFileId = "ace/snippets/javascript";
788
+ }).call(Mode.prototype);
789
+
790
+ exports.Mode = Mode;
791
+ });
792
+
793
+ ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
794
+ "use strict";
795
+
796
+ var oop = require("../lib/oop");
797
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
798
+
799
+ var XmlHighlightRules = function(normalize) {
800
+ var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
801
+
802
+ this.$rules = {
803
+ start : [
804
+ {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
805
+ {
806
+ token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
807
+ regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction"
808
+ },
809
+ {token : "comment.start.xml", regex : "<\\!--", next : "comment"},
810
+ {
811
+ token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
812
+ regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
813
+ },
814
+ {include : "tag"},
815
+ {token : "text.end-tag-open.xml", regex: "</"},
816
+ {token : "text.tag-open.xml", regex: "<"},
817
+ {include : "reference"},
818
+ {defaultToken : "text.xml"}
819
+ ],
820
+
821
+ processing_instruction : [{
822
+ token : "entity.other.attribute-name.decl-attribute-name.xml",
823
+ regex : tagRegex
824
+ }, {
825
+ token : "keyword.operator.decl-attribute-equals.xml",
826
+ regex : "="
827
+ }, {
828
+ include: "whitespace"
829
+ }, {
830
+ include: "string"
831
+ }, {
832
+ token : "punctuation.xml-decl.xml",
833
+ regex : "\\?>",
834
+ next : "start"
835
+ }],
836
+
837
+ doctype : [
838
+ {include : "whitespace"},
839
+ {include : "string"},
840
+ {token : "xml-pe.doctype.xml", regex : ">", next : "start"},
841
+ {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
842
+ {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
843
+ ],
844
+
845
+ int_subset : [{
846
+ token : "text.xml",
847
+ regex : "\\s+"
848
+ }, {
849
+ token: "punctuation.int-subset.xml",
850
+ regex: "]",
851
+ next: "pop"
852
+ }, {
853
+ token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
854
+ regex : "(<\\!)(" + tagRegex + ")",
855
+ push : [{
856
+ token : "text",
857
+ regex : "\\s+"
858
+ },
859
+ {
860
+ token : "punctuation.markup-decl.xml",
861
+ regex : ">",
862
+ next : "pop"
863
+ },
864
+ {include : "string"}]
865
+ }],
866
+
867
+ cdata : [
868
+ {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
869
+ {token : "text.xml", regex : "\\s+"},
870
+ {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
871
+ ],
872
+
873
+ comment : [
874
+ {token : "comment.end.xml", regex : "-->", next : "start"},
875
+ {defaultToken : "comment.xml"}
876
+ ],
877
+
878
+ reference : [{
879
+ token : "constant.language.escape.reference.xml",
880
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
881
+ }],
882
+
883
+ attr_reference : [{
884
+ token : "constant.language.escape.reference.attribute-value.xml",
885
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
886
+ }],
887
+
888
+ tag : [{
889
+ token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
890
+ regex : "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
891
+ next: [
892
+ {include : "attributes"},
893
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
894
+ ]
895
+ }],
896
+
897
+ tag_whitespace : [
898
+ {token : "text.tag-whitespace.xml", regex : "\\s+"}
899
+ ],
900
+ whitespace : [
901
+ {token : "text.whitespace.xml", regex : "\\s+"}
902
+ ],
903
+ string: [{
904
+ token : "string.xml",
905
+ regex : "'",
906
+ push : [
907
+ {token : "string.xml", regex: "'", next: "pop"},
908
+ {defaultToken : "string.xml"}
909
+ ]
910
+ }, {
911
+ token : "string.xml",
912
+ regex : '"',
913
+ push : [
914
+ {token : "string.xml", regex: '"', next: "pop"},
915
+ {defaultToken : "string.xml"}
916
+ ]
917
+ }],
918
+
919
+ attributes: [{
920
+ token : "entity.other.attribute-name.xml",
921
+ regex : tagRegex
922
+ }, {
923
+ token : "keyword.operator.attribute-equals.xml",
924
+ regex : "="
925
+ }, {
926
+ include: "tag_whitespace"
927
+ }, {
928
+ include: "attribute_value"
929
+ }],
930
+
931
+ attribute_value: [{
932
+ token : "string.attribute-value.xml",
933
+ regex : "'",
934
+ push : [
935
+ {token : "string.attribute-value.xml", regex: "'", next: "pop"},
936
+ {include : "attr_reference"},
937
+ {defaultToken : "string.attribute-value.xml"}
938
+ ]
939
+ }, {
940
+ token : "string.attribute-value.xml",
941
+ regex : '"',
942
+ push : [
943
+ {token : "string.attribute-value.xml", regex: '"', next: "pop"},
944
+ {include : "attr_reference"},
945
+ {defaultToken : "string.attribute-value.xml"}
946
+ ]
947
+ }]
948
+ };
949
+
950
+ if (this.constructor === XmlHighlightRules)
951
+ this.normalizeRules();
952
+ };
953
+
954
+
955
+ (function() {
956
+
957
+ this.embedTagRules = function(HighlightRules, prefix, tag){
958
+ this.$rules.tag.unshift({
959
+ token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
960
+ regex : "(<)(" + tag + "(?=\\s|>|$))",
961
+ next: [
962
+ {include : "attributes"},
963
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
964
+ ]
965
+ });
966
+
967
+ this.$rules[tag + "-end"] = [
968
+ {include : "attributes"},
969
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
970
+ onMatch : function(value, currentState, stack) {
971
+ stack.splice(0);
972
+ return this.token;
973
+ }}
974
+ ];
975
+
976
+ this.embedRules(HighlightRules, prefix, [{
977
+ token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
978
+ regex : "(</)(" + tag + "(?=\\s|>|$))",
979
+ next: tag + "-end"
980
+ }, {
981
+ token: "string.cdata.xml",
982
+ regex : "<\\!\\[CDATA\\["
983
+ }, {
984
+ token: "string.cdata.xml",
985
+ regex : "\\]\\]>"
986
+ }]);
987
+ };
988
+
989
+ }).call(TextHighlightRules.prototype);
990
+
991
+ oop.inherits(XmlHighlightRules, TextHighlightRules);
992
+
993
+ exports.XmlHighlightRules = XmlHighlightRules;
994
+ });
995
+
996
+ ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
997
+ "use strict";
998
+
999
+ var oop = require("../../lib/oop");
1000
+ var Behaviour = require("../behaviour").Behaviour;
1001
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1002
+ var lang = require("../../lib/lang");
1003
+
1004
+ function is(token, type) {
1005
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
1006
+ }
1007
+
1008
+ var XmlBehaviour = function () {
1009
+
1010
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
1011
+ if (text == '"' || text == "'") {
1012
+ var quote = text;
1013
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
1014
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
1015
+ return {
1016
+ text: quote + selected + quote,
1017
+ selection: false
1018
+ };
1019
+ }
1020
+
1021
+ var cursor = editor.getCursorPosition();
1022
+ var line = session.doc.getLine(cursor.row);
1023
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
1024
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
1025
+ var token = iterator.getCurrentToken();
1026
+
1027
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
1028
+ return {
1029
+ text: "",
1030
+ selection: [1, 1]
1031
+ };
1032
+ }
1033
+
1034
+ if (!token)
1035
+ token = iterator.stepBackward();
1036
+
1037
+ if (!token)
1038
+ return;
1039
+
1040
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
1041
+ token = iterator.stepBackward();
1042
+ }
1043
+ var rightSpace = !rightChar || rightChar.match(/\s/);
1044
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
1045
+ return {
1046
+ text: quote + quote,
1047
+ selection: [1, 1]
1048
+ };
1049
+ }
1050
+ }
1051
+ });
1052
+
1053
+ this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
1054
+ var selected = session.doc.getTextRange(range);
1055
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
1056
+ var line = session.doc.getLine(range.start.row);
1057
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1058
+ if (rightChar == selected) {
1059
+ range.end.column++;
1060
+ return range;
1061
+ }
1062
+ }
1063
+ });
1064
+
1065
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
1066
+ if (text == '>') {
1067
+ var position = editor.getSelectionRange().start;
1068
+ var iterator = new TokenIterator(session, position.row, position.column);
1069
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
1070
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
1071
+ return;
1072
+ if (is(token, "reference.attribute-value"))
1073
+ return;
1074
+ if (is(token, "attribute-value")) {
1075
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
1076
+ if (position.column < tokenEndColumn)
1077
+ return;
1078
+ if (position.column == tokenEndColumn) {
1079
+ var nextToken = iterator.stepForward();
1080
+ if (nextToken && is(nextToken, "attribute-value"))
1081
+ return;
1082
+ iterator.stepBackward();
1083
+ }
1084
+ }
1085
+
1086
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
1087
+ return;
1088
+ while (!is(token, "tag-name")) {
1089
+ token = iterator.stepBackward();
1090
+ if (token.value == "<") {
1091
+ token = iterator.stepForward();
1092
+ break;
1093
+ }
1094
+ }
1095
+
1096
+ var tokenRow = iterator.getCurrentTokenRow();
1097
+ var tokenColumn = iterator.getCurrentTokenColumn();
1098
+ if (is(iterator.stepBackward(), "end-tag-open"))
1099
+ return;
1100
+
1101
+ var element = token.value;
1102
+ if (tokenRow == position.row)
1103
+ element = element.substring(0, position.column - tokenColumn);
1104
+
1105
+ if (this.voidElements.hasOwnProperty(element.toLowerCase()))
1106
+ return;
1107
+
1108
+ return {
1109
+ text: ">" + "</" + element + ">",
1110
+ selection: [1, 1]
1111
+ };
1112
+ }
1113
+ });
1114
+
1115
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
1116
+ if (text == "\n") {
1117
+ var cursor = editor.getCursorPosition();
1118
+ var line = session.getLine(cursor.row);
1119
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
1120
+ var token = iterator.getCurrentToken();
1121
+
1122
+ if (token && token.type.indexOf("tag-close") !== -1) {
1123
+ if (token.value == "/>")
1124
+ return;
1125
+ while (token && token.type.indexOf("tag-name") === -1) {
1126
+ token = iterator.stepBackward();
1127
+ }
1128
+
1129
+ if (!token) {
1130
+ return;
1131
+ }
1132
+
1133
+ var tag = token.value;
1134
+ var row = iterator.getCurrentTokenRow();
1135
+ token = iterator.stepBackward();
1136
+ if (!token || token.type.indexOf("end-tag") !== -1) {
1137
+ return;
1138
+ }
1139
+
1140
+ if (this.voidElements && !this.voidElements[tag]) {
1141
+ var nextToken = session.getTokenAt(cursor.row, cursor.column+1);
1142
+ var line = session.getLine(row);
1143
+ var nextIndent = this.$getIndent(line);
1144
+ var indent = nextIndent + session.getTabString();
1145
+
1146
+ if (nextToken && nextToken.value === "</") {
1147
+ return {
1148
+ text: "\n" + indent + "\n" + nextIndent,
1149
+ selection: [1, indent.length, 1, indent.length]
1150
+ };
1151
+ } else {
1152
+ return {
1153
+ text: "\n" + indent
1154
+ };
1155
+ }
1156
+ }
1157
+ }
1158
+ }
1159
+ });
1160
+
1161
+ };
1162
+
1163
+ oop.inherits(XmlBehaviour, Behaviour);
1164
+
1165
+ exports.XmlBehaviour = XmlBehaviour;
1166
+ });
1167
+
1168
+ ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/range","ace/mode/folding/fold_mode","ace/token_iterator"], function(require, exports, module) {
1169
+ "use strict";
1170
+
1171
+ var oop = require("../../lib/oop");
1172
+ var lang = require("../../lib/lang");
1173
+ var Range = require("../../range").Range;
1174
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1175
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1176
+
1177
+ var FoldMode = exports.FoldMode = function(voidElements, optionalEndTags) {
1178
+ BaseFoldMode.call(this);
1179
+ this.voidElements = voidElements || {};
1180
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
1181
+ if (optionalEndTags)
1182
+ oop.mixin(this.optionalEndTags, optionalEndTags);
1183
+
1184
+ };
1185
+ oop.inherits(FoldMode, BaseFoldMode);
1186
+
1187
+ var Tag = function() {
1188
+ this.tagName = "";
1189
+ this.closing = false;
1190
+ this.selfClosing = false;
1191
+ this.start = {row: 0, column: 0};
1192
+ this.end = {row: 0, column: 0};
1193
+ };
1194
+
1195
+ function is(token, type) {
1196
+ return token.type.lastIndexOf(type + ".xml") > -1;
1197
+ }
1198
+
1199
+ (function() {
1200
+
1201
+ this.getFoldWidget = function(session, foldStyle, row) {
1202
+ var tag = this._getFirstTagInLine(session, row);
1203
+
1204
+ if (!tag)
1205
+ return this.getCommentFoldWidget(session, row);
1206
+
1207
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
1208
+ return foldStyle == "markbeginend" ? "end" : "";
1209
+
1210
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
1211
+ return "";
1212
+
1213
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
1214
+ return "";
1215
+
1216
+ return "start";
1217
+ };
1218
+
1219
+ this.getCommentFoldWidget = function(session, row) {
1220
+ if (/comment/.test(session.getState(row)) && /<!-/.test(session.getLine(row)))
1221
+ return "start";
1222
+ return "";
1223
+ };
1224
+ this._getFirstTagInLine = function(session, row) {
1225
+ var tokens = session.getTokens(row);
1226
+ var tag = new Tag();
1227
+
1228
+ for (var i = 0; i < tokens.length; i++) {
1229
+ var token = tokens[i];
1230
+ if (is(token, "tag-open")) {
1231
+ tag.end.column = tag.start.column + token.value.length;
1232
+ tag.closing = is(token, "end-tag-open");
1233
+ token = tokens[++i];
1234
+ if (!token)
1235
+ return null;
1236
+ tag.tagName = token.value;
1237
+ tag.end.column += token.value.length;
1238
+ for (i++; i < tokens.length; i++) {
1239
+ token = tokens[i];
1240
+ tag.end.column += token.value.length;
1241
+ if (is(token, "tag-close")) {
1242
+ tag.selfClosing = token.value == '/>';
1243
+ break;
1244
+ }
1245
+ }
1246
+ return tag;
1247
+ } else if (is(token, "tag-close")) {
1248
+ tag.selfClosing = token.value == '/>';
1249
+ return tag;
1250
+ }
1251
+ tag.start.column += token.value.length;
1252
+ }
1253
+
1254
+ return null;
1255
+ };
1256
+
1257
+ this._findEndTagInLine = function(session, row, tagName, startColumn) {
1258
+ var tokens = session.getTokens(row);
1259
+ var column = 0;
1260
+ for (var i = 0; i < tokens.length; i++) {
1261
+ var token = tokens[i];
1262
+ column += token.value.length;
1263
+ if (column < startColumn)
1264
+ continue;
1265
+ if (is(token, "end-tag-open")) {
1266
+ token = tokens[i + 1];
1267
+ if (token && token.value == tagName)
1268
+ return true;
1269
+ }
1270
+ }
1271
+ return false;
1272
+ };
1273
+ this._readTagForward = function(iterator) {
1274
+ var token = iterator.getCurrentToken();
1275
+ if (!token)
1276
+ return null;
1277
+
1278
+ var tag = new Tag();
1279
+ do {
1280
+ if (is(token, "tag-open")) {
1281
+ tag.closing = is(token, "end-tag-open");
1282
+ tag.start.row = iterator.getCurrentTokenRow();
1283
+ tag.start.column = iterator.getCurrentTokenColumn();
1284
+ } else if (is(token, "tag-name")) {
1285
+ tag.tagName = token.value;
1286
+ } else if (is(token, "tag-close")) {
1287
+ tag.selfClosing = token.value == "/>";
1288
+ tag.end.row = iterator.getCurrentTokenRow();
1289
+ tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
1290
+ iterator.stepForward();
1291
+ return tag;
1292
+ }
1293
+ } while(token = iterator.stepForward());
1294
+
1295
+ return null;
1296
+ };
1297
+
1298
+ this._readTagBackward = function(iterator) {
1299
+ var token = iterator.getCurrentToken();
1300
+ if (!token)
1301
+ return null;
1302
+
1303
+ var tag = new Tag();
1304
+ do {
1305
+ if (is(token, "tag-open")) {
1306
+ tag.closing = is(token, "end-tag-open");
1307
+ tag.start.row = iterator.getCurrentTokenRow();
1308
+ tag.start.column = iterator.getCurrentTokenColumn();
1309
+ iterator.stepBackward();
1310
+ return tag;
1311
+ } else if (is(token, "tag-name")) {
1312
+ tag.tagName = token.value;
1313
+ } else if (is(token, "tag-close")) {
1314
+ tag.selfClosing = token.value == "/>";
1315
+ tag.end.row = iterator.getCurrentTokenRow();
1316
+ tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
1317
+ }
1318
+ } while(token = iterator.stepBackward());
1319
+
1320
+ return null;
1321
+ };
1322
+
1323
+ this._pop = function(stack, tag) {
1324
+ while (stack.length) {
1325
+
1326
+ var top = stack[stack.length-1];
1327
+ if (!tag || top.tagName == tag.tagName) {
1328
+ return stack.pop();
1329
+ }
1330
+ else if (this.optionalEndTags.hasOwnProperty(top.tagName)) {
1331
+ stack.pop();
1332
+ continue;
1333
+ } else {
1334
+ return null;
1335
+ }
1336
+ }
1337
+ };
1338
+
1339
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1340
+ var firstTag = this._getFirstTagInLine(session, row);
1341
+
1342
+ if (!firstTag) {
1343
+ return this.getCommentFoldWidget(session, row)
1344
+ && session.getCommentFoldRange(row, session.getLine(row).length);
1345
+ }
1346
+
1347
+ var isBackward = firstTag.closing || firstTag.selfClosing;
1348
+ var stack = [];
1349
+ var tag;
1350
+
1351
+ if (!isBackward) {
1352
+ var iterator = new TokenIterator(session, row, firstTag.start.column);
1353
+ var start = {
1354
+ row: row,
1355
+ column: firstTag.start.column + firstTag.tagName.length + 2
1356
+ };
1357
+ if (firstTag.start.row == firstTag.end.row)
1358
+ start.column = firstTag.end.column;
1359
+ while (tag = this._readTagForward(iterator)) {
1360
+ if (tag.selfClosing) {
1361
+ if (!stack.length) {
1362
+ tag.start.column += tag.tagName.length + 2;
1363
+ tag.end.column -= 2;
1364
+ return Range.fromPoints(tag.start, tag.end);
1365
+ } else
1366
+ continue;
1367
+ }
1368
+
1369
+ if (tag.closing) {
1370
+ this._pop(stack, tag);
1371
+ if (stack.length == 0)
1372
+ return Range.fromPoints(start, tag.start);
1373
+ }
1374
+ else {
1375
+ stack.push(tag);
1376
+ }
1377
+ }
1378
+ }
1379
+ else {
1380
+ var iterator = new TokenIterator(session, row, firstTag.end.column);
1381
+ var end = {
1382
+ row: row,
1383
+ column: firstTag.start.column
1384
+ };
1385
+
1386
+ while (tag = this._readTagBackward(iterator)) {
1387
+ if (tag.selfClosing) {
1388
+ if (!stack.length) {
1389
+ tag.start.column += tag.tagName.length + 2;
1390
+ tag.end.column -= 2;
1391
+ return Range.fromPoints(tag.start, tag.end);
1392
+ } else
1393
+ continue;
1394
+ }
1395
+
1396
+ if (!tag.closing) {
1397
+ this._pop(stack, tag);
1398
+ if (stack.length == 0) {
1399
+ tag.start.column += tag.tagName.length + 2;
1400
+ if (tag.start.row == tag.end.row && tag.start.column < tag.end.column)
1401
+ tag.start.column = tag.end.column;
1402
+ return Range.fromPoints(tag.start, end);
1403
+ }
1404
+ }
1405
+ else {
1406
+ stack.push(tag);
1407
+ }
1408
+ }
1409
+ }
1410
+
1411
+ };
1412
+
1413
+ }).call(FoldMode.prototype);
1414
+
1415
+ });
1416
+
1417
+ 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) {
1418
+ "use strict";
1419
+
1420
+ var oop = require("../lib/oop");
1421
+ var lang = require("../lib/lang");
1422
+ var TextMode = require("./text").Mode;
1423
+ var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
1424
+ var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
1425
+ var XmlFoldMode = require("./folding/xml").FoldMode;
1426
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
1427
+
1428
+ var Mode = function() {
1429
+ this.HighlightRules = XmlHighlightRules;
1430
+ this.$behaviour = new XmlBehaviour();
1431
+ this.foldingRules = new XmlFoldMode();
1432
+ };
1433
+
1434
+ oop.inherits(Mode, TextMode);
1435
+
1436
+ (function() {
1437
+
1438
+ this.voidElements = lang.arrayToMap([]);
1439
+
1440
+ this.blockComment = {start: "<!--", end: "-->"};
1441
+
1442
+ this.createWorker = function(session) {
1443
+ var worker = new WorkerClient(["ace"], "ace/mode/xml_worker", "Worker");
1444
+ worker.attachToDocument(session.getDocument());
1445
+
1446
+ worker.on("error", function(e) {
1447
+ session.setAnnotations(e.data);
1448
+ });
1449
+
1450
+ worker.on("terminate", function() {
1451
+ session.clearAnnotations();
1452
+ });
1453
+
1454
+ return worker;
1455
+ };
1456
+
1457
+ this.$id = "ace/mode/xml";
1458
+ }).call(Mode.prototype);
1459
+
1460
+ exports.Mode = Mode;
1461
+ });
1462
+
1463
+ 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) {
1464
+ "use strict";
1465
+
1466
+ var oop = require("../lib/oop");
1467
+ var lang = require("../lib/lang");
1468
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1469
+ 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";
1470
+ var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
1471
+ 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|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";
1472
+ 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";
1473
+ 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";
1474
+
1475
+ var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))";
1476
+ var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
1477
+ 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";
1478
+
1479
+ var CssHighlightRules = function() {
1480
+
1481
+ var keywordMapper = this.createKeywordMapper({
1482
+ "support.function": supportFunction,
1483
+ "support.constant": supportConstant,
1484
+ "support.type": supportType,
1485
+ "support.constant.color": supportConstantColor,
1486
+ "support.constant.fonts": supportConstantFonts
1487
+ }, "text", true);
1488
+
1489
+ this.$rules = {
1490
+ "start" : [{
1491
+ include : ["strings", "url", "comments"]
1492
+ }, {
1493
+ token: "paren.lparen",
1494
+ regex: "\\{",
1495
+ next: "ruleset"
1496
+ }, {
1497
+ token: "paren.rparen",
1498
+ regex: "\\}"
1499
+ }, {
1500
+ token: "string",
1501
+ regex: "@(?!viewport)",
1502
+ next: "media"
1503
+ }, {
1504
+ token: "keyword",
1505
+ regex: "#[a-z0-9-_]+"
1506
+ }, {
1507
+ token: "keyword",
1508
+ regex: "%"
1509
+ }, {
1510
+ token: "variable",
1511
+ regex: "\\.[a-z0-9-_]+"
1512
+ }, {
1513
+ token: "string",
1514
+ regex: ":[a-z0-9-_]+"
1515
+ }, {
1516
+ token : "constant.numeric",
1517
+ regex : numRe
1518
+ }, {
1519
+ token: "constant",
1520
+ regex: "[a-z0-9-_]+"
1521
+ }, {
1522
+ caseInsensitive: true
1523
+ }],
1524
+
1525
+ "media": [{
1526
+ include : ["strings", "url", "comments"]
1527
+ }, {
1528
+ token: "paren.lparen",
1529
+ regex: "\\{",
1530
+ next: "start"
1531
+ }, {
1532
+ token: "paren.rparen",
1533
+ regex: "\\}",
1534
+ next: "start"
1535
+ }, {
1536
+ token: "string",
1537
+ regex: ";",
1538
+ next: "start"
1539
+ }, {
1540
+ token: "keyword",
1541
+ regex: "(?:media|supports|document|charset|import|namespace|media|supports|document"
1542
+ + "|page|font|keyframes|viewport|counter-style|font-feature-values"
1543
+ + "|swash|ornaments|annotation|stylistic|styleset|character-variant)"
1544
+ }],
1545
+
1546
+ "comments" : [{
1547
+ token: "comment", // multi line comment
1548
+ regex: "\\/\\*",
1549
+ push: [{
1550
+ token : "comment",
1551
+ regex : "\\*\\/",
1552
+ next : "pop"
1553
+ }, {
1554
+ defaultToken : "comment"
1555
+ }]
1556
+ }],
1557
+
1558
+ "ruleset" : [{
1559
+ regex : "-(webkit|ms|moz|o)-",
1560
+ token : "text"
1561
+ }, {
1562
+ token : "punctuation.operator",
1563
+ regex : "[:;]"
1564
+ }, {
1565
+ token : "paren.rparen",
1566
+ regex : "\\}",
1567
+ next : "start"
1568
+ }, {
1569
+ include : ["strings", "url", "comments"]
1570
+ }, {
1571
+ token : ["constant.numeric", "keyword"],
1572
+ 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|%)"
1573
+ }, {
1574
+ token : "constant.numeric",
1575
+ regex : numRe
1576
+ }, {
1577
+ token : "constant.numeric", // hex6 color
1578
+ regex : "#[a-f0-9]{6}"
1579
+ }, {
1580
+ token : "constant.numeric", // hex3 color
1581
+ regex : "#[a-f0-9]{3}"
1582
+ }, {
1583
+ token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
1584
+ regex : pseudoElements
1585
+ }, {
1586
+ token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
1587
+ regex : pseudoClasses
1588
+ }, {
1589
+ include: "url"
1590
+ }, {
1591
+ token : keywordMapper,
1592
+ regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
1593
+ }, {
1594
+ caseInsensitive: true
1595
+ }],
1596
+
1597
+ url: [{
1598
+ token : "support.function",
1599
+ regex : "(?:url(:?-prefix)?|domain|regexp)\\(",
1600
+ push: [{
1601
+ token : "support.function",
1602
+ regex : "\\)",
1603
+ next : "pop"
1604
+ }, {
1605
+ defaultToken: "string"
1606
+ }]
1607
+ }],
1608
+
1609
+ strings: [{
1610
+ token : "string.start",
1611
+ regex : "'",
1612
+ push : [{
1613
+ token : "string.end",
1614
+ regex : "'|$",
1615
+ next: "pop"
1616
+ }, {
1617
+ include : "escapes"
1618
+ }, {
1619
+ token : "constant.language.escape",
1620
+ regex : /\\$/,
1621
+ consumeLineEnd: true
1622
+ }, {
1623
+ defaultToken: "string"
1624
+ }]
1625
+ }, {
1626
+ token : "string.start",
1627
+ regex : '"',
1628
+ push : [{
1629
+ token : "string.end",
1630
+ regex : '"|$',
1631
+ next: "pop"
1632
+ }, {
1633
+ include : "escapes"
1634
+ }, {
1635
+ token : "constant.language.escape",
1636
+ regex : /\\$/,
1637
+ consumeLineEnd: true
1638
+ }, {
1639
+ defaultToken: "string"
1640
+ }]
1641
+ }],
1642
+ escapes: [{
1643
+ token : "constant.language.escape",
1644
+ regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
1645
+ }]
1646
+
1647
+ };
1648
+
1649
+ this.normalizeRules();
1650
+ };
1651
+
1652
+ oop.inherits(CssHighlightRules, TextHighlightRules);
1653
+
1654
+ exports.CssHighlightRules = CssHighlightRules;
1655
+
1656
+ });
1657
+
1658
+ ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) {
1659
+ "use strict";
1660
+
1661
+ var propertyMap = {
1662
+ "background": {"#$0": 1},
1663
+ "background-color": {"#$0": 1, "transparent": 1, "fixed": 1},
1664
+ "background-image": {"url('/$0')": 1},
1665
+ "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1},
1666
+ "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2},
1667
+ "background-attachment": {"scroll": 1, "fixed": 1},
1668
+ "background-size": {"cover": 1, "contain": 1},
1669
+ "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1},
1670
+ "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1},
1671
+ "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1},
1672
+ "border-color": {"#$0": 1},
1673
+ "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2},
1674
+ "border-collapse": {"collapse": 1, "separate": 1},
1675
+ "bottom": {"px": 1, "em": 1, "%": 1},
1676
+ "clear": {"left": 1, "right": 1, "both": 1, "none": 1},
1677
+ "color": {"#$0": 1, "rgb(#$00,0,0)": 1},
1678
+ "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},
1679
+ "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1},
1680
+ "empty-cells": {"show": 1, "hide": 1},
1681
+ "float": {"left": 1, "right": 1, "none": 1},
1682
+ "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},
1683
+ "font-size": {"px": 1, "em": 1, "%": 1},
1684
+ "font-weight": {"bold": 1, "normal": 1},
1685
+ "font-style": {"italic": 1, "normal": 1},
1686
+ "font-variant": {"normal": 1, "small-caps": 1},
1687
+ "height": {"px": 1, "em": 1, "%": 1},
1688
+ "left": {"px": 1, "em": 1, "%": 1},
1689
+ "letter-spacing": {"normal": 1},
1690
+ "line-height": {"normal": 1},
1691
+ "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},
1692
+ "margin": {"px": 1, "em": 1, "%": 1},
1693
+ "margin-right": {"px": 1, "em": 1, "%": 1},
1694
+ "margin-left": {"px": 1, "em": 1, "%": 1},
1695
+ "margin-top": {"px": 1, "em": 1, "%": 1},
1696
+ "margin-bottom": {"px": 1, "em": 1, "%": 1},
1697
+ "max-height": {"px": 1, "em": 1, "%": 1},
1698
+ "max-width": {"px": 1, "em": 1, "%": 1},
1699
+ "min-height": {"px": 1, "em": 1, "%": 1},
1700
+ "min-width": {"px": 1, "em": 1, "%": 1},
1701
+ "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
1702
+ "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
1703
+ "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
1704
+ "padding": {"px": 1, "em": 1, "%": 1},
1705
+ "padding-top": {"px": 1, "em": 1, "%": 1},
1706
+ "padding-right": {"px": 1, "em": 1, "%": 1},
1707
+ "padding-bottom": {"px": 1, "em": 1, "%": 1},
1708
+ "padding-left": {"px": 1, "em": 1, "%": 1},
1709
+ "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
1710
+ "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
1711
+ "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1},
1712
+ "right": {"px": 1, "em": 1, "%": 1},
1713
+ "table-layout": {"fixed": 1, "auto": 1},
1714
+ "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1},
1715
+ "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1},
1716
+ "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1},
1717
+ "top": {"px": 1, "em": 1, "%": 1},
1718
+ "vertical-align": {"top": 1, "bottom": 1},
1719
+ "visibility": {"hidden": 1, "visible": 1},
1720
+ "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1},
1721
+ "width": {"px": 1, "em": 1, "%": 1},
1722
+ "word-spacing": {"normal": 1},
1723
+ "filter": {"alpha(opacity=$0100)": 1},
1724
+
1725
+ "text-shadow": {"$02px 2px 2px #777": 1},
1726
+ "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1},
1727
+ "-moz-border-radius": 1,
1728
+ "-moz-border-radius-topright": 1,
1729
+ "-moz-border-radius-bottomright": 1,
1730
+ "-moz-border-radius-topleft": 1,
1731
+ "-moz-border-radius-bottomleft": 1,
1732
+ "-webkit-border-radius": 1,
1733
+ "-webkit-border-top-right-radius": 1,
1734
+ "-webkit-border-top-left-radius": 1,
1735
+ "-webkit-border-bottom-right-radius": 1,
1736
+ "-webkit-border-bottom-left-radius": 1,
1737
+ "-moz-box-shadow": 1,
1738
+ "-webkit-box-shadow": 1,
1739
+ "transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
1740
+ "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
1741
+ "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 }
1742
+ };
1743
+
1744
+ var CssCompletions = function() {
1745
+
1746
+ };
1747
+
1748
+ (function() {
1749
+
1750
+ this.completionsDefined = false;
1751
+
1752
+ this.defineCompletions = function() {
1753
+ if (document) {
1754
+ var style = document.createElement('c').style;
1755
+
1756
+ for (var i in style) {
1757
+ if (typeof style[i] !== 'string')
1758
+ continue;
1759
+
1760
+ var name = i.replace(/[A-Z]/g, function(x) {
1761
+ return '-' + x.toLowerCase();
1762
+ });
1763
+
1764
+ if (!propertyMap.hasOwnProperty(name))
1765
+ propertyMap[name] = 1;
1766
+ }
1767
+ }
1768
+
1769
+ this.completionsDefined = true;
1770
+ };
1771
+
1772
+ this.getCompletions = function(state, session, pos, prefix) {
1773
+ if (!this.completionsDefined) {
1774
+ this.defineCompletions();
1775
+ }
1776
+
1777
+ if (state==='ruleset' || session.$mode.$id == "ace/mode/scss") {
1778
+ var line = session.getLine(pos.row).substr(0, pos.column);
1779
+ if (/:[^;]+$/.test(line)) {
1780
+ /([\w\-]+):[^:]*$/.test(line);
1781
+
1782
+ return this.getPropertyValueCompletions(state, session, pos, prefix);
1783
+ } else {
1784
+ return this.getPropertyCompletions(state, session, pos, prefix);
1785
+ }
1786
+ }
1787
+
1788
+ return [];
1789
+ };
1790
+
1791
+ this.getPropertyCompletions = function(state, session, pos, prefix) {
1792
+ var properties = Object.keys(propertyMap);
1793
+ return properties.map(function(property){
1794
+ return {
1795
+ caption: property,
1796
+ snippet: property + ': $0;',
1797
+ meta: "property",
1798
+ score: 1000000
1799
+ };
1800
+ });
1801
+ };
1802
+
1803
+ this.getPropertyValueCompletions = function(state, session, pos, prefix) {
1804
+ var line = session.getLine(pos.row).substr(0, pos.column);
1805
+ var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
1806
+
1807
+ if (!property)
1808
+ return [];
1809
+ var values = [];
1810
+ if (property in propertyMap && typeof propertyMap[property] === "object") {
1811
+ values = Object.keys(propertyMap[property]);
1812
+ }
1813
+ return values.map(function(value){
1814
+ return {
1815
+ caption: value,
1816
+ snippet: value,
1817
+ meta: "property value",
1818
+ score: 1000000
1819
+ };
1820
+ });
1821
+ };
1822
+
1823
+ }).call(CssCompletions.prototype);
1824
+
1825
+ exports.CssCompletions = CssCompletions;
1826
+ });
1827
+
1828
+ 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) {
1829
+ "use strict";
1830
+
1831
+ var oop = require("../../lib/oop");
1832
+ var Behaviour = require("../behaviour").Behaviour;
1833
+ var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
1834
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1835
+
1836
+ var CssBehaviour = function () {
1837
+
1838
+ this.inherit(CstyleBehaviour);
1839
+
1840
+ this.add("colon", "insertion", function (state, action, editor, session, text) {
1841
+ if (text === ':' && editor.selection.isEmpty()) {
1842
+ var cursor = editor.getCursorPosition();
1843
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
1844
+ var token = iterator.getCurrentToken();
1845
+ if (token && token.value.match(/\s+/)) {
1846
+ token = iterator.stepBackward();
1847
+ }
1848
+ if (token && token.type === 'support.type') {
1849
+ var line = session.doc.getLine(cursor.row);
1850
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
1851
+ if (rightChar === ':') {
1852
+ return {
1853
+ text: '',
1854
+ selection: [1, 1]
1855
+ };
1856
+ }
1857
+ if (/^(\s+[^;]|\s*$)/.test(line.substring(cursor.column))) {
1858
+ return {
1859
+ text: ':;',
1860
+ selection: [1, 1]
1861
+ };
1862
+ }
1863
+ }
1864
+ }
1865
+ });
1866
+
1867
+ this.add("colon", "deletion", function (state, action, editor, session, range) {
1868
+ var selected = session.doc.getTextRange(range);
1869
+ if (!range.isMultiLine() && selected === ':') {
1870
+ var cursor = editor.getCursorPosition();
1871
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
1872
+ var token = iterator.getCurrentToken();
1873
+ if (token && token.value.match(/\s+/)) {
1874
+ token = iterator.stepBackward();
1875
+ }
1876
+ if (token && token.type === 'support.type') {
1877
+ var line = session.doc.getLine(range.start.row);
1878
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
1879
+ if (rightChar === ';') {
1880
+ range.end.column ++;
1881
+ return range;
1882
+ }
1883
+ }
1884
+ }
1885
+ });
1886
+
1887
+ this.add("semicolon", "insertion", function (state, action, editor, session, text) {
1888
+ if (text === ';' && editor.selection.isEmpty()) {
1889
+ var cursor = editor.getCursorPosition();
1890
+ var line = session.doc.getLine(cursor.row);
1891
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
1892
+ if (rightChar === ';') {
1893
+ return {
1894
+ text: '',
1895
+ selection: [1, 1]
1896
+ };
1897
+ }
1898
+ }
1899
+ });
1900
+
1901
+ this.add("!important", "insertion", function (state, action, editor, session, text) {
1902
+ if (text === '!' && editor.selection.isEmpty()) {
1903
+ var cursor = editor.getCursorPosition();
1904
+ var line = session.doc.getLine(cursor.row);
1905
+
1906
+ if (/^\s*(;|}|$)/.test(line.substring(cursor.column))) {
1907
+ return {
1908
+ text: '!important',
1909
+ selection: [10, 10]
1910
+ };
1911
+ }
1912
+ }
1913
+ });
1914
+
1915
+ };
1916
+ oop.inherits(CssBehaviour, CstyleBehaviour);
1917
+
1918
+ exports.CssBehaviour = CssBehaviour;
1919
+ });
1920
+
1921
+ 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) {
1922
+ "use strict";
1923
+
1924
+ var oop = require("../lib/oop");
1925
+ var TextMode = require("./text").Mode;
1926
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1927
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1928
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
1929
+ var CssCompletions = require("./css_completions").CssCompletions;
1930
+ var CssBehaviour = require("./behaviour/css").CssBehaviour;
1931
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1932
+
1933
+ var Mode = function() {
1934
+ this.HighlightRules = CssHighlightRules;
1935
+ this.$outdent = new MatchingBraceOutdent();
1936
+ this.$behaviour = new CssBehaviour();
1937
+ this.$completer = new CssCompletions();
1938
+ this.foldingRules = new CStyleFoldMode();
1939
+ };
1940
+ oop.inherits(Mode, TextMode);
1941
+
1942
+ (function() {
1943
+
1944
+ this.foldingRules = "cStyle";
1945
+ this.blockComment = {start: "/*", end: "*/"};
1946
+
1947
+ this.getNextLineIndent = function(state, line, tab) {
1948
+ var indent = this.$getIndent(line);
1949
+ var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
1950
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
1951
+ return indent;
1952
+ }
1953
+
1954
+ var match = line.match(/^.*\{\s*$/);
1955
+ if (match) {
1956
+ indent += tab;
1957
+ }
1958
+
1959
+ return indent;
1960
+ };
1961
+
1962
+ this.checkOutdent = function(state, line, input) {
1963
+ return this.$outdent.checkOutdent(line, input);
1964
+ };
1965
+
1966
+ this.autoOutdent = function(state, doc, row) {
1967
+ this.$outdent.autoOutdent(doc, row);
1968
+ };
1969
+
1970
+ this.getCompletions = function(state, session, pos, prefix) {
1971
+ return this.$completer.getCompletions(state, session, pos, prefix);
1972
+ };
1973
+
1974
+ this.createWorker = function(session) {
1975
+ var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
1976
+ worker.attachToDocument(session.getDocument());
1977
+
1978
+ worker.on("annotate", function(e) {
1979
+ session.setAnnotations(e.data);
1980
+ });
1981
+
1982
+ worker.on("terminate", function() {
1983
+ session.clearAnnotations();
1984
+ });
1985
+
1986
+ return worker;
1987
+ };
1988
+
1989
+ this.$id = "ace/mode/css";
1990
+ this.snippetFileId = "ace/snippets/css";
1991
+ }).call(Mode.prototype);
1992
+
1993
+ exports.Mode = Mode;
1994
+
1995
+ });
1996
+
1997
+ 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) {
1998
+ "use strict";
1999
+
2000
+ var oop = require("../lib/oop");
2001
+ var lang = require("../lib/lang");
2002
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
2003
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
2004
+ var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
2005
+
2006
+ var tagMap = lang.createMap({
2007
+ a : 'anchor',
2008
+ button : 'form',
2009
+ form : 'form',
2010
+ img : 'image',
2011
+ input : 'form',
2012
+ label : 'form',
2013
+ option : 'form',
2014
+ script : 'script',
2015
+ select : 'form',
2016
+ textarea : 'form',
2017
+ style : 'style',
2018
+ table : 'table',
2019
+ tbody : 'table',
2020
+ td : 'table',
2021
+ tfoot : 'table',
2022
+ th : 'table',
2023
+ tr : 'table'
2024
+ });
2025
+
2026
+ var HtmlHighlightRules = function() {
2027
+ XmlHighlightRules.call(this);
2028
+
2029
+ this.addRules({
2030
+ attributes: [{
2031
+ include : "tag_whitespace"
2032
+ }, {
2033
+ token : "entity.other.attribute-name.xml",
2034
+ regex : "[-_a-zA-Z0-9:.]+"
2035
+ }, {
2036
+ token : "keyword.operator.attribute-equals.xml",
2037
+ regex : "=",
2038
+ push : [{
2039
+ include: "tag_whitespace"
2040
+ }, {
2041
+ token : "string.unquoted.attribute-value.html",
2042
+ regex : "[^<>='\"`\\s]+",
2043
+ next : "pop"
2044
+ }, {
2045
+ token : "empty",
2046
+ regex : "",
2047
+ next : "pop"
2048
+ }]
2049
+ }, {
2050
+ include : "attribute_value"
2051
+ }],
2052
+ tag: [{
2053
+ token : function(start, tag) {
2054
+ var group = tagMap[tag];
2055
+ return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
2056
+ "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
2057
+ },
2058
+ regex : "(</?)([-_a-zA-Z0-9:.]+)",
2059
+ next: "tag_stuff"
2060
+ }],
2061
+ tag_stuff: [
2062
+ {include : "attributes"},
2063
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
2064
+ ]
2065
+ });
2066
+
2067
+ this.embedTagRules(CssHighlightRules, "css-", "style");
2068
+ this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script");
2069
+
2070
+ if (this.constructor === HtmlHighlightRules)
2071
+ this.normalizeRules();
2072
+ };
2073
+
2074
+ oop.inherits(HtmlHighlightRules, XmlHighlightRules);
2075
+
2076
+ exports.HtmlHighlightRules = HtmlHighlightRules;
2077
+ });
2078
+
2079
+ ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module) {
2080
+ "use strict";
2081
+
2082
+ var oop = require("../../lib/oop");
2083
+ var BaseFoldMode = require("./fold_mode").FoldMode;
2084
+
2085
+ var FoldMode = exports.FoldMode = function(defaultMode, subModes) {
2086
+ this.defaultMode = defaultMode;
2087
+ this.subModes = subModes;
2088
+ };
2089
+ oop.inherits(FoldMode, BaseFoldMode);
2090
+
2091
+ (function() {
2092
+
2093
+
2094
+ this.$getMode = function(state) {
2095
+ if (typeof state != "string")
2096
+ state = state[0];
2097
+ for (var key in this.subModes) {
2098
+ if (state.indexOf(key) === 0)
2099
+ return this.subModes[key];
2100
+ }
2101
+ return null;
2102
+ };
2103
+
2104
+ this.$tryMode = function(state, session, foldStyle, row) {
2105
+ var mode = this.$getMode(state);
2106
+ return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
2107
+ };
2108
+
2109
+ this.getFoldWidget = function(session, foldStyle, row) {
2110
+ return (
2111
+ this.$tryMode(session.getState(row-1), session, foldStyle, row) ||
2112
+ this.$tryMode(session.getState(row), session, foldStyle, row) ||
2113
+ this.defaultMode.getFoldWidget(session, foldStyle, row)
2114
+ );
2115
+ };
2116
+
2117
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
2118
+ var mode = this.$getMode(session.getState(row-1));
2119
+
2120
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
2121
+ mode = this.$getMode(session.getState(row));
2122
+
2123
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
2124
+ mode = this.defaultMode;
2125
+
2126
+ return mode.getFoldWidgetRange(session, foldStyle, row);
2127
+ };
2128
+
2129
+ }).call(FoldMode.prototype);
2130
+
2131
+ });
2132
+
2133
+ 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) {
2134
+ "use strict";
2135
+
2136
+ var oop = require("../../lib/oop");
2137
+ var MixedFoldMode = require("./mixed").FoldMode;
2138
+ var XmlFoldMode = require("./xml").FoldMode;
2139
+ var CStyleFoldMode = require("./cstyle").FoldMode;
2140
+
2141
+ var FoldMode = exports.FoldMode = function(voidElements, optionalTags) {
2142
+ MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
2143
+ "js-": new CStyleFoldMode(),
2144
+ "css-": new CStyleFoldMode()
2145
+ });
2146
+ };
2147
+
2148
+ oop.inherits(FoldMode, MixedFoldMode);
2149
+
2150
+ });
2151
+
2152
+ ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) {
2153
+ "use strict";
2154
+
2155
+ var TokenIterator = require("../token_iterator").TokenIterator;
2156
+
2157
+ var commonAttributes = [
2158
+ "accesskey",
2159
+ "class",
2160
+ "contenteditable",
2161
+ "contextmenu",
2162
+ "dir",
2163
+ "draggable",
2164
+ "dropzone",
2165
+ "hidden",
2166
+ "id",
2167
+ "inert",
2168
+ "itemid",
2169
+ "itemprop",
2170
+ "itemref",
2171
+ "itemscope",
2172
+ "itemtype",
2173
+ "lang",
2174
+ "spellcheck",
2175
+ "style",
2176
+ "tabindex",
2177
+ "title",
2178
+ "translate"
2179
+ ];
2180
+
2181
+ var eventAttributes = [
2182
+ "onabort",
2183
+ "onblur",
2184
+ "oncancel",
2185
+ "oncanplay",
2186
+ "oncanplaythrough",
2187
+ "onchange",
2188
+ "onclick",
2189
+ "onclose",
2190
+ "oncontextmenu",
2191
+ "oncuechange",
2192
+ "ondblclick",
2193
+ "ondrag",
2194
+ "ondragend",
2195
+ "ondragenter",
2196
+ "ondragleave",
2197
+ "ondragover",
2198
+ "ondragstart",
2199
+ "ondrop",
2200
+ "ondurationchange",
2201
+ "onemptied",
2202
+ "onended",
2203
+ "onerror",
2204
+ "onfocus",
2205
+ "oninput",
2206
+ "oninvalid",
2207
+ "onkeydown",
2208
+ "onkeypress",
2209
+ "onkeyup",
2210
+ "onload",
2211
+ "onloadeddata",
2212
+ "onloadedmetadata",
2213
+ "onloadstart",
2214
+ "onmousedown",
2215
+ "onmousemove",
2216
+ "onmouseout",
2217
+ "onmouseover",
2218
+ "onmouseup",
2219
+ "onmousewheel",
2220
+ "onpause",
2221
+ "onplay",
2222
+ "onplaying",
2223
+ "onprogress",
2224
+ "onratechange",
2225
+ "onreset",
2226
+ "onscroll",
2227
+ "onseeked",
2228
+ "onseeking",
2229
+ "onselect",
2230
+ "onshow",
2231
+ "onstalled",
2232
+ "onsubmit",
2233
+ "onsuspend",
2234
+ "ontimeupdate",
2235
+ "onvolumechange",
2236
+ "onwaiting"
2237
+ ];
2238
+
2239
+ var globalAttributes = commonAttributes.concat(eventAttributes);
2240
+
2241
+ var attributeMap = {
2242
+ "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},
2243
+ "abbr": {},
2244
+ "address": {},
2245
+ "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1},
2246
+ "article": {"pubdate": 1},
2247
+ "aside": {},
2248
+ "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }},
2249
+ "b": {},
2250
+ "base": {"href": 1, "target": 1},
2251
+ "bdi": {},
2252
+ "bdo": {},
2253
+ "blockquote": {"cite": 1},
2254
+ "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},
2255
+ "br": {},
2256
+ "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}},
2257
+ "canvas": {"width": 1, "height": 1},
2258
+ "caption": {},
2259
+ "cite": {},
2260
+ "code": {},
2261
+ "col": {"span": 1},
2262
+ "colgroup": {"span": 1},
2263
+ "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1},
2264
+ "data": {},
2265
+ "datalist": {},
2266
+ "dd": {},
2267
+ "del": {"cite": 1, "datetime": 1},
2268
+ "details": {"open": 1},
2269
+ "dfn": {},
2270
+ "dialog": {"open": 1},
2271
+ "div": {},
2272
+ "dl": {},
2273
+ "dt": {},
2274
+ "em": {},
2275
+ "embed": {"src": 1, "height": 1, "width": 1, "type": 1},
2276
+ "fieldset": {"disabled": 1, "form": 1, "name": 1},
2277
+ "figcaption": {},
2278
+ "figure": {},
2279
+ "footer": {},
2280
+ "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}},
2281
+ "h1": {},
2282
+ "h2": {},
2283
+ "h3": {},
2284
+ "h4": {},
2285
+ "h5": {},
2286
+ "h6": {},
2287
+ "head": {},
2288
+ "header": {},
2289
+ "hr": {},
2290
+ "html": {"manifest": 1},
2291
+ "i": {},
2292
+ "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}},
2293
+ "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1},
2294
+ "input": {
2295
+ "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},
2296
+ "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},
2297
+ "ins": {"cite": 1, "datetime": 1},
2298
+ "kbd": {},
2299
+ "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1},
2300
+ "label": {"form": 1, "for": 1},
2301
+ "legend": {},
2302
+ "li": {"value": 1},
2303
+ "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},
2304
+ "main": {},
2305
+ "map": {"name": 1},
2306
+ "mark": {},
2307
+ "math": {},
2308
+ "menu": {"type": 1, "label": 1},
2309
+ "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1},
2310
+ "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1},
2311
+ "nav": {},
2312
+ "noscript": {"href": 1},
2313
+ "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1},
2314
+ "ol": {"start": 1, "reversed": 1},
2315
+ "optgroup": {"disabled": 1, "label": 1},
2316
+ "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1},
2317
+ "output": {"for": 1, "form": 1, "name": 1},
2318
+ "p": {},
2319
+ "param": {"name": 1, "value": 1},
2320
+ "pre": {},
2321
+ "progress": {"value": 1, "max": 1},
2322
+ "q": {"cite": 1},
2323
+ "rp": {},
2324
+ "rt": {},
2325
+ "ruby": {},
2326
+ "s": {},
2327
+ "samp": {},
2328
+ "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1},
2329
+ "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}},
2330
+ "small": {},
2331
+ "source": {"src": 1, "type": 1, "media": 1},
2332
+ "span": {},
2333
+ "strong": {},
2334
+ "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1},
2335
+ "sub": {},
2336
+ "sup": {},
2337
+ "svg": {},
2338
+ "table": {"summary": 1},
2339
+ "tbody": {},
2340
+ "td": {"headers": 1, "rowspan": 1, "colspan": 1},
2341
+ "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}},
2342
+ "tfoot": {},
2343
+ "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1},
2344
+ "thead": {},
2345
+ "time": {"datetime": 1},
2346
+ "title": {},
2347
+ "tr": {},
2348
+ "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1},
2349
+ "section": {},
2350
+ "summary": {},
2351
+ "u": {},
2352
+ "ul": {},
2353
+ "var": {},
2354
+ "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}},
2355
+ "wbr": {}
2356
+ };
2357
+
2358
+ var elements = Object.keys(attributeMap);
2359
+
2360
+ function is(token, type) {
2361
+ return token.type.lastIndexOf(type + ".xml") > -1;
2362
+ }
2363
+
2364
+ function findTagName(session, pos) {
2365
+ var iterator = new TokenIterator(session, pos.row, pos.column);
2366
+ var token = iterator.getCurrentToken();
2367
+ while (token && !is(token, "tag-name")){
2368
+ token = iterator.stepBackward();
2369
+ }
2370
+ if (token)
2371
+ return token.value;
2372
+ }
2373
+
2374
+ function findAttributeName(session, pos) {
2375
+ var iterator = new TokenIterator(session, pos.row, pos.column);
2376
+ var token = iterator.getCurrentToken();
2377
+ while (token && !is(token, "attribute-name")){
2378
+ token = iterator.stepBackward();
2379
+ }
2380
+ if (token)
2381
+ return token.value;
2382
+ }
2383
+
2384
+ var HtmlCompletions = function() {
2385
+
2386
+ };
2387
+
2388
+ (function() {
2389
+
2390
+ this.getCompletions = function(state, session, pos, prefix) {
2391
+ var token = session.getTokenAt(pos.row, pos.column);
2392
+
2393
+ if (!token)
2394
+ return [];
2395
+ if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
2396
+ return this.getTagCompletions(state, session, pos, prefix);
2397
+ if (is(token, "tag-whitespace") || is(token, "attribute-name"))
2398
+ return this.getAttributeCompletions(state, session, pos, prefix);
2399
+ if (is(token, "attribute-value"))
2400
+ return this.getAttributeValueCompletions(state, session, pos, prefix);
2401
+ var line = session.getLine(pos.row).substr(0, pos.column);
2402
+ if (/&[a-z]*$/i.test(line))
2403
+ return this.getHTMLEntityCompletions(state, session, pos, prefix);
2404
+
2405
+ return [];
2406
+ };
2407
+
2408
+ this.getTagCompletions = function(state, session, pos, prefix) {
2409
+ return elements.map(function(element){
2410
+ return {
2411
+ value: element,
2412
+ meta: "tag",
2413
+ score: 1000000
2414
+ };
2415
+ });
2416
+ };
2417
+
2418
+ this.getAttributeCompletions = function(state, session, pos, prefix) {
2419
+ var tagName = findTagName(session, pos);
2420
+ if (!tagName)
2421
+ return [];
2422
+ var attributes = globalAttributes;
2423
+ if (tagName in attributeMap) {
2424
+ attributes = attributes.concat(Object.keys(attributeMap[tagName]));
2425
+ }
2426
+ return attributes.map(function(attribute){
2427
+ return {
2428
+ caption: attribute,
2429
+ snippet: attribute + '="$0"',
2430
+ meta: "attribute",
2431
+ score: 1000000
2432
+ };
2433
+ });
2434
+ };
2435
+
2436
+ this.getAttributeValueCompletions = function(state, session, pos, prefix) {
2437
+ var tagName = findTagName(session, pos);
2438
+ var attributeName = findAttributeName(session, pos);
2439
+
2440
+ if (!tagName)
2441
+ return [];
2442
+ var values = [];
2443
+ if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
2444
+ values = Object.keys(attributeMap[tagName][attributeName]);
2445
+ }
2446
+ return values.map(function(value){
2447
+ return {
2448
+ caption: value,
2449
+ snippet: value,
2450
+ meta: "attribute value",
2451
+ score: 1000000
2452
+ };
2453
+ });
2454
+ };
2455
+
2456
+ this.getHTMLEntityCompletions = function(state, session, pos, prefix) {
2457
+ 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;'];
2458
+
2459
+ return values.map(function(value){
2460
+ return {
2461
+ caption: value,
2462
+ snippet: value,
2463
+ meta: "html entity",
2464
+ score: 1000000
2465
+ };
2466
+ });
2467
+ };
2468
+
2469
+ }).call(HtmlCompletions.prototype);
2470
+
2471
+ exports.HtmlCompletions = HtmlCompletions;
2472
+ });
2473
+
2474
+ 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) {
2475
+ "use strict";
2476
+
2477
+ var oop = require("../lib/oop");
2478
+ var lang = require("../lib/lang");
2479
+ var TextMode = require("./text").Mode;
2480
+ var JavaScriptMode = require("./javascript").Mode;
2481
+ var CssMode = require("./css").Mode;
2482
+ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
2483
+ var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
2484
+ var HtmlFoldMode = require("./folding/html").FoldMode;
2485
+ var HtmlCompletions = require("./html_completions").HtmlCompletions;
2486
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
2487
+ var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
2488
+ var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
2489
+
2490
+ var Mode = function(options) {
2491
+ this.fragmentContext = options && options.fragmentContext;
2492
+ this.HighlightRules = HtmlHighlightRules;
2493
+ this.$behaviour = new XmlBehaviour();
2494
+ this.$completer = new HtmlCompletions();
2495
+
2496
+ this.createModeDelegates({
2497
+ "js-": JavaScriptMode,
2498
+ "css-": CssMode
2499
+ });
2500
+
2501
+ this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
2502
+ };
2503
+ oop.inherits(Mode, TextMode);
2504
+
2505
+ (function() {
2506
+
2507
+ this.blockComment = {start: "<!--", end: "-->"};
2508
+
2509
+ this.voidElements = lang.arrayToMap(voidElements);
2510
+
2511
+ this.getNextLineIndent = function(state, line, tab) {
2512
+ return this.$getIndent(line);
2513
+ };
2514
+
2515
+ this.checkOutdent = function(state, line, input) {
2516
+ return false;
2517
+ };
2518
+
2519
+ this.getCompletions = function(state, session, pos, prefix) {
2520
+ return this.$completer.getCompletions(state, session, pos, prefix);
2521
+ };
2522
+
2523
+ this.createWorker = function(session) {
2524
+ if (this.constructor != Mode)
2525
+ return;
2526
+ var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
2527
+ worker.attachToDocument(session.getDocument());
2528
+
2529
+ if (this.fragmentContext)
2530
+ worker.call("setOptions", [{context: this.fragmentContext}]);
2531
+
2532
+ worker.on("error", function(e) {
2533
+ session.setAnnotations(e.data);
2534
+ });
2535
+
2536
+ worker.on("terminate", function() {
2537
+ session.clearAnnotations();
2538
+ });
2539
+
2540
+ return worker;
2541
+ };
2542
+
2543
+ this.$id = "ace/mode/html";
2544
+ this.snippetFileId = "ace/snippets/html";
2545
+ }).call(Mode.prototype);
2546
+
2547
+ exports.Mode = Mode;
2548
+ });
2549
+
2550
+ 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) {
2551
+ "use strict";
2552
+
2553
+ var modes = require("../config").$modes;
2554
+
2555
+ var oop = require("../lib/oop");
2556
+ var lang = require("../lib/lang");
2557
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
2558
+ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
2559
+
2560
+ var escaped = function(ch) {
2561
+ return "(?:[^" + lang.escapeRegExp(ch) + "\\\\]|\\\\.)*";
2562
+ };
2563
+
2564
+ var MarkdownHighlightRules = function() {
2565
+ HtmlHighlightRules.call(this);
2566
+ var codeBlockStartRule = {
2567
+ token : "support.function",
2568
+ regex : /^\s*(```+[^`]*|~~~+[^~]*)$/,
2569
+ onMatch: function(value, state, stack, line) {
2570
+ var m = value.match(/^(\s*)([`~]+)(.*)/);
2571
+ var language = /[\w-]+|$/.exec(m[3])[0];
2572
+ if (!modes[language])
2573
+ language = "";
2574
+ stack.unshift("githubblock", [], [m[1], m[2], language], state);
2575
+ return this.token;
2576
+ },
2577
+ next : "githubblock"
2578
+ };
2579
+ var codeBlockRules = [{
2580
+ token : "support.function",
2581
+ regex : ".*",
2582
+ onMatch: function(value, state, stack, line) {
2583
+ var embedState = stack[1];
2584
+ var indent = stack[2][0];
2585
+ var endMarker = stack[2][1];
2586
+ var language = stack[2][2];
2587
+
2588
+ var m = /^(\s*)(`+|~+)\s*$/.exec(value);
2589
+ if (
2590
+ m && m[1].length < indent.length + 3
2591
+ && m[2].length >= endMarker.length && m[2][0] == endMarker[0]
2592
+ ) {
2593
+ stack.splice(0, 3);
2594
+ this.next = stack.shift();
2595
+ return this.token;
2596
+ }
2597
+ this.next = "";
2598
+ if (language && modes[language]) {
2599
+ var data = modes[language].getTokenizer().getLineTokens(value, embedState.slice(0));
2600
+ stack[1] = data.state;
2601
+ return data.tokens;
2602
+ }
2603
+ return this.token;
2604
+ }
2605
+ }];
2606
+
2607
+ this.$rules["start"].unshift({
2608
+ token : "empty_line",
2609
+ regex : '^$',
2610
+ next: "allowBlock"
2611
+ }, { // h1
2612
+ token: "markup.heading.1",
2613
+ regex: "^=+(?=\\s*$)"
2614
+ }, { // h2
2615
+ token: "markup.heading.2",
2616
+ regex: "^\\-+(?=\\s*$)"
2617
+ }, {
2618
+ token : function(value) {
2619
+ return "markup.heading." + value.length;
2620
+ },
2621
+ regex : /^#{1,6}(?=\s|$)/,
2622
+ next : "header"
2623
+ },
2624
+ codeBlockStartRule,
2625
+ { // block quote
2626
+ token : "string.blockquote",
2627
+ regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",
2628
+ next : "blockquote"
2629
+ }, { // HR * - _
2630
+ token : "constant",
2631
+ regex : "^ {0,3}(?:(?:\\* ?){3,}|(?:\\- ?){3,}|(?:\\_ ?){3,})\\s*$",
2632
+ next: "allowBlock"
2633
+ }, { // list
2634
+ token : "markup.list",
2635
+ regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
2636
+ next : "listblock-start"
2637
+ }, {
2638
+ include : "basic"
2639
+ });
2640
+
2641
+ this.addRules({
2642
+ "basic" : [{
2643
+ token : "constant.language.escape",
2644
+ regex : /\\[\\`*_{}\[\]()#+\-.!]/
2645
+ }, { // code span `
2646
+ token : "support.function",
2647
+ regex : "(`+)(.*?[^`])(\\1)"
2648
+ }, { // reference
2649
+ token : ["text", "constant", "text", "url", "string", "text"],
2650
+ regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$"
2651
+ }, { // link by reference
2652
+ token : ["text", "string", "text", "constant", "text"],
2653
+ regex : "(\\[)(" + escaped("]") + ")(\\]\\s*\\[)("+ escaped("]") + ")(\\])"
2654
+ }, { // link by url
2655
+ token : ["text", "string", "text", "markup.underline", "string", "text"],
2656
+ regex : "(\\!?\\[)(" + // [
2657
+ escaped("]") + // link text or alt text
2658
+ ")(\\]\\()"+ // ](
2659
+ '((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)' + // href or image
2660
+ '(\\s*"' + escaped('"') + '"\\s*)?' + // "title"
2661
+ "(\\))" // )
2662
+ }, { // strong ** __
2663
+ token : "string.strong",
2664
+ regex : "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"
2665
+ }, { // emphasis * _
2666
+ token : "string.emphasis",
2667
+ regex : "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"
2668
+ }, { //
2669
+ token : ["text", "url", "text"],
2670
+ regex : "(<)("+
2671
+ "(?:https?|ftp|dict):[^'\">\\s]+"+
2672
+ "|"+
2673
+ "(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+"+
2674
+ ")(>)"
2675
+ }],
2676
+ "allowBlock": [
2677
+ {token : "support.function", regex : "^ {4}.+", next : "allowBlock"},
2678
+ {token : "empty_line", regex : '^$', next: "allowBlock"},
2679
+ {token : "empty", regex : "", next : "start"}
2680
+ ],
2681
+
2682
+ "header" : [{
2683
+ regex: "$",
2684
+ next : "start"
2685
+ }, {
2686
+ include: "basic"
2687
+ }, {
2688
+ defaultToken : "heading"
2689
+ } ],
2690
+
2691
+ "listblock-start" : [{
2692
+ token : "support.variable",
2693
+ regex : /(?:\[[ x]\])?/,
2694
+ next : "listblock"
2695
+ }],
2696
+
2697
+ "listblock" : [ { // Lists only escape on completely blank lines.
2698
+ token : "empty_line",
2699
+ regex : "^$",
2700
+ next : "start"
2701
+ }, { // list
2702
+ token : "markup.list",
2703
+ regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
2704
+ next : "listblock-start"
2705
+ }, {
2706
+ include : "basic", noEscape: true
2707
+ },
2708
+ codeBlockStartRule,
2709
+ {
2710
+ defaultToken : "list" //do not use markup.list to allow stling leading `*` differntly
2711
+ } ],
2712
+
2713
+ "blockquote" : [ { // Blockquotes only escape on blank lines.
2714
+ token : "empty_line",
2715
+ regex : "^\\s*$",
2716
+ next : "start"
2717
+ }, { // block quote
2718
+ token : "string.blockquote",
2719
+ regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",
2720
+ next : "blockquote"
2721
+ }, {
2722
+ include : "basic", noEscape: true
2723
+ }, {
2724
+ defaultToken : "string.blockquote"
2725
+ } ],
2726
+
2727
+ "githubblock" : codeBlockRules
2728
+ });
2729
+
2730
+ this.normalizeRules();
2731
+ };
2732
+ oop.inherits(MarkdownHighlightRules, TextHighlightRules);
2733
+
2734
+ exports.MarkdownHighlightRules = MarkdownHighlightRules;
2735
+ });
2736
+
2737
+ ace.define("ace/mode/folding/markdown",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) {
2738
+ "use strict";
2739
+
2740
+ var oop = require("../../lib/oop");
2741
+ var BaseFoldMode = require("./fold_mode").FoldMode;
2742
+ var Range = require("../../range").Range;
2743
+
2744
+ var FoldMode = exports.FoldMode = function() {};
2745
+ oop.inherits(FoldMode, BaseFoldMode);
2746
+
2747
+ (function() {
2748
+ this.foldingStartMarker = /^(?:[=-]+\s*$|#{1,6} |`{3})/;
2749
+
2750
+ this.getFoldWidget = function(session, foldStyle, row) {
2751
+ var line = session.getLine(row);
2752
+ if (!this.foldingStartMarker.test(line))
2753
+ return "";
2754
+
2755
+ if (line[0] == "`") {
2756
+ if (session.bgTokenizer.getState(row) == "start")
2757
+ return "end";
2758
+ return "start";
2759
+ }
2760
+
2761
+ return "start";
2762
+ };
2763
+
2764
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
2765
+ var line = session.getLine(row);
2766
+ var startColumn = line.length;
2767
+ var maxRow = session.getLength();
2768
+ var startRow = row;
2769
+ var endRow = row;
2770
+ if (!line.match(this.foldingStartMarker))
2771
+ return;
2772
+
2773
+ if (line[0] == "`") {
2774
+ if (session.bgTokenizer.getState(row) !== "start") {
2775
+ while (++row < maxRow) {
2776
+ line = session.getLine(row);
2777
+ if (line[0] == "`" & line.substring(0, 3) == "```")
2778
+ break;
2779
+ }
2780
+ return new Range(startRow, startColumn, row, 0);
2781
+ } else {
2782
+ while (row -- > 0) {
2783
+ line = session.getLine(row);
2784
+ if (line[0] == "`" & line.substring(0, 3) == "```")
2785
+ break;
2786
+ }
2787
+ return new Range(row, line.length, startRow, 0);
2788
+ }
2789
+ }
2790
+
2791
+ var token;
2792
+ function isHeading(row) {
2793
+ token = session.getTokens(row)[0];
2794
+ return token && token.type.lastIndexOf(heading, 0) === 0;
2795
+ }
2796
+
2797
+ var heading = "markup.heading";
2798
+ function getLevel() {
2799
+ var ch = token.value[0];
2800
+ if (ch == "=") return 6;
2801
+ if (ch == "-") return 5;
2802
+ return 7 - token.value.search(/[^#]|$/);
2803
+ }
2804
+
2805
+ if (isHeading(row)) {
2806
+ var startHeadingLevel = getLevel();
2807
+ while (++row < maxRow) {
2808
+ if (!isHeading(row))
2809
+ continue;
2810
+ var level = getLevel();
2811
+ if (level >= startHeadingLevel)
2812
+ break;
2813
+ }
2814
+
2815
+ endRow = row - (!token || ["=", "-"].indexOf(token.value[0]) == -1 ? 1 : 2);
2816
+
2817
+ if (endRow > startRow) {
2818
+ while (endRow > startRow && /^\s*$/.test(session.getLine(endRow)))
2819
+ endRow--;
2820
+ }
2821
+
2822
+ if (endRow > startRow) {
2823
+ var endColumn = session.getLine(endRow).length;
2824
+ return new Range(startRow, startColumn, endRow, endColumn);
2825
+ }
2826
+ }
2827
+ };
2828
+
2829
+ }).call(FoldMode.prototype);
2830
+
2831
+ });
2832
+
2833
+ ace.define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2834
+ "use strict";
2835
+
2836
+ var oop = require("../lib/oop");
2837
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
2838
+
2839
+ var reservedKeywords = exports.reservedKeywords = (
2840
+ '!|{|}|case|do|done|elif|else|'+
2841
+ 'esac|fi|for|if|in|then|until|while|'+
2842
+ '&|;|export|local|read|typeset|unset|'+
2843
+ 'elif|select|set|function|declare|readonly'
2844
+ );
2845
+
2846
+ var languageConstructs = exports.languageConstructs = (
2847
+ '[|]|alias|bg|bind|break|builtin|'+
2848
+ 'cd|command|compgen|complete|continue|'+
2849
+ 'dirs|disown|echo|enable|eval|exec|'+
2850
+ 'exit|fc|fg|getopts|hash|help|history|'+
2851
+ 'jobs|kill|let|logout|popd|printf|pushd|'+
2852
+ 'pwd|return|set|shift|shopt|source|'+
2853
+ 'suspend|test|times|trap|type|ulimit|'+
2854
+ 'umask|unalias|wait'
2855
+ );
2856
+
2857
+ var ShHighlightRules = function() {
2858
+ var keywordMapper = this.createKeywordMapper({
2859
+ "keyword": reservedKeywords,
2860
+ "support.function.builtin": languageConstructs,
2861
+ "invalid.deprecated": "debugger"
2862
+ }, "identifier");
2863
+
2864
+ var integer = "(?:(?:[1-9]\\d*)|(?:0))";
2865
+
2866
+ var fraction = "(?:\\.\\d+)";
2867
+ var intPart = "(?:\\d+)";
2868
+ var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
2869
+ var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + ")";
2870
+ var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
2871
+ var fileDescriptor = "(?:&" + intPart + ")";
2872
+
2873
+ var variableName = "[a-zA-Z_][a-zA-Z0-9_]*";
2874
+ var variable = "(?:" + variableName + "(?==))";
2875
+
2876
+ var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))";
2877
+
2878
+ var func = "(?:" + variableName + "\\s*\\(\\))";
2879
+
2880
+ this.$rules = {
2881
+ "start" : [{
2882
+ token : "constant",
2883
+ regex : /\\./
2884
+ }, {
2885
+ token : ["text", "comment"],
2886
+ regex : /(^|\s)(#.*)$/
2887
+ }, {
2888
+ token : "string.start",
2889
+ regex : '"',
2890
+ push : [{
2891
+ token : "constant.language.escape",
2892
+ regex : /\\(?:[$`"\\]|$)/
2893
+ }, {
2894
+ include : "variables"
2895
+ }, {
2896
+ token : "keyword.operator",
2897
+ regex : /`/ // TODO highlight `
2898
+ }, {
2899
+ token : "string.end",
2900
+ regex : '"',
2901
+ next: "pop"
2902
+ }, {
2903
+ defaultToken: "string"
2904
+ }]
2905
+ }, {
2906
+ token : "string",
2907
+ regex : "\\$'",
2908
+ push : [{
2909
+ token : "constant.language.escape",
2910
+ regex : /\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/
2911
+ }, {
2912
+ token : "string",
2913
+ regex : "'",
2914
+ next: "pop"
2915
+ }, {
2916
+ defaultToken: "string"
2917
+ }]
2918
+ }, {
2919
+ regex : "<<<",
2920
+ token : "keyword.operator"
2921
+ }, {
2922
+ stateName: "heredoc",
2923
+ regex : "(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)",
2924
+ onMatch : function(value, currentState, stack) {
2925
+ var next = value[2] == '-' ? "indentedHeredoc" : "heredoc";
2926
+ var tokens = value.split(this.splitRegex);
2927
+ stack.push(next, tokens[4]);
2928
+ return [
2929
+ {type:"constant", value: tokens[1]},
2930
+ {type:"text", value: tokens[2]},
2931
+ {type:"string", value: tokens[3]},
2932
+ {type:"support.class", value: tokens[4]},
2933
+ {type:"string", value: tokens[5]}
2934
+ ];
2935
+ },
2936
+ rules: {
2937
+ heredoc: [{
2938
+ onMatch: function(value, currentState, stack) {
2939
+ if (value === stack[1]) {
2940
+ stack.shift();
2941
+ stack.shift();
2942
+ this.next = stack[0] || "start";
2943
+ return "support.class";
2944
+ }
2945
+ this.next = "";
2946
+ return "string";
2947
+ },
2948
+ regex: ".*$",
2949
+ next: "start"
2950
+ }],
2951
+ indentedHeredoc: [{
2952
+ token: "string",
2953
+ regex: "^\t+"
2954
+ }, {
2955
+ onMatch: function(value, currentState, stack) {
2956
+ if (value === stack[1]) {
2957
+ stack.shift();
2958
+ stack.shift();
2959
+ this.next = stack[0] || "start";
2960
+ return "support.class";
2961
+ }
2962
+ this.next = "";
2963
+ return "string";
2964
+ },
2965
+ regex: ".*$",
2966
+ next: "start"
2967
+ }]
2968
+ }
2969
+ }, {
2970
+ regex : "$",
2971
+ token : "empty",
2972
+ next : function(currentState, stack) {
2973
+ if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc")
2974
+ return stack[0];
2975
+ return currentState;
2976
+ }
2977
+ }, {
2978
+ token : ["keyword", "text", "text", "text", "variable"],
2979
+ regex : /(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/
2980
+ }, {
2981
+ token : "variable.language",
2982
+ regex : builtinVariable
2983
+ }, {
2984
+ token : "variable",
2985
+ regex : variable
2986
+ }, {
2987
+ include : "variables"
2988
+ }, {
2989
+ token : "support.function",
2990
+ regex : func
2991
+ }, {
2992
+ token : "support.function",
2993
+ regex : fileDescriptor
2994
+ }, {
2995
+ token : "string", // ' string
2996
+ start : "'", end : "'"
2997
+ }, {
2998
+ token : "constant.numeric", // float
2999
+ regex : floatNumber
3000
+ }, {
3001
+ token : "constant.numeric", // integer
3002
+ regex : integer + "\\b"
3003
+ }, {
3004
+ token : keywordMapper,
3005
+ regex : "[a-zA-Z_][a-zA-Z0-9_]*\\b"
3006
+ }, {
3007
+ token : "keyword.operator",
3008
+ regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]"
3009
+ }, {
3010
+ token : "punctuation.operator",
3011
+ regex : ";"
3012
+ }, {
3013
+ token : "paren.lparen",
3014
+ regex : "[\\[\\(\\{]"
3015
+ }, {
3016
+ token : "paren.rparen",
3017
+ regex : "[\\]]"
3018
+ }, {
3019
+ token : "paren.rparen",
3020
+ regex : "[\\)\\}]",
3021
+ next : "pop"
3022
+ }],
3023
+ variables: [{
3024
+ token : "variable",
3025
+ regex : /(\$)(\w+)/
3026
+ }, {
3027
+ token : ["variable", "paren.lparen"],
3028
+ regex : /(\$)(\()/,
3029
+ push : "start"
3030
+ }, {
3031
+ token : ["variable", "paren.lparen", "keyword.operator", "variable", "keyword.operator"],
3032
+ regex : /(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/,
3033
+ push : "start"
3034
+ }, {
3035
+ token : "variable",
3036
+ regex : /\$[*@#?\-$!0_]/
3037
+ }, {
3038
+ token : ["variable", "paren.lparen"],
3039
+ regex : /(\$)(\{)/,
3040
+ push : "start"
3041
+ }]
3042
+ };
3043
+
3044
+ this.normalizeRules();
3045
+ };
3046
+
3047
+ oop.inherits(ShHighlightRules, TextHighlightRules);
3048
+
3049
+ exports.ShHighlightRules = ShHighlightRules;
3050
+ });
3051
+
3052
+ 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","ace/mode/behaviour/cstyle"], function(require, exports, module) {
3053
+ "use strict";
3054
+
3055
+ var oop = require("../lib/oop");
3056
+ var TextMode = require("./text").Mode;
3057
+ var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules;
3058
+ var Range = require("../range").Range;
3059
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
3060
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
3061
+
3062
+ var Mode = function() {
3063
+ this.HighlightRules = ShHighlightRules;
3064
+ this.foldingRules = new CStyleFoldMode();
3065
+ this.$behaviour = new CstyleBehaviour();
3066
+ };
3067
+ oop.inherits(Mode, TextMode);
3068
+
3069
+ (function() {
3070
+
3071
+
3072
+ this.lineCommentStart = "#";
3073
+
3074
+ this.getNextLineIndent = function(state, line, tab) {
3075
+ var indent = this.$getIndent(line);
3076
+
3077
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
3078
+ var tokens = tokenizedLine.tokens;
3079
+
3080
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
3081
+ return indent;
3082
+ }
3083
+
3084
+ if (state == "start") {
3085
+ var match = line.match(/^.*[\{\(\[:]\s*$/);
3086
+ if (match) {
3087
+ indent += tab;
3088
+ }
3089
+ }
3090
+
3091
+ return indent;
3092
+ };
3093
+
3094
+ var outdents = {
3095
+ "pass": 1,
3096
+ "return": 1,
3097
+ "raise": 1,
3098
+ "break": 1,
3099
+ "continue": 1
3100
+ };
3101
+
3102
+ this.checkOutdent = function(state, line, input) {
3103
+ if (input !== "\r\n" && input !== "\r" && input !== "\n")
3104
+ return false;
3105
+
3106
+ var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
3107
+
3108
+ if (!tokens)
3109
+ return false;
3110
+ do {
3111
+ var last = tokens.pop();
3112
+ } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
3113
+
3114
+ if (!last)
3115
+ return false;
3116
+
3117
+ return (last.type == "keyword" && outdents[last.value]);
3118
+ };
3119
+
3120
+ this.autoOutdent = function(state, doc, row) {
3121
+
3122
+ row += 1;
3123
+ var indent = this.$getIndent(doc.getLine(row));
3124
+ var tab = doc.getTabString();
3125
+ if (indent.slice(-tab.length) == tab)
3126
+ doc.remove(new Range(row, indent.length-tab.length, row, indent.length));
3127
+ };
3128
+
3129
+ this.$id = "ace/mode/sh";
3130
+ this.snippetFileId = "ace/snippets/sh";
3131
+ }).call(Mode.prototype);
3132
+
3133
+ exports.Mode = Mode;
3134
+ });
3135
+
3136
+ ace.define("ace/mode/markdown",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/xml","ace/mode/html","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) {
3137
+ "use strict";
3138
+
3139
+ var oop = require("../lib/oop");
3140
+ var TextMode = require("./text").Mode;
3141
+ var JavaScriptMode = require("./javascript").Mode;
3142
+ var XmlMode = require("./xml").Mode;
3143
+ var HtmlMode = require("./html").Mode;
3144
+ var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules;
3145
+ var MarkdownFoldMode = require("./folding/markdown").FoldMode;
3146
+
3147
+ var Mode = function() {
3148
+ this.HighlightRules = MarkdownHighlightRules;
3149
+
3150
+ this.createModeDelegates({
3151
+ javascript: require("./javascript").Mode,
3152
+ html: require("./html").Mode,
3153
+ bash: require("./sh").Mode,
3154
+ sh: require("./sh").Mode,
3155
+ xml: require("./xml").Mode,
3156
+ css: require("./css").Mode
3157
+ });
3158
+
3159
+ this.foldingRules = new MarkdownFoldMode();
3160
+ this.$behaviour = this.$defaultBehaviour;
3161
+ };
3162
+ oop.inherits(Mode, TextMode);
3163
+
3164
+ (function() {
3165
+ this.type = "text";
3166
+ this.blockComment = {start: "<!--", end: "-->"};
3167
+ this.$quotes = {'"': '"', "`": "`"};
3168
+
3169
+ this.getNextLineIndent = function(state, line, tab) {
3170
+ if (state == "listblock") {
3171
+ var match = /^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(line);
3172
+ if (!match)
3173
+ return "";
3174
+ var marker = match[2];
3175
+ if (!marker)
3176
+ marker = parseInt(match[3], 10) + 1 + ".";
3177
+ return match[1] + marker + match[4];
3178
+ } else {
3179
+ return this.$getIndent(line);
3180
+ }
3181
+ };
3182
+ this.$id = "ace/mode/markdown";
3183
+ this.snippetFileId = "ace/snippets/markdown";
3184
+ }).call(Mode.prototype);
3185
+
3186
+ exports.Mode = Mode;
3187
+ }); (function() {
3188
+ ace.require(["ace/mode/markdown"], function(m) {
3189
+ if (typeof module == "object" && typeof exports == "object" && module) {
3190
+ module.exports = m;
3191
+ }
3192
+ });
3193
+ })();
3194
+