ace-rails-ap 2.0.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (301) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -4
  3. data/lib/ace/rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/ace/ace.js +14194 -13349
  5. data/vendor/assets/javascripts/ace/ext-beautify.js +335 -0
  6. data/vendor/assets/javascripts/ace/ext-chromevox.js +6 -1
  7. data/vendor/assets/javascripts/ace/ext-elastic_tabstops_lite.js +8 -33
  8. data/vendor/assets/javascripts/ace/ext-emmet.js +487 -424
  9. data/vendor/assets/javascripts/ace/ext-error_marker.js +6 -0
  10. data/vendor/assets/javascripts/ace/ext-keybinding_menu.js +45 -72
  11. data/vendor/assets/javascripts/ace/ext-language_tools.js +734 -578
  12. data/vendor/assets/javascripts/ace/ext-linking.js +53 -0
  13. data/vendor/assets/javascripts/ace/ext-modelist.js +25 -10
  14. data/vendor/assets/javascripts/ace/ext-old_ie.js +93 -120
  15. data/vendor/assets/javascripts/ace/ext-searchbox.js +8 -41
  16. data/vendor/assets/javascripts/ace/ext-settings_menu.js +229 -234
  17. data/vendor/assets/javascripts/ace/ext-spellcheck.js +7 -3
  18. data/vendor/assets/javascripts/ace/ext-split.js +13 -37
  19. data/vendor/assets/javascripts/ace/ext-static_highlight.js +16 -39
  20. data/vendor/assets/javascripts/ace/ext-statusbar.js +8 -2
  21. data/vendor/assets/javascripts/ace/ext-textarea.js +254 -99
  22. data/vendor/assets/javascripts/ace/ext-themelist.js +13 -40
  23. data/vendor/assets/javascripts/ace/ext-whitespace.js +17 -41
  24. data/vendor/assets/javascripts/ace/keybinding-emacs.js +803 -788
  25. data/vendor/assets/javascripts/ace/keybinding-vim.js +1559 -1560
  26. data/vendor/assets/javascripts/ace/mode-abap.js +52 -83
  27. data/vendor/assets/javascripts/ace/mode-actionscript.js +27 -63
  28. data/vendor/assets/javascripts/ace/mode-ada.js +27 -58
  29. data/vendor/assets/javascripts/ace/mode-apache_conf.js +310 -0
  30. data/vendor/assets/javascripts/ace/mode-applescript.js +226 -0
  31. data/vendor/assets/javascripts/ace/mode-asciidoc.js +39 -70
  32. data/vendor/assets/javascripts/ace/mode-assembly_x86.js +26 -58
  33. data/vendor/assets/javascripts/ace/mode-autohotkey.js +27 -63
  34. data/vendor/assets/javascripts/ace/mode-batchfile.js +27 -63
  35. data/vendor/assets/javascripts/ace/mode-c9search.js +92 -112
  36. data/vendor/assets/javascripts/ace/mode-c_cpp.js +224 -223
  37. data/vendor/assets/javascripts/ace/mode-cirru.js +202 -0
  38. data/vendor/assets/javascripts/ace/mode-clojure.js +98 -92
  39. data/vendor/assets/javascripts/ace/mode-cobol.js +27 -58
  40. data/vendor/assets/javascripts/ace/mode-coffee.js +90 -122
  41. data/vendor/assets/javascripts/ace/mode-coldfusion.js +1908 -1464
  42. data/vendor/assets/javascripts/ace/mode-csharp.js +291 -264
  43. data/vendor/assets/javascripts/ace/mode-css.js +266 -267
  44. data/vendor/assets/javascripts/ace/mode-curly.js +796 -815
  45. data/vendor/assets/javascripts/ace/mode-d.js +64 -95
  46. data/vendor/assets/javascripts/ace/mode-dart.js +254 -256
  47. data/vendor/assets/javascripts/ace/mode-diff.js +27 -58
  48. data/vendor/assets/javascripts/ace/mode-django.js +856 -866
  49. data/vendor/assets/javascripts/ace/mode-dockerfile.js +759 -0
  50. data/vendor/assets/javascripts/ace/mode-dot.js +106 -106
  51. data/vendor/assets/javascripts/ace/mode-eiffel.js +135 -0
  52. data/vendor/assets/javascripts/ace/mode-ejs.js +931 -938
  53. data/vendor/assets/javascripts/ace/mode-erlang.js +27 -58
  54. data/vendor/assets/javascripts/ace/mode-forth.js +27 -63
  55. data/vendor/assets/javascripts/ace/mode-ftl.js +457 -508
  56. data/vendor/assets/javascripts/ace/mode-gcode.js +85 -0
  57. data/vendor/assets/javascripts/ace/mode-gherkin.js +129 -0
  58. data/vendor/assets/javascripts/ace/mode-gitignore.js +50 -0
  59. data/vendor/assets/javascripts/ace/mode-glsl.js +252 -248
  60. data/vendor/assets/javascripts/ace/mode-golang.js +206 -179
  61. data/vendor/assets/javascripts/ace/mode-groovy.js +310 -242
  62. data/vendor/assets/javascripts/ace/mode-haml.js +156 -190
  63. data/vendor/assets/javascripts/ace/mode-handlebars.js +815 -784
  64. data/vendor/assets/javascripts/ace/mode-haskell.js +27 -63
  65. data/vendor/assets/javascripts/ace/mode-haxe.js +206 -176
  66. data/vendor/assets/javascripts/ace/mode-html.js +779 -792
  67. data/vendor/assets/javascripts/ace/mode-html_ruby.js +916 -923
  68. data/vendor/assets/javascripts/ace/mode-ini.js +27 -58
  69. data/vendor/assets/javascripts/ace/mode-io.js +201 -0
  70. data/vendor/assets/javascripts/ace/mode-jack.js +169 -170
  71. data/vendor/assets/javascripts/ace/mode-jade.js +722 -774
  72. data/vendor/assets/javascripts/ace/mode-java.js +310 -245
  73. data/vendor/assets/javascripts/ace/mode-javascript.js +285 -247
  74. data/vendor/assets/javascripts/ace/mode-json.js +183 -184
  75. data/vendor/assets/javascripts/ace/mode-jsoniq.js +3211 -1274
  76. data/vendor/assets/javascripts/ace/mode-jsp.js +481 -504
  77. data/vendor/assets/javascripts/ace/mode-jsx.js +206 -176
  78. data/vendor/assets/javascripts/ace/mode-julia.js +33 -69
  79. data/vendor/assets/javascripts/ace/mode-latex.js +74 -41
  80. data/vendor/assets/javascripts/ace/mode-less.js +250 -251
  81. data/vendor/assets/javascripts/ace/mode-liquid.js +424 -475
  82. data/vendor/assets/javascripts/ace/mode-lisp.js +24 -57
  83. data/vendor/assets/javascripts/ace/mode-livescript.js +42 -41
  84. data/vendor/assets/javascripts/ace/mode-logiql.js +229 -230
  85. data/vendor/assets/javascripts/ace/mode-lsl.js +200 -441
  86. data/vendor/assets/javascripts/ace/mode-lua.js +136 -167
  87. data/vendor/assets/javascripts/ace/mode-luapage.js +904 -884
  88. data/vendor/assets/javascripts/ace/mode-lucene.js +22 -17
  89. data/vendor/assets/javascripts/ace/mode-makefile.js +162 -137
  90. data/vendor/assets/javascripts/ace/mode-markdown.js +846 -854
  91. data/vendor/assets/javascripts/ace/mode-matlab.js +98 -72
  92. data/vendor/assets/javascripts/ace/mode-mel.js +569 -0
  93. data/vendor/assets/javascripts/ace/mode-mushcode.js +84 -115
  94. data/vendor/assets/javascripts/ace/mode-mysql.js +49 -80
  95. data/vendor/assets/javascripts/ace/mode-nix.js +252 -256
  96. data/vendor/assets/javascripts/ace/mode-objectivec.js +242 -274
  97. data/vendor/assets/javascripts/ace/mode-ocaml.js +71 -102
  98. data/vendor/assets/javascripts/ace/mode-pascal.js +32 -68
  99. data/vendor/assets/javascripts/ace/mode-perl.js +67 -98
  100. data/vendor/assets/javascripts/ace/mode-pgsql.js +990 -982
  101. data/vendor/assets/javascripts/ace/mode-php.js +1878 -1900
  102. data/vendor/assets/javascripts/ace/mode-plain_text.js +3 -34
  103. data/vendor/assets/javascripts/ace/mode-powershell.js +181 -151
  104. data/vendor/assets/javascripts/ace/mode-praat.js +418 -0
  105. data/vendor/assets/javascripts/ace/mode-prolog.js +27 -63
  106. data/vendor/assets/javascripts/ace/mode-properties.js +20 -48
  107. data/vendor/assets/javascripts/ace/mode-protobuf.js +252 -259
  108. data/vendor/assets/javascripts/ace/mode-python.js +84 -115
  109. data/vendor/assets/javascripts/ace/mode-r.js +105 -140
  110. data/vendor/assets/javascripts/ace/mode-rdoc.js +84 -89
  111. data/vendor/assets/javascripts/ace/mode-rhtml.js +892 -908
  112. data/vendor/assets/javascripts/ace/mode-ruby.js +434 -98
  113. data/vendor/assets/javascripts/ace/mode-rust.js +27 -63
  114. data/vendor/assets/javascripts/ace/mode-sass.js +75 -106
  115. data/vendor/assets/javascripts/ace/mode-scad.js +219 -220
  116. data/vendor/assets/javascripts/ace/mode-scala.js +311 -243
  117. data/vendor/assets/javascripts/ace/mode-scheme.js +24 -60
  118. data/vendor/assets/javascripts/ace/mode-scss.js +250 -251
  119. data/vendor/assets/javascripts/ace/mode-sh.js +506 -118
  120. data/vendor/assets/javascripts/ace/mode-sjs.js +314 -280
  121. data/vendor/assets/javascripts/ace/mode-smarty.js +2474 -0
  122. data/vendor/assets/javascripts/ace/mode-snippets.js +89 -89
  123. data/vendor/assets/javascripts/ace/mode-soy_template.js +792 -811
  124. data/vendor/assets/javascripts/ace/mode-space.js +22 -23
  125. data/vendor/assets/javascripts/ace/mode-sql.js +31 -58
  126. data/vendor/assets/javascripts/ace/mode-stylus.js +161 -197
  127. data/vendor/assets/javascripts/ace/mode-svg.js +906 -836
  128. data/vendor/assets/javascripts/ace/mode-tcl.js +61 -92
  129. data/vendor/assets/javascripts/ace/mode-tex.js +36 -73
  130. data/vendor/assets/javascripts/ace/mode-text.js +1 -0
  131. data/vendor/assets/javascripts/ace/mode-textile.js +41 -72
  132. data/vendor/assets/javascripts/ace/mode-toml.js +26 -62
  133. data/vendor/assets/javascripts/ace/mode-twig.js +1196 -892
  134. data/vendor/assets/javascripts/ace/mode-typescript.js +313 -277
  135. data/vendor/assets/javascripts/ace/mode-vala.js +982 -0
  136. data/vendor/assets/javascripts/ace/mode-vbscript.js +25 -62
  137. data/vendor/assets/javascripts/ace/mode-velocity.js +2251 -1242
  138. data/vendor/assets/javascripts/ace/mode-verilog.js +27 -59
  139. data/vendor/assets/javascripts/ace/mode-vhdl.js +26 -55
  140. data/vendor/assets/javascripts/ace/mode-xml.js +319 -644
  141. data/vendor/assets/javascripts/ace/mode-xquery.js +2503 -588
  142. data/vendor/assets/javascripts/ace/mode-yaml.js +56 -90
  143. data/vendor/assets/javascripts/ace/snippets/abap.js +7 -0
  144. data/vendor/assets/javascripts/ace/snippets/actionscript.js +159 -0
  145. data/vendor/assets/javascripts/ace/snippets/ada.js +7 -0
  146. data/vendor/assets/javascripts/ace/snippets/apache_conf.js +7 -0
  147. data/vendor/assets/javascripts/ace/snippets/applescript.js +7 -0
  148. data/vendor/assets/javascripts/ace/snippets/asciidoc.js +7 -0
  149. data/vendor/assets/javascripts/ace/snippets/assembly_x86.js +7 -0
  150. data/vendor/assets/javascripts/ace/snippets/autohotkey.js +7 -0
  151. data/vendor/assets/javascripts/ace/snippets/batchfile.js +7 -0
  152. data/vendor/assets/javascripts/ace/snippets/c9search.js +7 -0
  153. data/vendor/assets/javascripts/ace/snippets/c_cpp.js +138 -0
  154. data/vendor/assets/javascripts/ace/snippets/cirru.js +7 -0
  155. data/vendor/assets/javascripts/ace/snippets/clojure.js +97 -0
  156. data/vendor/assets/javascripts/ace/snippets/cobol.js +7 -0
  157. data/vendor/assets/javascripts/ace/snippets/coffee.js +102 -0
  158. data/vendor/assets/javascripts/ace/snippets/coldfusion.js +7 -0
  159. data/vendor/assets/javascripts/ace/snippets/csharp.js +7 -0
  160. data/vendor/assets/javascripts/ace/snippets/css.js +974 -0
  161. data/vendor/assets/javascripts/ace/snippets/curly.js +7 -0
  162. data/vendor/assets/javascripts/ace/snippets/d.js +7 -0
  163. data/vendor/assets/javascripts/ace/snippets/dart.js +90 -0
  164. data/vendor/assets/javascripts/ace/snippets/diff.js +18 -0
  165. data/vendor/assets/javascripts/ace/snippets/django.js +115 -0
  166. data/vendor/assets/javascripts/ace/snippets/dockerfile.js +7 -0
  167. data/vendor/assets/javascripts/ace/snippets/dot.js +7 -0
  168. data/vendor/assets/javascripts/ace/snippets/eiffel.js +7 -0
  169. data/vendor/assets/javascripts/ace/snippets/ejs.js +7 -0
  170. data/vendor/assets/javascripts/ace/snippets/erlang.js +167 -0
  171. data/vendor/assets/javascripts/ace/snippets/forth.js +7 -0
  172. data/vendor/assets/javascripts/ace/snippets/ftl.js +7 -0
  173. data/vendor/assets/javascripts/ace/snippets/gcode.js +7 -0
  174. data/vendor/assets/javascripts/ace/snippets/gherkin.js +7 -0
  175. data/vendor/assets/javascripts/ace/snippets/gitignore.js +7 -0
  176. data/vendor/assets/javascripts/ace/snippets/glsl.js +7 -0
  177. data/vendor/assets/javascripts/ace/snippets/golang.js +7 -0
  178. data/vendor/assets/javascripts/ace/snippets/groovy.js +7 -0
  179. data/vendor/assets/javascripts/ace/snippets/haml.js +27 -0
  180. data/vendor/assets/javascripts/ace/snippets/handlebars.js +7 -0
  181. data/vendor/assets/javascripts/ace/snippets/haskell.js +89 -0
  182. data/vendor/assets/javascripts/ace/snippets/haxe.js +7 -0
  183. data/vendor/assets/javascripts/ace/snippets/html.js +835 -0
  184. data/vendor/assets/javascripts/ace/snippets/html_ruby.js +7 -0
  185. data/vendor/assets/javascripts/ace/snippets/ini.js +7 -0
  186. data/vendor/assets/javascripts/ace/snippets/io.js +69 -0
  187. data/vendor/assets/javascripts/ace/snippets/jack.js +7 -0
  188. data/vendor/assets/javascripts/ace/snippets/jade.js +7 -0
  189. data/vendor/assets/javascripts/ace/snippets/java.js +241 -0
  190. data/vendor/assets/javascripts/ace/snippets/javascript.js +189 -0
  191. data/vendor/assets/javascripts/ace/snippets/json.js +7 -0
  192. data/vendor/assets/javascripts/ace/snippets/jsoniq.js +68 -0
  193. data/vendor/assets/javascripts/ace/snippets/jsp.js +106 -0
  194. data/vendor/assets/javascripts/ace/snippets/jsx.js +7 -0
  195. data/vendor/assets/javascripts/ace/snippets/julia.js +7 -0
  196. data/vendor/assets/javascripts/ace/snippets/latex.js +7 -0
  197. data/vendor/assets/javascripts/ace/snippets/less.js +7 -0
  198. data/vendor/assets/javascripts/ace/snippets/liquid.js +7 -0
  199. data/vendor/assets/javascripts/ace/snippets/lisp.js +7 -0
  200. data/vendor/assets/javascripts/ace/snippets/livescript.js +7 -0
  201. data/vendor/assets/javascripts/ace/snippets/logiql.js +7 -0
  202. data/vendor/assets/javascripts/ace/snippets/lsl.js +1073 -0
  203. data/vendor/assets/javascripts/ace/snippets/lua.js +28 -0
  204. data/vendor/assets/javascripts/ace/snippets/luapage.js +7 -0
  205. data/vendor/assets/javascripts/ace/snippets/lucene.js +7 -0
  206. data/vendor/assets/javascripts/ace/snippets/makefile.js +11 -0
  207. data/vendor/assets/javascripts/ace/snippets/markdown.js +95 -0
  208. data/vendor/assets/javascripts/ace/snippets/matlab.js +7 -0
  209. data/vendor/assets/javascripts/ace/snippets/mel.js +7 -0
  210. data/vendor/assets/javascripts/ace/snippets/mushcode.js +7 -0
  211. data/vendor/assets/javascripts/ace/snippets/mysql.js +7 -0
  212. data/vendor/assets/javascripts/ace/snippets/nix.js +7 -0
  213. data/vendor/assets/javascripts/ace/snippets/objectivec.js +7 -0
  214. data/vendor/assets/javascripts/ace/snippets/ocaml.js +7 -0
  215. data/vendor/assets/javascripts/ace/snippets/pascal.js +7 -0
  216. data/vendor/assets/javascripts/ace/snippets/perl.js +354 -0
  217. data/vendor/assets/javascripts/ace/snippets/pgsql.js +7 -0
  218. data/vendor/assets/javascripts/ace/snippets/php.js +283 -0
  219. data/vendor/assets/javascripts/ace/snippets/plain_text.js +7 -0
  220. data/vendor/assets/javascripts/ace/snippets/powershell.js +7 -0
  221. data/vendor/assets/javascripts/ace/snippets/praat.js +7 -0
  222. data/vendor/assets/javascripts/ace/snippets/prolog.js +7 -0
  223. data/vendor/assets/javascripts/ace/snippets/properties.js +7 -0
  224. data/vendor/assets/javascripts/ace/snippets/protobuf.js +7 -0
  225. data/vendor/assets/javascripts/ace/snippets/python.js +165 -0
  226. data/vendor/assets/javascripts/ace/snippets/r.js +128 -0
  227. data/vendor/assets/javascripts/ace/snippets/rdoc.js +7 -0
  228. data/vendor/assets/javascripts/ace/snippets/rhtml.js +7 -0
  229. data/vendor/assets/javascripts/ace/snippets/ruby.js +935 -0
  230. data/vendor/assets/javascripts/ace/snippets/rust.js +7 -0
  231. data/vendor/assets/javascripts/ace/snippets/sass.js +7 -0
  232. data/vendor/assets/javascripts/ace/snippets/scad.js +7 -0
  233. data/vendor/assets/javascripts/ace/snippets/scala.js +7 -0
  234. data/vendor/assets/javascripts/ace/snippets/scheme.js +7 -0
  235. data/vendor/assets/javascripts/ace/snippets/scss.js +7 -0
  236. data/vendor/assets/javascripts/ace/snippets/sh.js +90 -0
  237. data/vendor/assets/javascripts/ace/snippets/sjs.js +7 -0
  238. data/vendor/assets/javascripts/ace/snippets/smarty.js +7 -0
  239. data/vendor/assets/javascripts/ace/snippets/snippets.js +16 -0
  240. data/vendor/assets/javascripts/ace/snippets/soy_template.js +7 -0
  241. data/vendor/assets/javascripts/ace/snippets/space.js +7 -0
  242. data/vendor/assets/javascripts/ace/snippets/sql.js +33 -0
  243. data/vendor/assets/javascripts/ace/snippets/stylus.js +7 -0
  244. data/vendor/assets/javascripts/ace/snippets/svg.js +7 -0
  245. data/vendor/assets/javascripts/ace/snippets/tcl.js +99 -0
  246. data/vendor/assets/javascripts/ace/snippets/tex.js +197 -0
  247. data/vendor/assets/javascripts/ace/snippets/text.js +7 -0
  248. data/vendor/assets/javascripts/ace/snippets/textile.js +37 -0
  249. data/vendor/assets/javascripts/ace/snippets/toml.js +7 -0
  250. data/vendor/assets/javascripts/ace/snippets/twig.js +7 -0
  251. data/vendor/assets/javascripts/ace/snippets/typescript.js +7 -0
  252. data/vendor/assets/javascripts/ace/snippets/vala.js +193 -0
  253. data/vendor/assets/javascripts/ace/snippets/vbscript.js +7 -0
  254. data/vendor/assets/javascripts/ace/snippets/velocity.js +36 -0
  255. data/vendor/assets/javascripts/ace/snippets/verilog.js +7 -0
  256. data/vendor/assets/javascripts/ace/snippets/vhdl.js +7 -0
  257. data/vendor/assets/javascripts/ace/snippets/xml.js +7 -0
  258. data/vendor/assets/javascripts/ace/snippets/xquery.js +68 -0
  259. data/vendor/assets/javascripts/ace/snippets/yaml.js +7 -0
  260. data/vendor/assets/javascripts/ace/theme-ambiance.js +4 -24
  261. data/vendor/assets/javascripts/ace/theme-chaos.js +2 -25
  262. data/vendor/assets/javascripts/ace/theme-chrome.js +2 -31
  263. data/vendor/assets/javascripts/ace/theme-clouds.js +1 -31
  264. data/vendor/assets/javascripts/ace/theme-clouds_midnight.js +1 -31
  265. data/vendor/assets/javascripts/ace/theme-cobalt.js +1 -31
  266. data/vendor/assets/javascripts/ace/theme-crimson_editor.js +1 -31
  267. data/vendor/assets/javascripts/ace/theme-dawn.js +1 -31
  268. data/vendor/assets/javascripts/ace/theme-dreamweaver.js +5 -31
  269. data/vendor/assets/javascripts/ace/theme-eclipse.js +7 -33
  270. data/vendor/assets/javascripts/ace/theme-github.js +2 -35
  271. data/vendor/assets/javascripts/ace/theme-idle_fingers.js +1 -31
  272. data/vendor/assets/javascripts/ace/theme-katzenmilch.js +119 -0
  273. data/vendor/assets/javascripts/ace/theme-kr.js +1 -31
  274. data/vendor/assets/javascripts/ace/theme-kr_theme.js +57 -141
  275. data/vendor/assets/javascripts/ace/theme-kuroir.js +59 -0
  276. data/vendor/assets/javascripts/ace/theme-merbivore.js +1 -31
  277. data/vendor/assets/javascripts/ace/theme-merbivore_soft.js +1 -31
  278. data/vendor/assets/javascripts/ace/theme-mono_industrial.js +1 -31
  279. data/vendor/assets/javascripts/ace/theme-monokai.js +1 -31
  280. data/vendor/assets/javascripts/ace/theme-pastel_on_dark.js +1 -31
  281. data/vendor/assets/javascripts/ace/theme-solarized_dark.js +1 -31
  282. data/vendor/assets/javascripts/ace/theme-solarized_light.js +1 -31
  283. data/vendor/assets/javascripts/ace/theme-terminal.js +1 -31
  284. data/vendor/assets/javascripts/ace/theme-textmate.js +3 -32
  285. data/vendor/assets/javascripts/ace/theme-tomorrow.js +1 -31
  286. data/vendor/assets/javascripts/ace/theme-tomorrow_night.js +1 -31
  287. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue.js +1 -31
  288. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright.js +1 -31
  289. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties.js +1 -31
  290. data/vendor/assets/javascripts/ace/theme-twilight.js +1 -31
  291. data/vendor/assets/javascripts/ace/theme-vibrant_ink.js +1 -31
  292. data/vendor/assets/javascripts/ace/theme-xcode.js +2 -33
  293. data/vendor/assets/javascripts/ace/worker-coffee.js +5026 -5008
  294. data/vendor/assets/javascripts/ace/worker-css.js +5489 -5134
  295. data/vendor/assets/javascripts/ace/worker-html.js +11517 -0
  296. data/vendor/assets/javascripts/ace/worker-javascript.js +9810 -9501
  297. data/vendor/assets/javascripts/ace/worker-json.js +1583 -1564
  298. data/vendor/assets/javascripts/ace/worker-lua.js +2631 -2612
  299. data/vendor/assets/javascripts/ace/worker-php.js +2385 -2341
  300. data/vendor/assets/javascripts/ace/worker-xquery.js +31643 -3993
  301. metadata +147 -11
@@ -1,62 +1,5 @@
1
- define('ace/mode/dot', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/matching_brace_outdent', 'ace/mode/dot_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) {
2
-
3
-
4
- var oop = require("../lib/oop");
5
- var TextMode = require("./text").Mode;
6
- var Tokenizer = require("../tokenizer").Tokenizer;
7
- var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
8
- var DotHighlightRules = require("./dot_highlight_rules").DotHighlightRules;
9
- var DotFoldMode = require("./folding/cstyle").FoldMode;
10
-
11
- var Mode = function() {
12
- this.HighlightRules = DotHighlightRules;
13
- this.$outdent = new MatchingBraceOutdent();
14
- this.foldingRules = new DotFoldMode();
15
- };
16
- oop.inherits(Mode, TextMode);
17
-
18
- (function() {
19
-
20
- this.lineCommentStart = ["//", "#"];
21
- this.blockComment = {start: "/*", end: "*/"};
22
-
23
- this.getNextLineIndent = function(state, line, tab) {
24
- var indent = this.$getIndent(line);
25
-
26
- var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
27
- var tokens = tokenizedLine.tokens;
28
- var endState = tokenizedLine.state;
29
-
30
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
31
- return indent;
32
- }
33
-
34
- if (state == "start") {
35
- var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
36
- if (match) {
37
- indent += tab;
38
- }
39
- }
40
-
41
- return indent;
42
- };
43
-
44
- this.checkOutdent = function(state, line, input) {
45
- return this.$outdent.checkOutdent(line, input);
46
- };
47
-
48
- this.autoOutdent = function(state, doc, row) {
49
- this.$outdent.autoOutdent(doc, row);
50
- };
51
-
52
- this.$id = "ace/mode/dot";
53
- }).call(Mode.prototype);
54
-
55
- exports.Mode = Mode;
56
- });
57
-
58
- define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
59
-
1
+ define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
2
+ "use strict";
60
3
 
61
4
  var Range = require("../range").Range;
62
5
 
@@ -94,8 +37,53 @@ var MatchingBraceOutdent = function() {};
94
37
 
95
38
  exports.MatchingBraceOutdent = MatchingBraceOutdent;
96
39
  });
97
- define('ace/mode/dot_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules', 'ace/mode/doc_comment_highlight_rules'], function(require, exports, module) {
98
40
 
41
+ define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
42
+ "use strict";
43
+
44
+ var oop = require("../lib/oop");
45
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
46
+
47
+ var DocCommentHighlightRules = function() {
48
+
49
+ this.$rules = {
50
+ "start" : [ {
51
+ token : "comment.doc.tag",
52
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
53
+ }, {
54
+ token : "comment.doc.tag",
55
+ regex : "\\bTODO\\b"
56
+ }, {
57
+ defaultToken : "comment.doc"
58
+ }]
59
+ };
60
+ };
61
+
62
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
63
+
64
+ DocCommentHighlightRules.getStartRule = function(start) {
65
+ return {
66
+ token : "comment.doc", // doc comment
67
+ regex : "\\/\\*(?=\\*)",
68
+ next : start
69
+ };
70
+ };
71
+
72
+ DocCommentHighlightRules.getEndRule = function (start) {
73
+ return {
74
+ token : "comment.doc", // closing comment
75
+ regex : "\\*\\/",
76
+ next : start
77
+ };
78
+ };
79
+
80
+
81
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
82
+
83
+ });
84
+
85
+ define("ace/mode/dot_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/doc_comment_highlight_rules"], function(require, exports, module) {
86
+ "use strict";
99
87
 
100
88
  var oop = require("../lib/oop");
101
89
  var lang = require("../lib/lang");
@@ -221,52 +209,8 @@ exports.DotHighlightRules = DotHighlightRules;
221
209
 
222
210
  });
223
211
 
224
- define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
225
-
226
-
227
- var oop = require("../lib/oop");
228
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
229
-
230
- var DocCommentHighlightRules = function() {
231
-
232
- this.$rules = {
233
- "start" : [ {
234
- token : "comment.doc.tag",
235
- regex : "@[\\w\\d_]+" // TODO: fix email addresses
236
- }, {
237
- token : "comment.doc.tag",
238
- regex : "\\bTODO\\b"
239
- }, {
240
- defaultToken : "comment.doc"
241
- }]
242
- };
243
- };
244
-
245
- oop.inherits(DocCommentHighlightRules, TextHighlightRules);
246
-
247
- DocCommentHighlightRules.getStartRule = function(start) {
248
- return {
249
- token : "comment.doc", // doc comment
250
- regex : "\\/\\*(?=\\*)",
251
- next : start
252
- };
253
- };
254
-
255
- DocCommentHighlightRules.getEndRule = function (start) {
256
- return {
257
- token : "comment.doc", // closing comment
258
- regex : "\\*\\/",
259
- next : start
260
- };
261
- };
262
-
263
-
264
- exports.DocCommentHighlightRules = DocCommentHighlightRules;
265
-
266
- });
267
-
268
- define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
269
-
212
+ define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
213
+ "use strict";
270
214
 
271
215
  var oop = require("../../lib/oop");
272
216
  var Range = require("../../range").Range;
@@ -359,3 +303,59 @@ oop.inherits(FoldMode, BaseFoldMode);
359
303
  }).call(FoldMode.prototype);
360
304
 
361
305
  });
306
+
307
+ define("ace/mode/dot",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/matching_brace_outdent","ace/mode/dot_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) {
308
+ "use strict";
309
+
310
+ var oop = require("../lib/oop");
311
+ var TextMode = require("./text").Mode;
312
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
313
+ var DotHighlightRules = require("./dot_highlight_rules").DotHighlightRules;
314
+ var DotFoldMode = require("./folding/cstyle").FoldMode;
315
+
316
+ var Mode = function() {
317
+ this.HighlightRules = DotHighlightRules;
318
+ this.$outdent = new MatchingBraceOutdent();
319
+ this.foldingRules = new DotFoldMode();
320
+ };
321
+ oop.inherits(Mode, TextMode);
322
+
323
+ (function() {
324
+
325
+ this.lineCommentStart = ["//", "#"];
326
+ this.blockComment = {start: "/*", end: "*/"};
327
+
328
+ this.getNextLineIndent = function(state, line, tab) {
329
+ var indent = this.$getIndent(line);
330
+
331
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
332
+ var tokens = tokenizedLine.tokens;
333
+ var endState = tokenizedLine.state;
334
+
335
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
336
+ return indent;
337
+ }
338
+
339
+ if (state == "start") {
340
+ var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
341
+ if (match) {
342
+ indent += tab;
343
+ }
344
+ }
345
+
346
+ return indent;
347
+ };
348
+
349
+ this.checkOutdent = function(state, line, input) {
350
+ return this.$outdent.checkOutdent(line, input);
351
+ };
352
+
353
+ this.autoOutdent = function(state, doc, row) {
354
+ this.$outdent.autoOutdent(doc, row);
355
+ };
356
+
357
+ this.$id = "ace/mode/dot";
358
+ }).call(Mode.prototype);
359
+
360
+ exports.Mode = Mode;
361
+ });
@@ -0,0 +1,135 @@
1
+ define("ace/mode/eiffel_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 EiffelHighlightRules = function() {
8
+ var keywords = "across|agent|alias|all|attached|as|assign|attribute|check|" +
9
+ "class|convert|create|debug|deferred|detachable|do|else|elseif|end|" +
10
+ "ensure|expanded|export|external|feature|from|frozen|if|inherit|" +
11
+ "inspect|invariant|like|local|loop|not|note|obsolete|old|once|" +
12
+ "Precursor|redefine|rename|require|rescue|retry|select|separate|" +
13
+ "some|then|undefine|until|variant|when";
14
+
15
+ var operatorKeywords = "and|implies|or|xor";
16
+
17
+ var languageConstants = "Void";
18
+
19
+ var booleanConstants = "True|False";
20
+
21
+ var languageVariables = "Current|Result";
22
+
23
+ var keywordMapper = this.createKeywordMapper({
24
+ "constant.language": languageConstants,
25
+ "constant.language.boolean": booleanConstants,
26
+ "variable.language": languageVariables,
27
+ "keyword.operator": operatorKeywords,
28
+ "keyword": keywords
29
+ }, "identifier", true);
30
+
31
+ this.$rules = {
32
+ "start": [{
33
+ token : "comment.line.double-dash",
34
+ regex : /--.*$/
35
+ }, {
36
+ token : "string.quoted.double",
37
+ regex : /"(?:%"|[^%])*?"/
38
+ }, {
39
+ token : "string.quoted.other", // "[ ]" aligned verbatim string
40
+ regex : /"\[/,
41
+ next: "aligned_verbatim_string"
42
+ }, {
43
+ token : "string.quoted.other", // "{ }" non-aligned verbatim string
44
+ regex : /"\{/,
45
+ next: "non-aligned_verbatim_string"
46
+ }, {
47
+ token : "constant.character",
48
+ regex : /'(?:%%|%T|%R|%N|%F|%'|[^%])'/
49
+ }, {
50
+ token : "constant.numeric", // real
51
+ regex : /(?:\d(?:_?\d)*\.|\.\d)(?:\d*[eE][+-]?\d+)?\b/
52
+ }, {
53
+ token : "constant.numeric", // integer
54
+ regex : /\d(?:_?\d)*\b/
55
+ }, {
56
+ token : "constant.numeric", // hex
57
+ regex : /0[xX][a-fA-F\d](?:_?[a-fA-F\d])*\b/
58
+ }, {
59
+ token : "constant.numeric", // octal
60
+ regex : /0[cC][0-7](?:_?[0-7])*\b/
61
+ },{
62
+ token : "constant.numeric", // bin
63
+ regex : /0[bB][01](?:_?[01])*\b/
64
+ }, {
65
+ token : "keyword.operator",
66
+ regex : /\+|\-|\*|\/|\\\\|\/\/|\^|~|\/~|<|>|<=|>=|\/=|=|:=|\|\.\.\||\.\./
67
+ }, {
68
+ token : "keyword.operator", // punctuation
69
+ regex : /\.|:|,|;\b/
70
+ }, {
71
+ token : function (v) {
72
+ var result = keywordMapper (v);
73
+ if (result === "identifier" && v === v.toUpperCase ()) {
74
+ result = "entity.name.type";
75
+ }
76
+ return result;
77
+ },
78
+ regex : /[a-zA-Z][a-zA-Z\d_]*\b/
79
+ }, {
80
+ token : "paren.lparen",
81
+ regex : /[\[({]/
82
+ }, {
83
+ token : "paren.rparen",
84
+ regex : /[\])}]/
85
+ }, {
86
+ token : "text",
87
+ regex : /\s+/
88
+ }
89
+ ],
90
+ "aligned_verbatim_string" : [{
91
+ token : "string", // closing multi-line comment
92
+ regex : /]"/,
93
+ next : "start"
94
+ }, {
95
+ token : "string", // comment spanning whole line
96
+ regex : /[^(?:\]")]+/
97
+ }
98
+ ],
99
+ "non-aligned_verbatim_string" : [{
100
+ token : "string.quoted.other", // closing multi-line comment
101
+ regex : /}"/,
102
+ next : "start"
103
+ }, {
104
+ token : "string.quoted.other", // comment spanning whole line
105
+ regex : /[^(?:\}")]+/
106
+ }
107
+ ]};
108
+ };
109
+
110
+ oop.inherits(EiffelHighlightRules, TextHighlightRules);
111
+
112
+ exports.EiffelHighlightRules = EiffelHighlightRules;
113
+ });
114
+
115
+ define("ace/mode/eiffel",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/eiffel_highlight_rules","ace/range"], function(require, exports, module) {
116
+ "use strict";
117
+
118
+ var oop = require("../lib/oop");
119
+ var TextMode = require("./text").Mode;
120
+ var EiffelHighlightRules = require("./eiffel_highlight_rules").EiffelHighlightRules;
121
+ var Range = require("../range").Range;
122
+
123
+ var Mode = function() {
124
+ this.HighlightRules = EiffelHighlightRules;
125
+ };
126
+ oop.inherits(Mode, TextMode);
127
+
128
+ (function() {
129
+ this.lineCommentStart = "--";
130
+ this.$id = "ace/mode/eiffel";
131
+ }).call(Mode.prototype);
132
+
133
+ exports.Mode = Mode;
134
+
135
+ });
@@ -1,210 +1,5 @@
1
- /* ***** BEGIN LICENSE BLOCK *****
2
- * Distributed under the BSD license:
3
- *
4
- * Copyright (c) 2012, Ajax.org B.V.
5
- * All rights reserved.
6
- *
7
- * Redistribution and use in source and binary forms, with or without
8
- * modification, are permitted provided that the following conditions are met:
9
- * * Redistributions of source code must retain the above copyright
10
- * notice, this list of conditions and the following disclaimer.
11
- * * Redistributions in binary form must reproduce the above copyright
12
- * notice, this list of conditions and the following disclaimer in the
13
- * documentation and/or other materials provided with the distribution.
14
- * * Neither the name of Ajax.org B.V. nor the
15
- * names of its contributors may be used to endorse or promote products
16
- * derived from this software without specific prior written permission.
17
- *
18
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
22
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
- *
29
- * ***** END LICENSE BLOCK ***** */
30
-
31
-
32
- define('ace/mode/ejs', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/tokenizer', 'ace/mode/html', 'ace/mode/javascript', 'ace/mode/css', 'ace/mode/ruby'], function(require, exports, module) {
33
-
34
-
35
- var oop = require("../lib/oop");
36
- var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
37
- var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
38
-
39
- var EjsHighlightRules = function(start, end) {
40
- HtmlHighlightRules.call(this);
41
-
42
- if (!start)
43
- start = "(?:<%|<\\?|{{)";
44
- if (!end)
45
- end = "(?:%>|\\?>|}})";
46
-
47
- for (var i in this.$rules) {
48
- this.$rules[i].unshift({
49
- token : "markup.list.meta.tag",
50
- regex : start + "(?![>}])[-=]?",
51
- push : "ejs-start"
52
- });
53
- }
54
-
55
- this.embedRules(JavaScriptHighlightRules, "ejs-");
56
-
57
- this.$rules["ejs-start"].unshift({
58
- token : "markup.list.meta.tag",
59
- regex : "-?" + end,
60
- next : "pop"
61
- }, {
62
- token: "comment",
63
- regex: "//.*?" + end,
64
- next: "pop"
65
- });
66
-
67
- this.$rules["ejs-no_regex"].unshift({
68
- token : "markup.list.meta.tag",
69
- regex : "-?" + end,
70
- next : "pop"
71
- }, {
72
- token: "comment",
73
- regex: "//.*?" + end,
74
- next: "pop"
75
- });
76
-
77
- this.normalizeRules();
78
- };
79
-
80
-
81
- oop.inherits(EjsHighlightRules, HtmlHighlightRules);
82
-
83
- exports.EjsHighlightRules = EjsHighlightRules;
84
-
85
-
86
- var oop = require("../lib/oop");
87
- var Tokenizer = require("../tokenizer").Tokenizer;
88
- var HtmlMode = require("./html").Mode;
89
- var JavaScriptMode = require("./javascript").Mode;
90
- var CssMode = require("./css").Mode;
91
- var RubyMode = require("./ruby").Mode;
92
-
93
- var Mode = function() {
94
- HtmlMode.call(this);
95
- this.HighlightRules = EjsHighlightRules;
96
- this.createModeDelegates({
97
- "js-": JavaScriptMode,
98
- "css-": CssMode,
99
- "ejs-": JavaScriptMode
100
- });
101
- };
102
- oop.inherits(Mode, HtmlMode);
103
-
104
- (function() {
105
-
106
- this.$id = "ace/mode/ejs";
107
- }).call(Mode.prototype);
108
-
109
- exports.Mode = Mode;
110
- });
111
-
112
- 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) {
113
-
114
-
115
- var oop = require("../lib/oop");
116
- var lang = require("../lib/lang");
117
- var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
118
- var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
119
- var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
120
-
121
- var tagMap = lang.createMap({
122
- a : 'anchor',
123
- button : 'form',
124
- form : 'form',
125
- img : 'image',
126
- input : 'form',
127
- label : 'form',
128
- option : 'form',
129
- script : 'script',
130
- select : 'form',
131
- textarea : 'form',
132
- style : 'style',
133
- table : 'table',
134
- tbody : 'table',
135
- td : 'table',
136
- tfoot : 'table',
137
- th : 'table',
138
- tr : 'table'
139
- });
140
-
141
- var HtmlHighlightRules = function() {
142
- XmlHighlightRules.call(this);
143
-
144
- this.addRules({
145
- attributes: [{
146
- include : "space"
147
- }, {
148
- token : "entity.other.attribute-name",
149
- regex : "[-_a-zA-Z0-9:]+"
150
- }, {
151
- token : "keyword.operator.separator",
152
- regex : "=",
153
- push : [{
154
- include: "space"
155
- }, {
156
- token : "string",
157
- regex : "[^<>='\"`\\s]+",
158
- next : "pop"
159
- }, {
160
- token : "empty",
161
- regex : "",
162
- next : "pop"
163
- }]
164
- }, {
165
- include : "string"
166
- }],
167
- tag: [{
168
- token : function(start, tag) {
169
- var group = tagMap[tag];
170
- return ["meta.tag.punctuation.begin",
171
- "meta.tag.name" + (group ? "." + group : "")];
172
- },
173
- regex : "(<)([-_a-zA-Z0-9:]+)",
174
- next: "start_tag_stuff"
175
- }, {
176
- token : function(start, tag) {
177
- var group = tagMap[tag];
178
- return ["meta.tag.punctuation.begin",
179
- "meta.tag.name" + (group ? "." + group : "")];
180
- },
181
- regex : "(</)([-_a-zA-Z0-9:]+)",
182
- next: "end_tag_stuff"
183
- }],
184
- start_tag_stuff: [
185
- {include : "attributes"},
186
- {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"}
187
- ],
188
- end_tag_stuff: [
189
- {include : "space"},
190
- {token : "meta.tag.punctuation.end", regex : ">", next : "start"}
191
- ]
192
- });
193
-
194
- this.embedTagRules(CssHighlightRules, "css-", "style");
195
- this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
196
-
197
- if (this.constructor === HtmlHighlightRules)
198
- this.normalizeRules();
199
- };
200
-
201
- oop.inherits(HtmlHighlightRules, XmlHighlightRules);
202
-
203
- exports.HtmlHighlightRules = HtmlHighlightRules;
204
- });
205
-
206
- define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
207
-
1
+ define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
2
+ "use strict";
208
3
 
209
4
  var oop = require("../lib/oop");
210
5
  var lang = require("../lib/lang");
@@ -347,14 +142,58 @@ exports.CssHighlightRules = CssHighlightRules;
347
142
 
348
143
  });
349
144
 
350
- 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) {
145
+ define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
146
+ "use strict";
147
+
148
+ var oop = require("../lib/oop");
149
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
150
+
151
+ var DocCommentHighlightRules = function() {
152
+
153
+ this.$rules = {
154
+ "start" : [ {
155
+ token : "comment.doc.tag",
156
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
157
+ }, {
158
+ token : "comment.doc.tag",
159
+ regex : "\\bTODO\\b"
160
+ }, {
161
+ defaultToken : "comment.doc"
162
+ }]
163
+ };
164
+ };
165
+
166
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
167
+
168
+ DocCommentHighlightRules.getStartRule = function(start) {
169
+ return {
170
+ token : "comment.doc", // doc comment
171
+ regex : "\\/\\*(?=\\*)",
172
+ next : start
173
+ };
174
+ };
175
+
176
+ DocCommentHighlightRules.getEndRule = function (start) {
177
+ return {
178
+ token : "comment.doc", // closing comment
179
+ regex : "\\*\\/",
180
+ next : start
181
+ };
182
+ };
183
+
184
+
185
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
186
+
187
+ });
351
188
 
189
+ 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) {
190
+ "use strict";
352
191
 
353
192
  var oop = require("../lib/oop");
354
193
  var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
355
194
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
356
195
 
357
- var JavaScriptHighlightRules = function() {
196
+ var JavaScriptHighlightRules = function(options) {
358
197
  var keywordMapper = this.createKeywordMapper({
359
198
  "variable.language":
360
199
  "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
@@ -479,19 +318,22 @@ var JavaScriptHighlightRules = function() {
479
318
  }, {
480
319
  token : ["punctuation.operator", "support.constant"],
481
320
  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/
321
+ }, {
322
+ token : ["support.constant"],
323
+ regex : /that\b/
482
324
  }, {
483
325
  token : ["storage.type", "punctuation.operator", "support.function.firebug"],
484
- regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
326
+ regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
485
327
  }, {
486
328
  token : keywordMapper,
487
329
  regex : identifierRe
488
330
  }, {
489
331
  token : "keyword.operator",
490
- regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
332
+ regex : /--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
491
333
  next : "start"
492
334
  }, {
493
335
  token : "punctuation.operator",
494
- regex : /\?|\:|\,|\;|\./,
336
+ regex : /[?:,;.]/,
495
337
  next : "start"
496
338
  }, {
497
339
  token : "paren.lparen",
@@ -500,10 +342,6 @@ var JavaScriptHighlightRules = function() {
500
342
  }, {
501
343
  token : "paren.rparen",
502
344
  regex : /[\])}]/
503
- }, {
504
- token : "keyword.operator",
505
- regex : /\/=?/,
506
- next : "start"
507
345
  }, {
508
346
  token: "comment",
509
347
  regex: /^#!.*$/
@@ -564,7 +402,7 @@ var JavaScriptHighlightRules = function() {
564
402
  ],
565
403
  "regex_character_class": [
566
404
  {
567
- token: "regexp.keyword.operator",
405
+ token: "regexp.charclass.keyword.operator",
568
406
  regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
569
407
  }, {
570
408
  token: "constant.language.escape",
@@ -646,9 +484,49 @@ var JavaScriptHighlightRules = function() {
646
484
  }
647
485
  ]
648
486
  };
649
-
487
+
488
+
489
+ if (!options || !options.noES6) {
490
+ this.$rules.no_regex.unshift({
491
+ regex: "[{}]", onMatch: function(val, state, stack) {
492
+ this.next = val == "{" ? this.nextState : "";
493
+ if (val == "{" && stack.length) {
494
+ stack.unshift("start", state);
495
+ return "paren";
496
+ }
497
+ if (val == "}" && stack.length) {
498
+ stack.shift();
499
+ this.next = stack.shift();
500
+ if (this.next.indexOf("string") != -1)
501
+ return "paren.quasi.end";
502
+ }
503
+ return val == "{" ? "paren.lparen" : "paren.rparen";
504
+ },
505
+ nextState: "start"
506
+ }, {
507
+ token : "string.quasi.start",
508
+ regex : /`/,
509
+ push : [{
510
+ token : "constant.language.escape",
511
+ regex : escapedRe
512
+ }, {
513
+ token : "paren.quasi.start",
514
+ regex : /\${/,
515
+ push : "start"
516
+ }, {
517
+ token : "string.quasi.end",
518
+ regex : /`/,
519
+ next : "pop"
520
+ }, {
521
+ defaultToken: "string.quasi"
522
+ }]
523
+ });
524
+ }
525
+
650
526
  this.embedRules(DocCommentHighlightRules, "doc-",
651
527
  [ DocCommentHighlightRules.getEndRule("no_regex") ]);
528
+
529
+ this.normalizeRules();
652
530
  };
653
531
 
654
532
  oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@@ -656,111 +534,81 @@ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
656
534
  exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
657
535
  });
658
536
 
659
- define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
660
-
537
+ define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
538
+ "use strict";
661
539
 
662
540
  var oop = require("../lib/oop");
663
541
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
664
542
 
665
- var DocCommentHighlightRules = function() {
666
-
543
+ var XmlHighlightRules = function(normalize) {
667
544
  this.$rules = {
668
- "start" : [ {
669
- token : "comment.doc.tag",
670
- regex : "@[\\w\\d_]+" // TODO: fix email addresses
545
+ start : [
546
+ {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
547
+ {
548
+ token : ["punctuation.xml-decl.xml", "keyword.xml-decl.xml"],
549
+ regex : "(<\\?)(xml)(?=[\\s])", next : "xml_decl", caseInsensitive: true
550
+ },
551
+ {
552
+ token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
553
+ regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "processing_instruction",
554
+ },
555
+ {token : "comment.xml", regex : "<\\!--", next : "comment"},
556
+ {
557
+ token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
558
+ regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
559
+ },
560
+ {include : "tag"},
561
+ {token : "text.end-tag-open.xml", regex: "</"},
562
+ {token : "text.tag-open.xml", regex: "<"},
563
+ {include : "reference"},
564
+ {defaultToken : "text.xml"}
565
+ ],
566
+
567
+ xml_decl : [{
568
+ token : "entity.other.attribute-name.decl-attribute-name.xml",
569
+ regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
671
570
  }, {
672
- token : "comment.doc.tag",
673
- regex : "\\bTODO\\b"
571
+ token : "keyword.operator.decl-attribute-equals.xml",
572
+ regex : "="
674
573
  }, {
675
- defaultToken : "comment.doc"
676
- }]
677
- };
678
- };
574
+ include: "whitespace"
575
+ }, {
576
+ include: "string"
577
+ }, {
578
+ token : "punctuation.xml-decl.xml",
579
+ regex : "\\?>",
580
+ next : "start"
581
+ }],
679
582
 
680
- oop.inherits(DocCommentHighlightRules, TextHighlightRules);
681
-
682
- DocCommentHighlightRules.getStartRule = function(start) {
683
- return {
684
- token : "comment.doc", // doc comment
685
- regex : "\\/\\*(?=\\*)",
686
- next : start
687
- };
688
- };
689
-
690
- DocCommentHighlightRules.getEndRule = function (start) {
691
- return {
692
- token : "comment.doc", // closing comment
693
- regex : "\\*\\/",
694
- next : start
695
- };
696
- };
697
-
698
-
699
- exports.DocCommentHighlightRules = DocCommentHighlightRules;
700
-
701
- });
702
-
703
- define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
704
-
705
-
706
- var oop = require("../lib/oop");
707
- var xmlUtil = require("./xml_util");
708
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
709
-
710
- var XmlHighlightRules = function(normalize) {
711
- this.$rules = {
712
- start : [
713
- {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"},
714
- {
715
- token : ["punctuation.instruction.begin", "keyword.instruction"],
716
- regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration"
717
- },
718
- {
719
- token : ["punctuation.instruction.begin", "keyword.instruction"],
720
- regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction"
721
- },
722
- {token : "comment", regex : "<\\!--", next : "comment"},
723
- {
724
- token : ["punctuation.doctype.begin", "meta.tag.doctype"],
725
- regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype"
726
- },
727
- {include : "tag"},
728
- {include : "reference"}
729
- ],
730
-
731
- xml_declaration : [
732
- {include : "attributes"},
733
- {include : "instruction"}
734
- ],
735
-
736
- instruction : [
737
- {token : "punctuation.instruction.end", regex : "\\?>", next : "start"}
738
- ],
583
+ processing_instruction : [
584
+ {token : "punctuation.instruction.xml", regex : "\\?>", next : "start"},
585
+ {defaultToken : "instruction.xml"}
586
+ ],
739
587
 
740
588
  doctype : [
741
- {include : "space"},
589
+ {include : "whitespace"},
742
590
  {include : "string"},
743
- {token : "punctuation.doctype.end", regex : ">", next : "start"},
744
- {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"},
745
- {token : "punctuation.begin", regex : "\\[", push : "declarations"}
591
+ {token : "xml-pe.doctype.xml", regex : ">", next : "start"},
592
+ {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
593
+ {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
746
594
  ],
747
595
 
748
- declarations : [{
749
- token : "text",
596
+ int_subset : [{
597
+ token : "text.xml",
750
598
  regex : "\\s+"
751
599
  }, {
752
- token: "punctuation.end",
600
+ token: "punctuation.int-subset.xml",
753
601
  regex: "]",
754
602
  next: "pop"
755
603
  }, {
756
- token : ["punctuation.begin", "keyword"],
604
+ token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
757
605
  regex : "(<\\!)([-_a-zA-Z0-9]+)",
758
606
  push : [{
759
607
  token : "text",
760
608
  regex : "\\s+"
761
609
  },
762
610
  {
763
- token : "punctuation.end",
611
+ token : "punctuation.markup-decl.xml",
764
612
  regex : ">",
765
613
  next : "pop"
766
614
  },
@@ -768,75 +616,85 @@ var XmlHighlightRules = function(normalize) {
768
616
  }],
769
617
 
770
618
  cdata : [
771
- {token : "string.end", regex : "\\]\\]>", next : "start"},
772
- {token : "text", regex : "\\s+"},
773
- {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"}
619
+ {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
620
+ {token : "text.xml", regex : "\\s+"},
621
+ {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
774
622
  ],
775
623
 
776
624
  comment : [
777
- {token : "comment", regex : "-->", next : "start"},
778
- {defaultToken : "comment"}
625
+ {token : "comment.xml", regex : "-->", next : "start"},
626
+ {defaultToken : "comment.xml"}
779
627
  ],
780
628
 
629
+ reference : [{
630
+ token : "constant.language.escape.reference.xml",
631
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
632
+ }],
633
+
634
+ attr_reference : [{
635
+ token : "constant.language.escape.reference.attribute-value.xml",
636
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
637
+ }],
638
+
781
639
  tag : [{
782
- token : ["meta.tag.punctuation.begin", "meta.tag.name"],
783
- regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
640
+ token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
641
+ regex : "(?:(<)|(</))((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
784
642
  next: [
785
643
  {include : "attributes"},
786
- {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"}
787
- ]
788
- }, {
789
- token : ["meta.tag.punctuation.begin", "meta.tag.name"],
790
- regex : "(</)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
791
- next: [
792
- {include : "space"},
793
- {token : "meta.tag.punctuation.end", regex : ">", next : "start"}
644
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
794
645
  ]
795
646
  }],
796
647
 
797
- space : [
798
- {token : "text", regex : "\\s+"}
648
+ tag_whitespace : [
649
+ {token : "text.tag-whitespace.xml", regex : "\\s+"}
650
+ ],
651
+ whitespace : [
652
+ {token : "text.whitespace.xml", regex : "\\s+"}
799
653
  ],
800
-
801
- reference : [{
802
- token : "constant.language.escape",
803
- regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
804
- }, {
805
- token : "text", regex : "&"
806
- }],
807
-
808
654
  string: [{
809
- token : "string",
655
+ token : "string.xml",
810
656
  regex : "'",
811
- push : "qstring_inner"
657
+ push : [
658
+ {token : "string.xml", regex: "'", next: "pop"},
659
+ {defaultToken : "string.xml"}
660
+ ]
812
661
  }, {
813
- token : "string",
662
+ token : "string.xml",
814
663
  regex : '"',
815
- push : "qqstring_inner"
664
+ push : [
665
+ {token : "string.xml", regex: '"', next: "pop"},
666
+ {defaultToken : "string.xml"}
667
+ ]
816
668
  }],
817
669
 
818
- qstring_inner: [
819
- {token : "string", regex: "'", next: "pop"},
820
- {include : "reference"},
821
- {defaultToken : "string"}
822
- ],
823
-
824
- qqstring_inner: [
825
- {token : "string", regex: '"', next: "pop"},
826
- {include : "reference"},
827
- {defaultToken : "string"}
828
- ],
829
-
830
670
  attributes: [{
831
- token : "entity.other.attribute-name",
671
+ token : "entity.other.attribute-name.xml",
832
672
  regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
833
673
  }, {
834
- token : "keyword.operator.separator",
674
+ token : "keyword.operator.attribute-equals.xml",
835
675
  regex : "="
836
676
  }, {
837
- include : "space"
677
+ include: "tag_whitespace"
678
+ }, {
679
+ include: "attribute_value"
680
+ }],
681
+
682
+ attribute_value: [{
683
+ token : "string.attribute-value.xml",
684
+ regex : "'",
685
+ push : [
686
+ {token : "string.attribute-value.xml", regex: "'", next: "pop"},
687
+ {include : "attr_reference"},
688
+ {defaultToken : "string.attribute-value.xml"}
689
+ ]
838
690
  }, {
839
- include : "string"
691
+ token : "string.attribute-value.xml",
692
+ regex : '"',
693
+ push : [
694
+ {token : "string.attribute-value.xml", regex: '"', next: "pop"},
695
+ {include : "attr_reference"},
696
+ {defaultToken : "string.attribute-value.xml"}
697
+ ]
840
698
  }]
841
699
  };
842
700
 
@@ -849,18 +707,17 @@ var XmlHighlightRules = function(normalize) {
849
707
 
850
708
  this.embedTagRules = function(HighlightRules, prefix, tag){
851
709
  this.$rules.tag.unshift({
852
- token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag],
853
- regex : "(<)(" + tag + ")",
710
+ token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
711
+ regex : "(<)(" + tag + "(?=\\s|>|$))",
854
712
  next: [
855
- {include : "space"},
856
713
  {include : "attributes"},
857
- {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"}
714
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
858
715
  ]
859
716
  });
860
717
 
861
718
  this.$rules[tag + "-end"] = [
862
- {include : "space"},
863
- {token : "meta.tag.punctuation.end", regex : ">", next: "start",
719
+ {include : "attributes"},
720
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
864
721
  onMatch : function(value, currentState, stack) {
865
722
  stack.splice(0);
866
723
  return this.token;
@@ -868,14 +725,14 @@ var XmlHighlightRules = function(normalize) {
868
725
  ]
869
726
 
870
727
  this.embedRules(HighlightRules, prefix, [{
871
- token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag],
872
- regex : "(</)(" + tag + ")",
728
+ token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
729
+ regex : "(</)(" + tag + "(?=\\s|>|$))",
873
730
  next: tag + "-end"
874
731
  }, {
875
- token: "string.begin",
732
+ token: "string.cdata.xml",
876
733
  regex : "<\\!\\[CDATA\\["
877
734
  }, {
878
- token: "string.end",
735
+ token: "string.cdata.xml",
879
736
  regex : "\\]\\]>"
880
737
  }]);
881
738
  };
@@ -887,215 +744,90 @@ oop.inherits(XmlHighlightRules, TextHighlightRules);
887
744
  exports.XmlHighlightRules = XmlHighlightRules;
888
745
  });
889
746
 
890
- define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
891
-
892
-
893
- function string(state) {
894
- return [{
895
- token : "string",
896
- regex : '"',
897
- next : state + "_qqstring"
898
- }, {
899
- token : "string",
900
- regex : "'",
901
- next : state + "_qstring"
902
- }];
903
- }
904
-
905
- function multiLineString(quote, state) {
906
- return [
907
- {token : "string", regex : quote, next : state},
908
- {
909
- token : "constant.language.escape",
910
- regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
911
- },
912
- {defaultToken : "string"}
913
- ];
914
- }
915
-
916
- exports.tag = function(states, name, nextState, tagMap) {
917
- states[name] = [{
918
- token : "text",
919
- regex : "\\s+"
920
- }, {
921
-
922
- token : !tagMap ? "meta.tag.tag-name" : function(value) {
923
- if (tagMap[value])
924
- return "meta.tag.tag-name." + tagMap[value];
925
- else
926
- return "meta.tag.tag-name";
927
- },
928
- regex : "[-_a-zA-Z0-9:]+",
929
- next : name + "_embed_attribute_list"
930
- }, {
931
- token: "empty",
932
- regex: "",
933
- next : name + "_embed_attribute_list"
934
- }];
935
-
936
- states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
937
- states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
938
-
939
- states[name + "_embed_attribute_list"] = [{
940
- token : "meta.tag.r",
941
- regex : "/?>",
942
- next : nextState
943
- }, {
944
- token : "keyword.operator",
945
- regex : "="
946
- }, {
947
- token : "entity.other.attribute-name",
948
- regex : "[-_a-zA-Z0-9:]+"
949
- }, {
950
- token : "constant.numeric", // float
951
- regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
952
- }, {
953
- token : "text",
954
- regex : "\\s+"
955
- }].concat(string(name));
956
- };
957
-
958
- });
959
-
960
- define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html', 'ace/mode/html_completions'], function(require, exports, module) {
961
-
747
+ 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) {
748
+ "use strict";
962
749
 
963
750
  var oop = require("../lib/oop");
964
- var TextMode = require("./text").Mode;
965
- var JavaScriptMode = require("./javascript").Mode;
966
- var CssMode = require("./css").Mode;
967
- var Tokenizer = require("../tokenizer").Tokenizer;
968
- var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
969
- var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
970
- var HtmlFoldMode = require("./folding/html").FoldMode;
971
- var HtmlCompletions = require("./html_completions").HtmlCompletions;
972
-
973
- var Mode = function() {
974
- this.HighlightRules = HtmlHighlightRules;
975
- this.$behaviour = new HtmlBehaviour();
976
- this.$completer = new HtmlCompletions();
977
-
978
- this.createModeDelegates({
979
- "js-": JavaScriptMode,
980
- "css-": CssMode
981
- });
982
-
983
- this.foldingRules = new HtmlFoldMode();
984
- };
985
- oop.inherits(Mode, TextMode);
986
-
987
- (function() {
988
-
989
- this.blockComment = {start: "<!--", end: "-->"};
990
-
991
- this.getNextLineIndent = function(state, line, tab) {
992
- return this.$getIndent(line);
993
- };
994
-
995
- this.checkOutdent = function(state, line, input) {
996
- return false;
997
- };
998
-
999
- this.getCompletions = function(state, session, pos, prefix) {
1000
- return this.$completer.getCompletions(state, session, pos, prefix);
1001
- };
1002
-
1003
- this.$id = "ace/mode/html";
1004
- }).call(Mode.prototype);
751
+ var lang = require("../lib/lang");
752
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
753
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
754
+ var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
1005
755
 
1006
- exports.Mode = Mode;
756
+ var tagMap = lang.createMap({
757
+ a : 'anchor',
758
+ button : 'form',
759
+ form : 'form',
760
+ img : 'image',
761
+ input : 'form',
762
+ label : 'form',
763
+ option : 'form',
764
+ script : 'script',
765
+ select : 'form',
766
+ textarea : 'form',
767
+ style : 'style',
768
+ table : 'table',
769
+ tbody : 'table',
770
+ td : 'table',
771
+ tfoot : 'table',
772
+ th : 'table',
773
+ tr : 'table'
1007
774
  });
1008
775
 
1009
- define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
776
+ var HtmlHighlightRules = function() {
777
+ XmlHighlightRules.call(this);
1010
778
 
779
+ this.addRules({
780
+ attributes: [{
781
+ include : "tag_whitespace"
782
+ }, {
783
+ token : "entity.other.attribute-name.xml",
784
+ regex : "[-_a-zA-Z0-9:]+"
785
+ }, {
786
+ token : "keyword.operator.attribute-equals.xml",
787
+ regex : "=",
788
+ push : [{
789
+ include: "tag_whitespace"
790
+ }, {
791
+ token : "string.unquoted.attribute-value.html",
792
+ regex : "[^<>='\"`\\s]+",
793
+ next : "pop"
794
+ }, {
795
+ token : "empty",
796
+ regex : "",
797
+ next : "pop"
798
+ }]
799
+ }, {
800
+ include : "attribute_value"
801
+ }],
802
+ tag: [{
803
+ token : function(start, tag) {
804
+ var group = tagMap[tag];
805
+ return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
806
+ "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
807
+ },
808
+ regex : "(</?)([-_a-zA-Z0-9:]+)",
809
+ next: "tag_stuff"
810
+ }],
811
+ tag_stuff: [
812
+ {include : "attributes"},
813
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
814
+ ],
815
+ });
1011
816
 
1012
- var oop = require("../lib/oop");
1013
- var TextMode = require("./text").Mode;
1014
- var Tokenizer = require("../tokenizer").Tokenizer;
1015
- var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1016
- var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1017
- var Range = require("../range").Range;
1018
- var WorkerClient = require("../worker/worker_client").WorkerClient;
1019
- var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
1020
- var CStyleFoldMode = require("./folding/cstyle").FoldMode;
817
+ this.embedTagRules(CssHighlightRules, "css-", "style");
818
+ this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
1021
819
 
1022
- var Mode = function() {
1023
- this.HighlightRules = JavaScriptHighlightRules;
1024
-
1025
- this.$outdent = new MatchingBraceOutdent();
1026
- this.$behaviour = new CstyleBehaviour();
1027
- this.foldingRules = new CStyleFoldMode();
820
+ if (this.constructor === HtmlHighlightRules)
821
+ this.normalizeRules();
1028
822
  };
1029
- oop.inherits(Mode, TextMode);
1030
-
1031
- (function() {
1032
-
1033
- this.lineCommentStart = "//";
1034
- this.blockComment = {start: "/*", end: "*/"};
1035
-
1036
- this.getNextLineIndent = function(state, line, tab) {
1037
- var indent = this.$getIndent(line);
1038
-
1039
- var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
1040
- var tokens = tokenizedLine.tokens;
1041
- var endState = tokenizedLine.state;
1042
823
 
1043
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
1044
- return indent;
1045
- }
1046
-
1047
- if (state == "start" || state == "no_regex") {
1048
- var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
1049
- if (match) {
1050
- indent += tab;
1051
- }
1052
- } else if (state == "doc-start") {
1053
- if (endState == "start" || endState == "no_regex") {
1054
- return "";
1055
- }
1056
- var match = line.match(/^\s*(\/?)\*/);
1057
- if (match) {
1058
- if (match[1]) {
1059
- indent += " ";
1060
- }
1061
- indent += "* ";
1062
- }
1063
- }
1064
-
1065
- return indent;
1066
- };
1067
-
1068
- this.checkOutdent = function(state, line, input) {
1069
- return this.$outdent.checkOutdent(line, input);
1070
- };
1071
-
1072
- this.autoOutdent = function(state, doc, row) {
1073
- this.$outdent.autoOutdent(doc, row);
1074
- };
1075
-
1076
- this.createWorker = function(session) {
1077
- var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
1078
- worker.attachToDocument(session.getDocument());
1079
-
1080
- worker.on("jslint", function(results) {
1081
- session.setAnnotations(results.data);
1082
- });
1083
-
1084
- worker.on("terminate", function() {
1085
- session.clearAnnotations();
1086
- });
1087
-
1088
- return worker;
1089
- };
1090
-
1091
- this.$id = "ace/mode/javascript";
1092
- }).call(Mode.prototype);
824
+ oop.inherits(HtmlHighlightRules, XmlHighlightRules);
1093
825
 
1094
- exports.Mode = Mode;
826
+ exports.HtmlHighlightRules = HtmlHighlightRules;
1095
827
  });
1096
828
 
1097
- define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
1098
-
829
+ define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
830
+ "use strict";
1099
831
 
1100
832
  var Range = require("../range").Range;
1101
833
 
@@ -1134,8 +866,8 @@ var MatchingBraceOutdent = function() {};
1134
866
  exports.MatchingBraceOutdent = MatchingBraceOutdent;
1135
867
  });
1136
868
 
1137
- define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
1138
-
869
+ define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
870
+ "use strict";
1139
871
 
1140
872
  var oop = require("../../lib/oop");
1141
873
  var Behaviour = require("../behaviour").Behaviour;
@@ -1144,86 +876,37 @@ var lang = require("../../lib/lang");
1144
876
 
1145
877
  var SAFE_INSERT_IN_TOKENS =
1146
878
  ["text", "paren.rparen", "punctuation.operator"];
1147
- var SAFE_INSERT_BEFORE_TOKENS =
1148
- ["text", "paren.rparen", "punctuation.operator", "comment"];
1149
-
1150
-
1151
- var autoInsertedBrackets = 0;
1152
- var autoInsertedRow = -1;
1153
- var autoInsertedLineEnd = "";
1154
- var maybeInsertedBrackets = 0;
1155
- var maybeInsertedRow = -1;
1156
- var maybeInsertedLineStart = "";
1157
- var maybeInsertedLineEnd = "";
1158
-
1159
- var CstyleBehaviour = function () {
1160
-
1161
- CstyleBehaviour.isSaneInsertion = function(editor, session) {
1162
- var cursor = editor.getCursorPosition();
1163
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
1164
- if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
1165
- var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
1166
- if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
1167
- return false;
1168
- }
1169
- iterator.stepForward();
1170
- return iterator.getCurrentTokenRow() !== cursor.row ||
1171
- this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
1172
- };
1173
-
1174
- CstyleBehaviour.$matchTokenType = function(token, types) {
1175
- return types.indexOf(token.type || token) > -1;
1176
- };
1177
-
1178
- CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
1179
- var cursor = editor.getCursorPosition();
1180
- var line = session.doc.getLine(cursor.row);
1181
- if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
1182
- autoInsertedBrackets = 0;
1183
- autoInsertedRow = cursor.row;
1184
- autoInsertedLineEnd = bracket + line.substr(cursor.column);
1185
- autoInsertedBrackets++;
1186
- };
1187
-
1188
- CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
1189
- var cursor = editor.getCursorPosition();
1190
- var line = session.doc.getLine(cursor.row);
1191
- if (!this.isMaybeInsertedClosing(cursor, line))
1192
- maybeInsertedBrackets = 0;
1193
- maybeInsertedRow = cursor.row;
1194
- maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
1195
- maybeInsertedLineEnd = line.substr(cursor.column);
1196
- maybeInsertedBrackets++;
1197
- };
1198
-
1199
- CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
1200
- return autoInsertedBrackets > 0 &&
1201
- cursor.row === autoInsertedRow &&
1202
- bracket === autoInsertedLineEnd[0] &&
1203
- line.substr(cursor.column) === autoInsertedLineEnd;
1204
- };
1205
-
1206
- CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
1207
- return maybeInsertedBrackets > 0 &&
1208
- cursor.row === maybeInsertedRow &&
1209
- line.substr(cursor.column) === maybeInsertedLineEnd &&
1210
- line.substr(0, cursor.column) == maybeInsertedLineStart;
1211
- };
1212
-
1213
- CstyleBehaviour.popAutoInsertedClosing = function() {
1214
- autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
1215
- autoInsertedBrackets--;
1216
- };
1217
-
1218
- CstyleBehaviour.clearMaybeInsertedClosing = function() {
1219
- maybeInsertedBrackets = 0;
1220
- maybeInsertedRow = -1;
879
+ var SAFE_INSERT_BEFORE_TOKENS =
880
+ ["text", "paren.rparen", "punctuation.operator", "comment"];
881
+
882
+ var context;
883
+ var contextCache = {}
884
+ var initContext = function(editor) {
885
+ var id = -1;
886
+ if (editor.multiSelect) {
887
+ id = editor.selection.id;
888
+ if (contextCache.rangeCount != editor.multiSelect.rangeCount)
889
+ contextCache = {rangeCount: editor.multiSelect.rangeCount};
890
+ }
891
+ if (contextCache[id])
892
+ return context = contextCache[id];
893
+ context = contextCache[id] = {
894
+ autoInsertedBrackets: 0,
895
+ autoInsertedRow: -1,
896
+ autoInsertedLineEnd: "",
897
+ maybeInsertedBrackets: 0,
898
+ maybeInsertedRow: -1,
899
+ maybeInsertedLineStart: "",
900
+ maybeInsertedLineEnd: ""
1221
901
  };
902
+ };
1222
903
 
1223
- this.add("braces", "insertion", function (state, action, editor, session, text) {
904
+ var CstyleBehaviour = function() {
905
+ this.add("braces", "insertion", function(state, action, editor, session, text) {
1224
906
  var cursor = editor.getCursorPosition();
1225
907
  var line = session.doc.getLine(cursor.row);
1226
908
  if (text == '{') {
909
+ initContext(editor);
1227
910
  var selection = editor.getSelectionRange();
1228
911
  var selected = session.doc.getTextRange(selection);
1229
912
  if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
@@ -1247,6 +930,7 @@ var CstyleBehaviour = function () {
1247
930
  }
1248
931
  }
1249
932
  } else if (text == '}') {
933
+ initContext(editor);
1250
934
  var rightChar = line.substring(cursor.column, cursor.column + 1);
1251
935
  if (rightChar == '}') {
1252
936
  var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
@@ -1259,9 +943,10 @@ var CstyleBehaviour = function () {
1259
943
  }
1260
944
  }
1261
945
  } else if (text == "\n" || text == "\r\n") {
946
+ initContext(editor);
1262
947
  var closing = "";
1263
948
  if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
1264
- closing = lang.stringRepeat("}", maybeInsertedBrackets);
949
+ closing = lang.stringRepeat("}", context.maybeInsertedBrackets);
1265
950
  CstyleBehaviour.clearMaybeInsertedClosing();
1266
951
  }
1267
952
  var rightChar = line.substring(cursor.column, cursor.column + 1);
@@ -1273,6 +958,7 @@ var CstyleBehaviour = function () {
1273
958
  } else if (closing) {
1274
959
  var next_indent = this.$getIndent(line);
1275
960
  } else {
961
+ CstyleBehaviour.clearMaybeInsertedClosing();
1276
962
  return;
1277
963
  }
1278
964
  var indent = next_indent + session.getTabString();
@@ -1286,22 +972,24 @@ var CstyleBehaviour = function () {
1286
972
  }
1287
973
  });
1288
974
 
1289
- this.add("braces", "deletion", function (state, action, editor, session, range) {
975
+ this.add("braces", "deletion", function(state, action, editor, session, range) {
1290
976
  var selected = session.doc.getTextRange(range);
1291
977
  if (!range.isMultiLine() && selected == '{') {
978
+ initContext(editor);
1292
979
  var line = session.doc.getLine(range.start.row);
1293
980
  var rightChar = line.substring(range.end.column, range.end.column + 1);
1294
981
  if (rightChar == '}') {
1295
982
  range.end.column++;
1296
983
  return range;
1297
984
  } else {
1298
- maybeInsertedBrackets--;
985
+ context.maybeInsertedBrackets--;
1299
986
  }
1300
987
  }
1301
988
  });
1302
989
 
1303
- this.add("parens", "insertion", function (state, action, editor, session, text) {
990
+ this.add("parens", "insertion", function(state, action, editor, session, text) {
1304
991
  if (text == '(') {
992
+ initContext(editor);
1305
993
  var selection = editor.getSelectionRange();
1306
994
  var selected = session.doc.getTextRange(selection);
1307
995
  if (selected !== "" && editor.getWrapBehavioursEnabled()) {
@@ -1317,6 +1005,7 @@ var CstyleBehaviour = function () {
1317
1005
  };
1318
1006
  }
1319
1007
  } else if (text == ')') {
1008
+ initContext(editor);
1320
1009
  var cursor = editor.getCursorPosition();
1321
1010
  var line = session.doc.getLine(cursor.row);
1322
1011
  var rightChar = line.substring(cursor.column, cursor.column + 1);
@@ -1333,9 +1022,10 @@ var CstyleBehaviour = function () {
1333
1022
  }
1334
1023
  });
1335
1024
 
1336
- this.add("parens", "deletion", function (state, action, editor, session, range) {
1025
+ this.add("parens", "deletion", function(state, action, editor, session, range) {
1337
1026
  var selected = session.doc.getTextRange(range);
1338
1027
  if (!range.isMultiLine() && selected == '(') {
1028
+ initContext(editor);
1339
1029
  var line = session.doc.getLine(range.start.row);
1340
1030
  var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1341
1031
  if (rightChar == ')') {
@@ -1345,8 +1035,9 @@ var CstyleBehaviour = function () {
1345
1035
  }
1346
1036
  });
1347
1037
 
1348
- this.add("brackets", "insertion", function (state, action, editor, session, text) {
1038
+ this.add("brackets", "insertion", function(state, action, editor, session, text) {
1349
1039
  if (text == '[') {
1040
+ initContext(editor);
1350
1041
  var selection = editor.getSelectionRange();
1351
1042
  var selected = session.doc.getTextRange(selection);
1352
1043
  if (selected !== "" && editor.getWrapBehavioursEnabled()) {
@@ -1362,6 +1053,7 @@ var CstyleBehaviour = function () {
1362
1053
  };
1363
1054
  }
1364
1055
  } else if (text == ']') {
1056
+ initContext(editor);
1365
1057
  var cursor = editor.getCursorPosition();
1366
1058
  var line = session.doc.getLine(cursor.row);
1367
1059
  var rightChar = line.substring(cursor.column, cursor.column + 1);
@@ -1378,9 +1070,10 @@ var CstyleBehaviour = function () {
1378
1070
  }
1379
1071
  });
1380
1072
 
1381
- this.add("brackets", "deletion", function (state, action, editor, session, range) {
1073
+ this.add("brackets", "deletion", function(state, action, editor, session, range) {
1382
1074
  var selected = session.doc.getTextRange(range);
1383
1075
  if (!range.isMultiLine() && selected == '[') {
1076
+ initContext(editor);
1384
1077
  var line = session.doc.getLine(range.start.row);
1385
1078
  var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1386
1079
  if (rightChar == ']') {
@@ -1390,8 +1083,9 @@ var CstyleBehaviour = function () {
1390
1083
  }
1391
1084
  });
1392
1085
 
1393
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
1086
+ this.add("string_dquotes", "insertion", function(state, action, editor, session, text) {
1394
1087
  if (text == '"' || text == "'") {
1088
+ initContext(editor);
1395
1089
  var quote = text;
1396
1090
  var selection = editor.getSelectionRange();
1397
1091
  var selected = session.doc.getTextRange(selection);
@@ -1443,9 +1137,10 @@ var CstyleBehaviour = function () {
1443
1137
  }
1444
1138
  });
1445
1139
 
1446
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
1140
+ this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
1447
1141
  var selected = session.doc.getTextRange(range);
1448
1142
  if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
1143
+ initContext(editor);
1449
1144
  var line = session.doc.getLine(range.start.row);
1450
1145
  var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1451
1146
  if (rightChar == selected) {
@@ -1457,13 +1152,80 @@ var CstyleBehaviour = function () {
1457
1152
 
1458
1153
  };
1459
1154
 
1155
+
1156
+ CstyleBehaviour.isSaneInsertion = function(editor, session) {
1157
+ var cursor = editor.getCursorPosition();
1158
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
1159
+ if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
1160
+ var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
1161
+ if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
1162
+ return false;
1163
+ }
1164
+ iterator.stepForward();
1165
+ return iterator.getCurrentTokenRow() !== cursor.row ||
1166
+ this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
1167
+ };
1168
+
1169
+ CstyleBehaviour.$matchTokenType = function(token, types) {
1170
+ return types.indexOf(token.type || token) > -1;
1171
+ };
1172
+
1173
+ CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
1174
+ var cursor = editor.getCursorPosition();
1175
+ var line = session.doc.getLine(cursor.row);
1176
+ if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0]))
1177
+ context.autoInsertedBrackets = 0;
1178
+ context.autoInsertedRow = cursor.row;
1179
+ context.autoInsertedLineEnd = bracket + line.substr(cursor.column);
1180
+ context.autoInsertedBrackets++;
1181
+ };
1182
+
1183
+ CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
1184
+ var cursor = editor.getCursorPosition();
1185
+ var line = session.doc.getLine(cursor.row);
1186
+ if (!this.isMaybeInsertedClosing(cursor, line))
1187
+ context.maybeInsertedBrackets = 0;
1188
+ context.maybeInsertedRow = cursor.row;
1189
+ context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
1190
+ context.maybeInsertedLineEnd = line.substr(cursor.column);
1191
+ context.maybeInsertedBrackets++;
1192
+ };
1193
+
1194
+ CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
1195
+ return context.autoInsertedBrackets > 0 &&
1196
+ cursor.row === context.autoInsertedRow &&
1197
+ bracket === context.autoInsertedLineEnd[0] &&
1198
+ line.substr(cursor.column) === context.autoInsertedLineEnd;
1199
+ };
1200
+
1201
+ CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
1202
+ return context.maybeInsertedBrackets > 0 &&
1203
+ cursor.row === context.maybeInsertedRow &&
1204
+ line.substr(cursor.column) === context.maybeInsertedLineEnd &&
1205
+ line.substr(0, cursor.column) == context.maybeInsertedLineStart;
1206
+ };
1207
+
1208
+ CstyleBehaviour.popAutoInsertedClosing = function() {
1209
+ context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1);
1210
+ context.autoInsertedBrackets--;
1211
+ };
1212
+
1213
+ CstyleBehaviour.clearMaybeInsertedClosing = function() {
1214
+ if (context) {
1215
+ context.maybeInsertedBrackets = 0;
1216
+ context.maybeInsertedRow = -1;
1217
+ }
1218
+ };
1219
+
1220
+
1221
+
1460
1222
  oop.inherits(CstyleBehaviour, Behaviour);
1461
1223
 
1462
1224
  exports.CstyleBehaviour = CstyleBehaviour;
1463
1225
  });
1464
1226
 
1465
- define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
1466
-
1227
+ define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
1228
+ "use strict";
1467
1229
 
1468
1230
  var oop = require("../../lib/oop");
1469
1231
  var Range = require("../../range").Range;
@@ -1557,41 +1319,59 @@ oop.inherits(FoldMode, BaseFoldMode);
1557
1319
 
1558
1320
  });
1559
1321
 
1560
- define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) {
1561
-
1322
+ define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) {
1323
+ "use strict";
1562
1324
 
1563
1325
  var oop = require("../lib/oop");
1564
1326
  var TextMode = require("./text").Mode;
1565
- var Tokenizer = require("../tokenizer").Tokenizer;
1566
- var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1327
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1567
1328
  var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1329
+ var Range = require("../range").Range;
1568
1330
  var WorkerClient = require("../worker/worker_client").WorkerClient;
1569
- var CssBehaviour = require("./behaviour/css").CssBehaviour;
1331
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
1570
1332
  var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1571
1333
 
1572
1334
  var Mode = function() {
1573
- this.HighlightRules = CssHighlightRules;
1335
+ this.HighlightRules = JavaScriptHighlightRules;
1336
+
1574
1337
  this.$outdent = new MatchingBraceOutdent();
1575
- this.$behaviour = new CssBehaviour();
1338
+ this.$behaviour = new CstyleBehaviour();
1576
1339
  this.foldingRules = new CStyleFoldMode();
1577
1340
  };
1578
1341
  oop.inherits(Mode, TextMode);
1579
1342
 
1580
1343
  (function() {
1581
1344
 
1582
- this.foldingRules = "cStyle";
1345
+ this.lineCommentStart = "//";
1583
1346
  this.blockComment = {start: "/*", end: "*/"};
1584
1347
 
1585
1348
  this.getNextLineIndent = function(state, line, tab) {
1586
1349
  var indent = this.$getIndent(line);
1587
- var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
1350
+
1351
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
1352
+ var tokens = tokenizedLine.tokens;
1353
+ var endState = tokenizedLine.state;
1354
+
1588
1355
  if (tokens.length && tokens[tokens.length-1].type == "comment") {
1589
1356
  return indent;
1590
1357
  }
1591
1358
 
1592
- var match = line.match(/^.*\{\s*$/);
1593
- if (match) {
1594
- indent += tab;
1359
+ if (state == "start" || state == "no_regex") {
1360
+ var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
1361
+ if (match) {
1362
+ indent += tab;
1363
+ }
1364
+ } else if (state == "doc-start") {
1365
+ if (endState == "start" || endState == "no_regex") {
1366
+ return "";
1367
+ }
1368
+ var match = line.match(/^\s*(\/?)\*/);
1369
+ if (match) {
1370
+ if (match[1]) {
1371
+ indent += " ";
1372
+ }
1373
+ indent += "* ";
1374
+ }
1595
1375
  }
1596
1376
 
1597
1377
  return indent;
@@ -1606,11 +1386,11 @@ oop.inherits(Mode, TextMode);
1606
1386
  };
1607
1387
 
1608
1388
  this.createWorker = function(session) {
1609
- var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
1389
+ var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
1610
1390
  worker.attachToDocument(session.getDocument());
1611
1391
 
1612
- worker.on("csslint", function(e) {
1613
- session.setAnnotations(e.data);
1392
+ worker.on("jslint", function(results) {
1393
+ session.setAnnotations(results.data);
1614
1394
  });
1615
1395
 
1616
1396
  worker.on("terminate", function() {
@@ -1620,15 +1400,14 @@ oop.inherits(Mode, TextMode);
1620
1400
  return worker;
1621
1401
  };
1622
1402
 
1623
- this.$id = "ace/mode/css";
1403
+ this.$id = "ace/mode/javascript";
1624
1404
  }).call(Mode.prototype);
1625
1405
 
1626
1406
  exports.Mode = Mode;
1627
-
1628
1407
  });
1629
1408
 
1630
- 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) {
1631
-
1409
+ 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) {
1410
+ "use strict";
1632
1411
 
1633
1412
  var oop = require("../../lib/oop");
1634
1413
  var Behaviour = require("../behaviour").Behaviour;
@@ -1706,113 +1485,181 @@ oop.inherits(CssBehaviour, CstyleBehaviour);
1706
1485
  exports.CssBehaviour = CssBehaviour;
1707
1486
  });
1708
1487
 
1709
- define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) {
1488
+ 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/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
1489
+ "use strict";
1490
+
1491
+ var oop = require("../lib/oop");
1492
+ var TextMode = require("./text").Mode;
1493
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1494
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1495
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
1496
+ var CssBehaviour = require("./behaviour/css").CssBehaviour;
1497
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1498
+
1499
+ var Mode = function() {
1500
+ this.HighlightRules = CssHighlightRules;
1501
+ this.$outdent = new MatchingBraceOutdent();
1502
+ this.$behaviour = new CssBehaviour();
1503
+ this.foldingRules = new CStyleFoldMode();
1504
+ };
1505
+ oop.inherits(Mode, TextMode);
1506
+
1507
+ (function() {
1508
+
1509
+ this.foldingRules = "cStyle";
1510
+ this.blockComment = {start: "/*", end: "*/"};
1511
+
1512
+ this.getNextLineIndent = function(state, line, tab) {
1513
+ var indent = this.$getIndent(line);
1514
+ var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
1515
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
1516
+ return indent;
1517
+ }
1518
+
1519
+ var match = line.match(/^.*\{\s*$/);
1520
+ if (match) {
1521
+ indent += tab;
1522
+ }
1523
+
1524
+ return indent;
1525
+ };
1526
+
1527
+ this.checkOutdent = function(state, line, input) {
1528
+ return this.$outdent.checkOutdent(line, input);
1529
+ };
1530
+
1531
+ this.autoOutdent = function(state, doc, row) {
1532
+ this.$outdent.autoOutdent(doc, row);
1533
+ };
1534
+
1535
+ this.createWorker = function(session) {
1536
+ var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
1537
+ worker.attachToDocument(session.getDocument());
1538
+
1539
+ worker.on("csslint", function(e) {
1540
+ session.setAnnotations(e.data);
1541
+ });
1542
+
1543
+ worker.on("terminate", function() {
1544
+ session.clearAnnotations();
1545
+ });
1546
+
1547
+ return worker;
1548
+ };
1549
+
1550
+ this.$id = "ace/mode/css";
1551
+ }).call(Mode.prototype);
1552
+
1553
+ exports.Mode = Mode;
1554
+
1555
+ });
1710
1556
 
1557
+ define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module) {
1558
+ "use strict";
1711
1559
 
1712
1560
  var oop = require("../../lib/oop");
1713
- var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
1714
- var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
1561
+ var Behaviour = require("../behaviour").Behaviour;
1715
1562
  var TokenIterator = require("../../token_iterator").TokenIterator;
1716
- var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
1717
1563
 
1718
- function hasType(token, type) {
1719
- var tokenTypes = token.type.split('.');
1720
- return type.split('.').every(function(type){
1721
- return (tokenTypes.indexOf(type) !== -1);
1722
- });
1723
- return hasType;
1564
+ function is(token, type) {
1565
+ return token.type.lastIndexOf(type + ".xml") > -1;
1724
1566
  }
1725
1567
 
1726
- var HtmlBehaviour = function () {
1568
+ var XmlBehaviour = function () {
1727
1569
 
1728
- this.inherit(XmlBehaviour); // Get xml behaviour
1729
-
1730
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
1731
- if (text == '>') {
1732
- var position = editor.getCursorPosition();
1733
- var iterator = new TokenIterator(session, position.row, position.column);
1570
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
1571
+ if (text == '"' || text == "'") {
1572
+ var quote = text;
1573
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
1574
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
1575
+ return {
1576
+ text: quote + selected + quote,
1577
+ selection: false
1578
+ };
1579
+ }
1580
+
1581
+ var cursor = editor.getCursorPosition();
1582
+ var line = session.doc.getLine(cursor.row);
1583
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
1584
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
1734
1585
  var token = iterator.getCurrentToken();
1735
1586
 
1736
- if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column)
1737
- return;
1738
- var atCursor = false;
1739
- if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
1740
- do {
1741
- token = iterator.stepBackward();
1742
- } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
1743
- } else {
1744
- atCursor = true;
1745
- }
1746
- if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) {
1747
- return;
1748
- }
1749
- var element = token.value;
1750
- if (atCursor){
1751
- var element = element.substring(0, position.column - token.start);
1587
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
1588
+ return {
1589
+ text: "",
1590
+ selection: [1, 1]
1591
+ };
1752
1592
  }
1753
- if (voidElements.indexOf(element) !== -1){
1593
+
1594
+ if (!token)
1595
+ token = iterator.stepBackward();
1596
+
1597
+ if (!token)
1754
1598
  return;
1599
+
1600
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
1601
+ token = iterator.stepBackward();
1755
1602
  }
1756
- return {
1757
- text: '>' + '</' + element + '>',
1758
- selection: [1, 1]
1603
+ var rightSpace = !rightChar || rightChar.match(/\s/);
1604
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
1605
+ return {
1606
+ text: quote + quote,
1607
+ selection: [1, 1]
1608
+ };
1759
1609
  }
1760
1610
  }
1761
1611
  });
1762
- }
1763
- oop.inherits(HtmlBehaviour, XmlBehaviour);
1764
-
1765
- exports.HtmlBehaviour = HtmlBehaviour;
1766
- });
1767
-
1768
- define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) {
1769
-
1770
1612
 
1771
- var oop = require("../../lib/oop");
1772
- var Behaviour = require("../behaviour").Behaviour;
1773
- var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
1774
- var TokenIterator = require("../../token_iterator").TokenIterator;
1775
-
1776
- function hasType(token, type) {
1777
- var tokenTypes = token.type.split('.');
1778
- return type.split('.').every(function(type){
1779
- return (tokenTypes.indexOf(type) !== -1);
1613
+ this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
1614
+ var selected = session.doc.getTextRange(range);
1615
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
1616
+ var line = session.doc.getLine(range.start.row);
1617
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1618
+ if (rightChar == selected) {
1619
+ range.end.column++;
1620
+ return range;
1621
+ }
1622
+ }
1780
1623
  });
1781
- return hasType;
1782
- }
1783
1624
 
1784
- var XmlBehaviour = function () {
1785
-
1786
- this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
1787
-
1788
1625
  this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
1789
1626
  if (text == '>') {
1790
1627
  var position = editor.getCursorPosition();
1791
1628
  var iterator = new TokenIterator(session, position.row, position.column);
1792
- var token = iterator.getCurrentToken();
1793
-
1794
- if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column)
1629
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
1630
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
1795
1631
  return;
1796
- var atCursor = false;
1797
- if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
1798
- do {
1799
- token = iterator.stepBackward();
1800
- } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
1801
- } else {
1802
- atCursor = true;
1803
- }
1804
- if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) {
1632
+ if (is(token, "reference.attribute-value"))
1805
1633
  return;
1634
+ if (is(token, "attribute-value")) {
1635
+ var firstChar = token.value.charAt(0);
1636
+ if (firstChar == '"' || firstChar == "'") {
1637
+ var lastChar = token.value.charAt(token.value.length - 1);
1638
+ var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length;
1639
+ if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar)
1640
+ return;
1641
+ }
1806
1642
  }
1807
- var tag = token.value;
1808
- if (atCursor){
1809
- var tag = tag.substring(0, position.column - token.start);
1643
+ while (!is(token, "tag-name")) {
1644
+ token = iterator.stepBackward();
1810
1645
  }
1811
1646
 
1647
+ var tokenRow = iterator.getCurrentTokenRow();
1648
+ var tokenColumn = iterator.getCurrentTokenColumn();
1649
+ if (is(iterator.stepBackward(), "end-tag-open"))
1650
+ return;
1651
+
1652
+ var element = token.value;
1653
+ if (tokenRow == position.row)
1654
+ element = element.substring(0, position.column - tokenColumn);
1655
+
1656
+ if (this.voidElements.hasOwnProperty(element.toLowerCase()))
1657
+ return;
1658
+
1812
1659
  return {
1813
- text: '>' + '</' + tag + '>',
1660
+ text: '>' + '</' + element + '>',
1814
1661
  selection: [1, 1]
1815
- }
1662
+ };
1816
1663
  }
1817
1664
  });
1818
1665
 
@@ -1828,66 +1675,20 @@ var XmlBehaviour = function () {
1828
1675
  return {
1829
1676
  text: '\n' + indent + '\n' + next_indent,
1830
1677
  selection: [1, indent.length, 1, indent.length]
1831
- }
1678
+ };
1832
1679
  }
1833
1680
  }
1834
1681
  });
1835
1682
 
1836
- }
1837
- oop.inherits(XmlBehaviour, Behaviour);
1838
-
1839
- exports.XmlBehaviour = XmlBehaviour;
1840
- });
1841
-
1842
- 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) {
1843
-
1844
-
1845
- var oop = require("../../lib/oop");
1846
- var MixedFoldMode = require("./mixed").FoldMode;
1847
- var XmlFoldMode = require("./xml").FoldMode;
1848
- var CStyleFoldMode = require("./cstyle").FoldMode;
1849
-
1850
- var FoldMode = exports.FoldMode = function() {
1851
- MixedFoldMode.call(this, new XmlFoldMode({
1852
- "area": 1,
1853
- "base": 1,
1854
- "br": 1,
1855
- "col": 1,
1856
- "command": 1,
1857
- "embed": 1,
1858
- "hr": 1,
1859
- "img": 1,
1860
- "input": 1,
1861
- "keygen": 1,
1862
- "link": 1,
1863
- "meta": 1,
1864
- "param": 1,
1865
- "source": 1,
1866
- "track": 1,
1867
- "wbr": 1,
1868
- "li": 1,
1869
- "dt": 1,
1870
- "dd": 1,
1871
- "p": 1,
1872
- "rt": 1,
1873
- "rp": 1,
1874
- "optgroup": 1,
1875
- "option": 1,
1876
- "colgroup": 1,
1877
- "td": 1,
1878
- "th": 1
1879
- }), {
1880
- "js-": new CStyleFoldMode(),
1881
- "css-": new CStyleFoldMode()
1882
- });
1883
1683
  };
1884
1684
 
1885
- oop.inherits(FoldMode, MixedFoldMode);
1685
+ oop.inherits(XmlBehaviour, Behaviour);
1886
1686
 
1687
+ exports.XmlBehaviour = XmlBehaviour;
1887
1688
  });
1888
1689
 
1889
- define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
1890
-
1690
+ define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module) {
1691
+ "use strict";
1891
1692
 
1892
1693
  var oop = require("../../lib/oop");
1893
1694
  var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1940,8 +1741,8 @@ oop.inherits(FoldMode, BaseFoldMode);
1940
1741
 
1941
1742
  });
1942
1743
 
1943
- 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) {
1944
-
1744
+ 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) {
1745
+ "use strict";
1945
1746
 
1946
1747
  var oop = require("../../lib/oop");
1947
1748
  var lang = require("../../lib/lang");
@@ -1949,91 +1750,118 @@ var Range = require("../../range").Range;
1949
1750
  var BaseFoldMode = require("./fold_mode").FoldMode;
1950
1751
  var TokenIterator = require("../../token_iterator").TokenIterator;
1951
1752
 
1952
- var FoldMode = exports.FoldMode = function(voidElements) {
1753
+ var FoldMode = exports.FoldMode = function(voidElements, optionalEndTags) {
1953
1754
  BaseFoldMode.call(this);
1954
1755
  this.voidElements = voidElements || {};
1756
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
1757
+ if (optionalEndTags)
1758
+ oop.mixin(this.optionalEndTags, optionalEndTags);
1759
+
1955
1760
  };
1956
1761
  oop.inherits(FoldMode, BaseFoldMode);
1957
1762
 
1763
+ var Tag = function() {
1764
+ this.tagName = "";
1765
+ this.closing = false;
1766
+ this.selfClosing = false;
1767
+ this.start = {row: 0, column: 0};
1768
+ this.end = {row: 0, column: 0};
1769
+ };
1770
+
1771
+ function is(token, type) {
1772
+ return token.type.lastIndexOf(type + ".xml") > -1;
1773
+ }
1774
+
1958
1775
  (function() {
1959
1776
 
1960
1777
  this.getFoldWidget = function(session, foldStyle, row) {
1961
1778
  var tag = this._getFirstTagInLine(session, row);
1962
1779
 
1963
- if (tag.closing)
1964
- return foldStyle == "markbeginend" ? "end" : "";
1965
-
1966
- if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()])
1780
+ if (!tag)
1967
1781
  return "";
1968
1782
 
1969
- if (tag.selfClosing)
1783
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
1784
+ return foldStyle == "markbeginend" ? "end" : "";
1785
+
1786
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
1970
1787
  return "";
1971
1788
 
1972
- if (tag.value.indexOf("/" + tag.tagName) !== -1)
1789
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
1973
1790
  return "";
1974
1791
 
1975
1792
  return "start";
1976
1793
  };
1977
-
1978
1794
  this._getFirstTagInLine = function(session, row) {
1979
1795
  var tokens = session.getTokens(row);
1980
- var value = "";
1796
+ var tag = new Tag();
1797
+
1981
1798
  for (var i = 0; i < tokens.length; i++) {
1982
1799
  var token = tokens[i];
1983
- if (token.type.lastIndexOf("meta.tag", 0) === 0)
1984
- value += token.value;
1985
- else
1986
- value += lang.stringRepeat(" ", token.value.length);
1800
+ if (is(token, "tag-open")) {
1801
+ tag.end.column = tag.start.column + token.value.length;
1802
+ tag.closing = is(token, "end-tag-open");
1803
+ token = tokens[++i];
1804
+ if (!token)
1805
+ return null;
1806
+ tag.tagName = token.value;
1807
+ tag.end.column += token.value.length;
1808
+ for (i++; i < tokens.length; i++) {
1809
+ token = tokens[i];
1810
+ tag.end.column += token.value.length;
1811
+ if (is(token, "tag-close")) {
1812
+ tag.selfClosing = token.value == '/>';
1813
+ break;
1814
+ }
1815
+ }
1816
+ return tag;
1817
+ } else if (is(token, "tag-close")) {
1818
+ tag.selfClosing = token.value == '/>';
1819
+ return tag;
1820
+ }
1821
+ tag.start.column += token.value.length;
1987
1822
  }
1988
-
1989
- return this._parseTag(value);
1823
+
1824
+ return null;
1990
1825
  };
1991
1826
 
1992
- this.tagRe = /^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;
1993
- this._parseTag = function(tag) {
1994
-
1995
- var match = tag.match(this.tagRe);
1827
+ this._findEndTagInLine = function(session, row, tagName, startColumn) {
1828
+ var tokens = session.getTokens(row);
1996
1829
  var column = 0;
1997
-
1998
- return {
1999
- value: tag,
2000
- match: match ? match[2] : "",
2001
- closing: match ? !!match[3] : false,
2002
- selfClosing: match ? !!match[5] || match[2] == "/>" : false,
2003
- tagName: match ? match[4] : "",
2004
- column: match[1] ? column + match[1].length : column
2005
- };
1830
+ for (var i = 0; i < tokens.length; i++) {
1831
+ var token = tokens[i];
1832
+ column += token.value.length;
1833
+ if (column < startColumn)
1834
+ continue;
1835
+ if (is(token, "end-tag-open")) {
1836
+ token = tokens[i + 1];
1837
+ if (token && token.value == tagName)
1838
+ return true;
1839
+ }
1840
+ }
1841
+ return false;
2006
1842
  };
2007
1843
  this._readTagForward = function(iterator) {
2008
1844
  var token = iterator.getCurrentToken();
2009
1845
  if (!token)
2010
1846
  return null;
2011
-
2012
- var value = "";
2013
- var start;
2014
-
1847
+
1848
+ var tag = new Tag();
2015
1849
  do {
2016
- if (token.type.lastIndexOf("meta.tag", 0) === 0) {
2017
- if (!start) {
2018
- var start = {
2019
- row: iterator.getCurrentTokenRow(),
2020
- column: iterator.getCurrentTokenColumn()
2021
- };
2022
- }
2023
- value += token.value;
2024
- if (value.indexOf(">") !== -1) {
2025
- var tag = this._parseTag(value);
2026
- tag.start = start;
2027
- tag.end = {
2028
- row: iterator.getCurrentTokenRow(),
2029
- column: iterator.getCurrentTokenColumn() + token.value.length
2030
- };
2031
- iterator.stepForward();
2032
- return tag;
2033
- }
1850
+ if (is(token, "tag-open")) {
1851
+ tag.closing = is(token, "end-tag-open");
1852
+ tag.start.row = iterator.getCurrentTokenRow();
1853
+ tag.start.column = iterator.getCurrentTokenColumn();
1854
+ } else if (is(token, "tag-name")) {
1855
+ tag.tagName = token.value;
1856
+ } else if (is(token, "tag-close")) {
1857
+ tag.selfClosing = token.value == "/>";
1858
+ tag.end.row = iterator.getCurrentTokenRow();
1859
+ tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
1860
+ iterator.stepForward();
1861
+ return tag;
2034
1862
  }
2035
1863
  } while(token = iterator.stepForward());
2036
-
1864
+
2037
1865
  return null;
2038
1866
  };
2039
1867
 
@@ -2041,32 +1869,24 @@ oop.inherits(FoldMode, BaseFoldMode);
2041
1869
  var token = iterator.getCurrentToken();
2042
1870
  if (!token)
2043
1871
  return null;
2044
-
2045
- var value = "";
2046
- var end;
2047
1872
 
1873
+ var tag = new Tag();
2048
1874
  do {
2049
- if (token.type.lastIndexOf("meta.tag", 0) === 0) {
2050
- if (!end) {
2051
- end = {
2052
- row: iterator.getCurrentTokenRow(),
2053
- column: iterator.getCurrentTokenColumn() + token.value.length
2054
- };
2055
- }
2056
- value = token.value + value;
2057
- if (value.indexOf("<") !== -1) {
2058
- var tag = this._parseTag(value);
2059
- tag.end = end;
2060
- tag.start = {
2061
- row: iterator.getCurrentTokenRow(),
2062
- column: iterator.getCurrentTokenColumn()
2063
- };
2064
- iterator.stepBackward();
2065
- return tag;
2066
- }
1875
+ if (is(token, "tag-open")) {
1876
+ tag.closing = is(token, "end-tag-open");
1877
+ tag.start.row = iterator.getCurrentTokenRow();
1878
+ tag.start.column = iterator.getCurrentTokenColumn();
1879
+ iterator.stepBackward();
1880
+ return tag;
1881
+ } else if (is(token, "tag-name")) {
1882
+ tag.tagName = token.value;
1883
+ } else if (is(token, "tag-close")) {
1884
+ tag.selfClosing = token.value == "/>";
1885
+ tag.end.row = iterator.getCurrentTokenRow();
1886
+ tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
2067
1887
  }
2068
1888
  } while(token = iterator.stepBackward());
2069
-
1889
+
2070
1890
  return null;
2071
1891
  };
2072
1892
 
@@ -2077,10 +1897,10 @@ oop.inherits(FoldMode, BaseFoldMode);
2077
1897
  if (!tag || top.tagName == tag.tagName) {
2078
1898
  return stack.pop();
2079
1899
  }
2080
- else if (this.voidElements[tag.tagName]) {
1900
+ else if (this.optionalEndTags.hasOwnProperty(tag.tagName)) {
2081
1901
  return;
2082
1902
  }
2083
- else if (this.voidElements[top.tagName]) {
1903
+ else if (this.optionalEndTags.hasOwnProperty(top.tagName)) {
2084
1904
  stack.pop();
2085
1905
  continue;
2086
1906
  } else {
@@ -2092,7 +1912,7 @@ oop.inherits(FoldMode, BaseFoldMode);
2092
1912
  this.getFoldWidgetRange = function(session, foldStyle, row) {
2093
1913
  var firstTag = this._getFirstTagInLine(session, row);
2094
1914
 
2095
- if (!firstTag.match)
1915
+ if (!firstTag)
2096
1916
  return null;
2097
1917
 
2098
1918
  var isBackward = firstTag.closing || firstTag.selfClosing;
@@ -2100,10 +1920,10 @@ oop.inherits(FoldMode, BaseFoldMode);
2100
1920
  var tag;
2101
1921
 
2102
1922
  if (!isBackward) {
2103
- var iterator = new TokenIterator(session, row, firstTag.column);
1923
+ var iterator = new TokenIterator(session, row, firstTag.start.column);
2104
1924
  var start = {
2105
1925
  row: row,
2106
- column: firstTag.column + firstTag.tagName.length + 2
1926
+ column: firstTag.start.column + firstTag.tagName.length + 2
2107
1927
  };
2108
1928
  while (tag = this._readTagForward(iterator)) {
2109
1929
  if (tag.selfClosing) {
@@ -2121,15 +1941,15 @@ oop.inherits(FoldMode, BaseFoldMode);
2121
1941
  return Range.fromPoints(start, tag.start);
2122
1942
  }
2123
1943
  else {
2124
- stack.push(tag)
1944
+ stack.push(tag);
2125
1945
  }
2126
1946
  }
2127
1947
  }
2128
1948
  else {
2129
- var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
1949
+ var iterator = new TokenIterator(session, row, firstTag.end.column);
2130
1950
  var end = {
2131
1951
  row: row,
2132
- column: firstTag.column
1952
+ column: firstTag.start.column
2133
1953
  };
2134
1954
 
2135
1955
  while (tag = this._readTagBackward(iterator)) {
@@ -2150,7 +1970,7 @@ oop.inherits(FoldMode, BaseFoldMode);
2150
1970
  }
2151
1971
  }
2152
1972
  else {
2153
- stack.push(tag)
1973
+ stack.push(tag);
2154
1974
  }
2155
1975
  }
2156
1976
  }
@@ -2161,8 +1981,27 @@ oop.inherits(FoldMode, BaseFoldMode);
2161
1981
 
2162
1982
  });
2163
1983
 
2164
- define('ace/mode/html_completions', ['require', 'exports', 'module' , 'ace/token_iterator'], function(require, exports, module) {
1984
+ 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) {
1985
+ "use strict";
1986
+
1987
+ var oop = require("../../lib/oop");
1988
+ var MixedFoldMode = require("./mixed").FoldMode;
1989
+ var XmlFoldMode = require("./xml").FoldMode;
1990
+ var CStyleFoldMode = require("./cstyle").FoldMode;
1991
+
1992
+ var FoldMode = exports.FoldMode = function(voidElements, optionalTags) {
1993
+ MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
1994
+ "js-": new CStyleFoldMode(),
1995
+ "css-": new CStyleFoldMode()
1996
+ });
1997
+ };
1998
+
1999
+ oop.inherits(FoldMode, MixedFoldMode);
2000
+
2001
+ });
2165
2002
 
2003
+ define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) {
2004
+ "use strict";
2166
2005
 
2167
2006
  var TokenIterator = require("../token_iterator").TokenIterator;
2168
2007
 
@@ -2176,6 +2015,12 @@ var commonAttributes = [
2176
2015
  "dropzone",
2177
2016
  "hidden",
2178
2017
  "id",
2018
+ "inert",
2019
+ "itemid",
2020
+ "itemprop",
2021
+ "itemref",
2022
+ "itemscope",
2023
+ "itemtype",
2179
2024
  "lang",
2180
2025
  "spellcheck",
2181
2026
  "style",
@@ -2359,24 +2204,19 @@ var attributeMap = {
2359
2204
  "dialog": ["open"]
2360
2205
  };
2361
2206
 
2362
- var allElements = Object.keys(attributeMap);
2207
+ var elements = Object.keys(attributeMap);
2363
2208
 
2364
- function hasType(token, type) {
2365
- var tokenTypes = token.type.split('.');
2366
- return type.split('.').every(function(type){
2367
- return (tokenTypes.indexOf(type) !== -1);
2368
- });
2209
+ function is(token, type) {
2210
+ return token.type.lastIndexOf(type + ".xml") > -1;
2369
2211
  }
2370
2212
 
2371
2213
  function findTagName(session, pos) {
2372
2214
  var iterator = new TokenIterator(session, pos.row, pos.column);
2373
2215
  var token = iterator.getCurrentToken();
2374
- if (!token || !hasType(token, 'tag') && !(hasType(token, 'text') && token.value.match('/'))){
2375
- do {
2376
- token = iterator.stepBackward();
2377
- } while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text')));
2216
+ while (token && !is(token, "tag-name")){
2217
+ token = iterator.stepBackward();
2378
2218
  }
2379
- if (token && hasType(token, 'tag-name') && !iterator.stepBackward().value.match('/'))
2219
+ if (token)
2380
2220
  return token.value;
2381
2221
  }
2382
2222
 
@@ -2391,25 +2231,20 @@ var HtmlCompletions = function() {
2391
2231
 
2392
2232
  if (!token)
2393
2233
  return [];
2394
- if (hasType(token, "tag-name") || (token.value == '<' && hasType(token, "text")))
2234
+ if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
2395
2235
  return this.getTagCompletions(state, session, pos, prefix);
2396
- if (hasType(token, 'text') || hasType(token, 'attribute-name'))
2236
+ if (is(token, "tag-whitespace") || is(token, "attribute-name"))
2397
2237
  return this.getAttributeCompetions(state, session, pos, prefix);
2398
2238
 
2399
2239
  return [];
2400
2240
  };
2401
2241
 
2402
2242
  this.getTagCompletions = function(state, session, pos, prefix) {
2403
- var elements = allElements;
2404
- if (prefix) {
2405
- elements = elements.filter(function(element){
2406
- return element.indexOf(prefix) === 0;
2407
- });
2408
- }
2409
2243
  return elements.map(function(element){
2410
2244
  return {
2411
2245
  value: element,
2412
- meta: "tag"
2246
+ meta: "tag",
2247
+ score: Number.MAX_VALUE
2413
2248
  };
2414
2249
  });
2415
2250
  };
@@ -2422,16 +2257,12 @@ var HtmlCompletions = function() {
2422
2257
  if (tagName in attributeMap) {
2423
2258
  attributes = attributes.concat(attributeMap[tagName]);
2424
2259
  }
2425
- if (prefix) {
2426
- attributes = attributes.filter(function(attribute){
2427
- return attribute.indexOf(prefix) === 0;
2428
- });
2429
- }
2430
2260
  return attributes.map(function(attribute){
2431
2261
  return {
2432
2262
  caption: attribute,
2433
2263
  snippet: attribute + '="$0"',
2434
- meta: "attribute"
2264
+ meta: "attribute",
2265
+ score: Number.MAX_VALUE
2435
2266
  };
2436
2267
  });
2437
2268
  };
@@ -2441,71 +2272,83 @@ var HtmlCompletions = function() {
2441
2272
  exports.HtmlCompletions = HtmlCompletions;
2442
2273
  });
2443
2274
 
2444
- define('ace/mode/ruby', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/ruby_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/folding/coffee'], function(require, exports, module) {
2445
-
2275
+ 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) {
2276
+ "use strict";
2446
2277
 
2447
2278
  var oop = require("../lib/oop");
2279
+ var lang = require("../lib/lang");
2448
2280
  var TextMode = require("./text").Mode;
2449
- var Tokenizer = require("../tokenizer").Tokenizer;
2450
- var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules;
2451
- var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
2452
- var Range = require("../range").Range;
2453
- var FoldMode = require("./folding/coffee").FoldMode;
2281
+ var JavaScriptMode = require("./javascript").Mode;
2282
+ var CssMode = require("./css").Mode;
2283
+ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
2284
+ var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
2285
+ var HtmlFoldMode = require("./folding/html").FoldMode;
2286
+ var HtmlCompletions = require("./html_completions").HtmlCompletions;
2287
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
2288
+ var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
2289
+ var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
2454
2290
 
2455
- var Mode = function() {
2456
- this.HighlightRules = RubyHighlightRules;
2457
- this.$outdent = new MatchingBraceOutdent();
2458
- this.foldingRules = new FoldMode();
2291
+ var Mode = function(options) {
2292
+ this.fragmentContext = options && options.fragmentContext;
2293
+ this.HighlightRules = HtmlHighlightRules;
2294
+ this.$behaviour = new XmlBehaviour();
2295
+ this.$completer = new HtmlCompletions();
2296
+
2297
+ this.createModeDelegates({
2298
+ "js-": JavaScriptMode,
2299
+ "css-": CssMode
2300
+ });
2301
+
2302
+ this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
2459
2303
  };
2460
2304
  oop.inherits(Mode, TextMode);
2461
2305
 
2462
2306
  (function() {
2463
2307
 
2308
+ this.blockComment = {start: "<!--", end: "-->"};
2464
2309
 
2465
- this.lineCommentStart = "#";
2310
+ this.voidElements = lang.arrayToMap(voidElements);
2466
2311
 
2467
2312
  this.getNextLineIndent = function(state, line, tab) {
2468
- var indent = this.$getIndent(line);
2313
+ return this.$getIndent(line);
2314
+ };
2469
2315
 
2470
- var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
2471
- var tokens = tokenizedLine.tokens;
2316
+ this.checkOutdent = function(state, line, input) {
2317
+ return false;
2318
+ };
2472
2319
 
2473
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
2474
- return indent;
2475
- }
2320
+ this.getCompletions = function(state, session, pos, prefix) {
2321
+ return this.$completer.getCompletions(state, session, pos, prefix);
2322
+ };
2476
2323
 
2477
- if (state == "start") {
2478
- var match = line.match(/^.*[\{\(\[]\s*$/);
2479
- var startingClassOrMethod = line.match(/^\s*(class|def)\s.*$/);
2480
- var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/);
2481
- var startingConditional = line.match(/^\s*(if|else)\s*/)
2482
- if (match || startingClassOrMethod || startingDoBlock || startingConditional) {
2483
- indent += tab;
2484
- }
2485
- }
2324
+ this.createWorker = function(session) {
2325
+ if (this.constructor != Mode)
2326
+ return;
2327
+ var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
2328
+ worker.attachToDocument(session.getDocument());
2486
2329
 
2487
- return indent;
2488
- };
2330
+ if (this.fragmentContext)
2331
+ worker.call("setOptions", [{context: this.fragmentContext}]);
2489
2332
 
2490
- this.checkOutdent = function(state, line, input) {
2491
- return /^\s+end$/.test(line + input) || /^\s+}$/.test(line + input) || /^\s+else$/.test(line + input);
2492
- };
2333
+ worker.on("error", function(e) {
2334
+ session.setAnnotations(e.data);
2335
+ });
2493
2336
 
2494
- this.autoOutdent = function(state, doc, row) {
2495
- var indent = this.$getIndent(doc.getLine(row));
2496
- var tab = doc.getTabString();
2497
- if (indent.slice(-tab.length) == tab)
2498
- doc.remove(new Range(row, indent.length-tab.length, row, indent.length));
2337
+ worker.on("terminate", function() {
2338
+ session.clearAnnotations();
2339
+ });
2340
+
2341
+ return worker;
2499
2342
  };
2500
2343
 
2501
- this.$id = "ace/mode/ruby";
2344
+ this.$id = "ace/mode/html";
2502
2345
  }).call(Mode.prototype);
2503
2346
 
2504
2347
  exports.Mode = Mode;
2505
2348
  });
2506
2349
 
2507
- define('ace/mode/ruby_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
2508
-
2350
+ define("ace/mode/ruby_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2351
+ "use strict";
2509
2352
 
2510
2353
  var oop = require("../lib/oop");
2511
2354
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
@@ -2729,8 +2572,8 @@ oop.inherits(RubyHighlightRules, TextHighlightRules);
2729
2572
  exports.RubyHighlightRules = RubyHighlightRules;
2730
2573
  });
2731
2574
 
2732
- define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) {
2733
-
2575
+ define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) {
2576
+ "use strict";
2734
2577
 
2735
2578
  var oop = require("../../lib/oop");
2736
2579
  var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -2815,3 +2658,153 @@ oop.inherits(FoldMode, BaseFoldMode);
2815
2658
  }).call(FoldMode.prototype);
2816
2659
 
2817
2660
  });
2661
+
2662
+ define("ace/mode/ruby",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ruby_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/coffee"], function(require, exports, module) {
2663
+ "use strict";
2664
+
2665
+ var oop = require("../lib/oop");
2666
+ var TextMode = require("./text").Mode;
2667
+ var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules;
2668
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
2669
+ var Range = require("../range").Range;
2670
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
2671
+ var FoldMode = require("./folding/coffee").FoldMode;
2672
+
2673
+ var Mode = function() {
2674
+ this.HighlightRules = RubyHighlightRules;
2675
+ this.$outdent = new MatchingBraceOutdent();
2676
+ this.$behaviour = new CstyleBehaviour();
2677
+ this.foldingRules = new FoldMode();
2678
+ };
2679
+ oop.inherits(Mode, TextMode);
2680
+
2681
+ (function() {
2682
+
2683
+
2684
+ this.lineCommentStart = "#";
2685
+
2686
+ this.getNextLineIndent = function(state, line, tab) {
2687
+ var indent = this.$getIndent(line);
2688
+
2689
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
2690
+ var tokens = tokenizedLine.tokens;
2691
+
2692
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
2693
+ return indent;
2694
+ }
2695
+
2696
+ if (state == "start") {
2697
+ var match = line.match(/^.*[\{\(\[]\s*$/);
2698
+ var startingClassOrMethod = line.match(/^\s*(class|def|module)\s.*$/);
2699
+ var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/);
2700
+ var startingConditional = line.match(/^\s*(if|else)\s*/)
2701
+ if (match || startingClassOrMethod || startingDoBlock || startingConditional) {
2702
+ indent += tab;
2703
+ }
2704
+ }
2705
+
2706
+ return indent;
2707
+ };
2708
+
2709
+ this.checkOutdent = function(state, line, input) {
2710
+ return /^\s+(end|else)$/.test(line + input) || this.$outdent.checkOutdent(line, input);
2711
+ };
2712
+
2713
+ this.autoOutdent = function(state, session, row) {
2714
+ var line = session.getLine(row);
2715
+ if (/}/.test(line))
2716
+ return this.$outdent.autoOutdent(session, row);
2717
+ var indent = this.$getIndent(line);
2718
+ var prevLine = session.getLine(row - 1);
2719
+ var prevIndent = this.$getIndent(prevLine);
2720
+ var tab = session.getTabString();
2721
+ if (prevIndent.length <= indent.length) {
2722
+ if (indent.slice(-tab.length) == tab)
2723
+ session.remove(new Range(row, indent.length-tab.length, row, indent.length));
2724
+ }
2725
+ };
2726
+
2727
+ this.$id = "ace/mode/ruby";
2728
+ }).call(Mode.prototype);
2729
+
2730
+ exports.Mode = Mode;
2731
+ });
2732
+
2733
+ define("ace/mode/ejs",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules","ace/mode/javascript_highlight_rules","ace/lib/oop","ace/mode/html","ace/mode/javascript","ace/mode/css","ace/mode/ruby"], function(require, exports, module) {
2734
+ "use strict";
2735
+
2736
+ var oop = require("../lib/oop");
2737
+ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
2738
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
2739
+
2740
+ var EjsHighlightRules = function(start, end) {
2741
+ HtmlHighlightRules.call(this);
2742
+
2743
+ if (!start)
2744
+ start = "(?:<%|<\\?|{{)";
2745
+ if (!end)
2746
+ end = "(?:%>|\\?>|}})";
2747
+
2748
+ for (var i in this.$rules) {
2749
+ this.$rules[i].unshift({
2750
+ token : "markup.list.meta.tag",
2751
+ regex : start + "(?![>}])[-=]?",
2752
+ push : "ejs-start"
2753
+ });
2754
+ }
2755
+
2756
+ this.embedRules(JavaScriptHighlightRules, "ejs-");
2757
+
2758
+ this.$rules["ejs-start"].unshift({
2759
+ token : "markup.list.meta.tag",
2760
+ regex : "-?" + end,
2761
+ next : "pop"
2762
+ }, {
2763
+ token: "comment",
2764
+ regex: "//.*?" + end,
2765
+ next: "pop"
2766
+ });
2767
+
2768
+ this.$rules["ejs-no_regex"].unshift({
2769
+ token : "markup.list.meta.tag",
2770
+ regex : "-?" + end,
2771
+ next : "pop"
2772
+ }, {
2773
+ token: "comment",
2774
+ regex: "//.*?" + end,
2775
+ next: "pop"
2776
+ });
2777
+
2778
+ this.normalizeRules();
2779
+ };
2780
+
2781
+
2782
+ oop.inherits(EjsHighlightRules, HtmlHighlightRules);
2783
+
2784
+ exports.EjsHighlightRules = EjsHighlightRules;
2785
+
2786
+
2787
+ var oop = require("../lib/oop");
2788
+ var HtmlMode = require("./html").Mode;
2789
+ var JavaScriptMode = require("./javascript").Mode;
2790
+ var CssMode = require("./css").Mode;
2791
+ var RubyMode = require("./ruby").Mode;
2792
+
2793
+ var Mode = function() {
2794
+ HtmlMode.call(this);
2795
+ this.HighlightRules = EjsHighlightRules;
2796
+ this.createModeDelegates({
2797
+ "js-": JavaScriptMode,
2798
+ "css-": CssMode,
2799
+ "ejs-": JavaScriptMode
2800
+ });
2801
+ };
2802
+ oop.inherits(Mode, HtmlMode);
2803
+
2804
+ (function() {
2805
+
2806
+ this.$id = "ace/mode/ejs";
2807
+ }).call(Mode.prototype);
2808
+
2809
+ exports.Mode = Mode;
2810
+ });