ace-rails-ap 2.0.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,218 +1,5 @@
1
- /* ***** BEGIN LICENSE BLOCK *****
2
- * Distributed under the BSD license:
3
- *
4
- * Copyright (c) 2010, 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
- define('ace/mode/jsp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/jsp_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
32
-
33
-
34
- var oop = require("../lib/oop");
35
- var TextMode = require("./text").Mode;
36
- var Tokenizer = require("../tokenizer").Tokenizer;
37
- var JspHighlightRules = require("./jsp_highlight_rules").JspHighlightRules;
38
- var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
39
- var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
40
- var CStyleFoldMode = require("./folding/cstyle").FoldMode;
41
-
42
- var Mode = function() {
43
- this.HighlightRules = JspHighlightRules;
44
- this.$outdent = new MatchingBraceOutdent();
45
- this.$behaviour = new CstyleBehaviour();
46
- this.foldingRules = new CStyleFoldMode();
47
- };
48
- oop.inherits(Mode, TextMode);
49
-
50
- (function() {
51
-
52
- this.$id = "ace/mode/jsp";
53
- }).call(Mode.prototype);
54
-
55
- exports.Mode = Mode;
56
- });
57
-
58
- define('ace/mode/jsp_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html_highlight_rules', 'ace/mode/java_highlight_rules'], function(require, exports, module) {
59
-
60
-
61
- var oop = require("../lib/oop");
62
- var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
63
- var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules;
64
-
65
- var JspHighlightRules = function() {
66
- HtmlHighlightRules.call(this);
67
-
68
- var builtinVariables = 'request|response|out|session|' +
69
- 'application|config|pageContext|page|Exception';
70
-
71
- var keywords = 'page|include|taglib';
72
-
73
- var startRules = [
74
- {
75
- token : "comment",
76
- regex : "<%--",
77
- push : "jsp-dcomment"
78
- }, {
79
- token : "meta.tag", // jsp open tag
80
- regex : "<%@?|<%=?|<jsp:[^>]+>",
81
- push : "jsp-start"
82
- }
83
- ];
84
-
85
- var endRules = [
86
- {
87
- token : "meta.tag", // jsp close tag
88
- regex : "%>|<\\/jsp:[^>]+>",
89
- next : "pop"
90
- }, {
91
- token: "variable.language",
92
- regex : builtinVariables
93
- }, {
94
- token: "keyword",
95
- regex : keywords
96
- }
97
- ];
98
-
99
- for (var key in this.$rules)
100
- this.$rules[key].unshift.apply(this.$rules[key], startRules);
101
-
102
- this.embedRules(JavaHighlightRules, "jsp-", endRules, ["start"]);
103
-
104
- this.addRules({
105
- "jsp-dcomment" : [{
106
- token : "comment",
107
- regex : ".*?--%>",
108
- next : "pop"
109
- }]
110
- });
111
-
112
- this.normalizeRules();
113
- };
114
-
115
- oop.inherits(JspHighlightRules, HtmlHighlightRules);
116
-
117
- exports.JspHighlightRules = JspHighlightRules;
118
- });
119
-
120
- 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) {
121
-
122
-
123
- var oop = require("../lib/oop");
124
- var lang = require("../lib/lang");
125
- var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
126
- var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
127
- var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
128
-
129
- var tagMap = lang.createMap({
130
- a : 'anchor',
131
- button : 'form',
132
- form : 'form',
133
- img : 'image',
134
- input : 'form',
135
- label : 'form',
136
- option : 'form',
137
- script : 'script',
138
- select : 'form',
139
- textarea : 'form',
140
- style : 'style',
141
- table : 'table',
142
- tbody : 'table',
143
- td : 'table',
144
- tfoot : 'table',
145
- th : 'table',
146
- tr : 'table'
147
- });
148
-
149
- var HtmlHighlightRules = function() {
150
- XmlHighlightRules.call(this);
151
-
152
- this.addRules({
153
- attributes: [{
154
- include : "space"
155
- }, {
156
- token : "entity.other.attribute-name",
157
- regex : "[-_a-zA-Z0-9:]+"
158
- }, {
159
- token : "keyword.operator.separator",
160
- regex : "=",
161
- push : [{
162
- include: "space"
163
- }, {
164
- token : "string",
165
- regex : "[^<>='\"`\\s]+",
166
- next : "pop"
167
- }, {
168
- token : "empty",
169
- regex : "",
170
- next : "pop"
171
- }]
172
- }, {
173
- include : "string"
174
- }],
175
- tag: [{
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: "start_tag_stuff"
183
- }, {
184
- token : function(start, tag) {
185
- var group = tagMap[tag];
186
- return ["meta.tag.punctuation.begin",
187
- "meta.tag.name" + (group ? "." + group : "")];
188
- },
189
- regex : "(</)([-_a-zA-Z0-9:]+)",
190
- next: "end_tag_stuff"
191
- }],
192
- start_tag_stuff: [
193
- {include : "attributes"},
194
- {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"}
195
- ],
196
- end_tag_stuff: [
197
- {include : "space"},
198
- {token : "meta.tag.punctuation.end", regex : ">", next : "start"}
199
- ]
200
- });
201
-
202
- this.embedTagRules(CssHighlightRules, "css-", "style");
203
- this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
204
-
205
- if (this.constructor === HtmlHighlightRules)
206
- this.normalizeRules();
207
- };
208
-
209
- oop.inherits(HtmlHighlightRules, XmlHighlightRules);
210
-
211
- exports.HtmlHighlightRules = HtmlHighlightRules;
212
- });
213
-
214
- define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
215
-
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";
216
3
 
217
4
  var oop = require("../lib/oop");
218
5
  var lang = require("../lib/lang");
@@ -355,14 +142,58 @@ exports.CssHighlightRules = CssHighlightRules;
355
142
 
356
143
  });
357
144
 
358
- 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
+ });
359
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";
360
191
 
361
192
  var oop = require("../lib/oop");
362
193
  var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
363
194
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
364
195
 
365
- var JavaScriptHighlightRules = function() {
196
+ var JavaScriptHighlightRules = function(options) {
366
197
  var keywordMapper = this.createKeywordMapper({
367
198
  "variable.language":
368
199
  "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
@@ -487,19 +318,22 @@ var JavaScriptHighlightRules = function() {
487
318
  }, {
488
319
  token : ["punctuation.operator", "support.constant"],
489
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/
490
324
  }, {
491
325
  token : ["storage.type", "punctuation.operator", "support.function.firebug"],
492
- regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
326
+ regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
493
327
  }, {
494
328
  token : keywordMapper,
495
329
  regex : identifierRe
496
330
  }, {
497
331
  token : "keyword.operator",
498
- regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
332
+ regex : /--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
499
333
  next : "start"
500
334
  }, {
501
335
  token : "punctuation.operator",
502
- regex : /\?|\:|\,|\;|\./,
336
+ regex : /[?:,;.]/,
503
337
  next : "start"
504
338
  }, {
505
339
  token : "paren.lparen",
@@ -508,10 +342,6 @@ var JavaScriptHighlightRules = function() {
508
342
  }, {
509
343
  token : "paren.rparen",
510
344
  regex : /[\])}]/
511
- }, {
512
- token : "keyword.operator",
513
- regex : /\/=?/,
514
- next : "start"
515
345
  }, {
516
346
  token: "comment",
517
347
  regex: /^#!.*$/
@@ -572,7 +402,7 @@ var JavaScriptHighlightRules = function() {
572
402
  ],
573
403
  "regex_character_class": [
574
404
  {
575
- token: "regexp.keyword.operator",
405
+ token: "regexp.charclass.keyword.operator",
576
406
  regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
577
407
  }, {
578
408
  token: "constant.language.escape",
@@ -654,9 +484,49 @@ var JavaScriptHighlightRules = function() {
654
484
  }
655
485
  ]
656
486
  };
657
-
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
+
658
526
  this.embedRules(DocCommentHighlightRules, "doc-",
659
527
  [ DocCommentHighlightRules.getEndRule("no_regex") ]);
528
+
529
+ this.normalizeRules();
660
530
  };
661
531
 
662
532
  oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@@ -664,111 +534,81 @@ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
664
534
  exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
665
535
  });
666
536
 
667
- define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
668
-
669
-
670
- var oop = require("../lib/oop");
671
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
672
-
673
- var DocCommentHighlightRules = function() {
674
-
675
- this.$rules = {
676
- "start" : [ {
677
- token : "comment.doc.tag",
678
- regex : "@[\\w\\d_]+" // TODO: fix email addresses
679
- }, {
680
- token : "comment.doc.tag",
681
- regex : "\\bTODO\\b"
682
- }, {
683
- defaultToken : "comment.doc"
684
- }]
685
- };
686
- };
687
-
688
- oop.inherits(DocCommentHighlightRules, TextHighlightRules);
689
-
690
- DocCommentHighlightRules.getStartRule = function(start) {
691
- return {
692
- token : "comment.doc", // doc comment
693
- regex : "\\/\\*(?=\\*)",
694
- next : start
695
- };
696
- };
697
-
698
- DocCommentHighlightRules.getEndRule = function (start) {
699
- return {
700
- token : "comment.doc", // closing comment
701
- regex : "\\*\\/",
702
- next : start
703
- };
704
- };
705
-
706
-
707
- exports.DocCommentHighlightRules = DocCommentHighlightRules;
708
-
709
- });
710
-
711
- 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) {
712
-
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";
713
539
 
714
540
  var oop = require("../lib/oop");
715
- var xmlUtil = require("./xml_util");
716
541
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
717
542
 
718
543
  var XmlHighlightRules = function(normalize) {
719
544
  this.$rules = {
720
545
  start : [
721
- {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"},
546
+ {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
722
547
  {
723
- token : ["punctuation.instruction.begin", "keyword.instruction"],
724
- regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration"
548
+ token : ["punctuation.xml-decl.xml", "keyword.xml-decl.xml"],
549
+ regex : "(<\\?)(xml)(?=[\\s])", next : "xml_decl", caseInsensitive: true
725
550
  },
726
551
  {
727
- token : ["punctuation.instruction.begin", "keyword.instruction"],
728
- regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction"
552
+ token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
553
+ regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "processing_instruction",
729
554
  },
730
- {token : "comment", regex : "<\\!--", next : "comment"},
555
+ {token : "comment.xml", regex : "<\\!--", next : "comment"},
731
556
  {
732
- token : ["punctuation.doctype.begin", "meta.tag.doctype"],
733
- regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype"
557
+ token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
558
+ regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
734
559
  },
735
560
  {include : "tag"},
736
- {include : "reference"}
561
+ {token : "text.end-tag-open.xml", regex: "</"},
562
+ {token : "text.tag-open.xml", regex: "<"},
563
+ {include : "reference"},
564
+ {defaultToken : "text.xml"}
737
565
  ],
738
566
 
739
- xml_declaration : [
740
- {include : "attributes"},
741
- {include : "instruction"}
742
- ],
567
+ xml_decl : [{
568
+ token : "entity.other.attribute-name.decl-attribute-name.xml",
569
+ regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
570
+ }, {
571
+ token : "keyword.operator.decl-attribute-equals.xml",
572
+ regex : "="
573
+ }, {
574
+ include: "whitespace"
575
+ }, {
576
+ include: "string"
577
+ }, {
578
+ token : "punctuation.xml-decl.xml",
579
+ regex : "\\?>",
580
+ next : "start"
581
+ }],
743
582
 
744
- instruction : [
745
- {token : "punctuation.instruction.end", regex : "\\?>", next : "start"}
583
+ processing_instruction : [
584
+ {token : "punctuation.instruction.xml", regex : "\\?>", next : "start"},
585
+ {defaultToken : "instruction.xml"}
746
586
  ],
747
587
 
748
588
  doctype : [
749
- {include : "space"},
589
+ {include : "whitespace"},
750
590
  {include : "string"},
751
- {token : "punctuation.doctype.end", regex : ">", next : "start"},
752
- {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"},
753
- {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"}
754
594
  ],
755
595
 
756
- declarations : [{
757
- token : "text",
596
+ int_subset : [{
597
+ token : "text.xml",
758
598
  regex : "\\s+"
759
599
  }, {
760
- token: "punctuation.end",
600
+ token: "punctuation.int-subset.xml",
761
601
  regex: "]",
762
602
  next: "pop"
763
603
  }, {
764
- token : ["punctuation.begin", "keyword"],
604
+ token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
765
605
  regex : "(<\\!)([-_a-zA-Z0-9]+)",
766
606
  push : [{
767
607
  token : "text",
768
608
  regex : "\\s+"
769
609
  },
770
610
  {
771
- token : "punctuation.end",
611
+ token : "punctuation.markup-decl.xml",
772
612
  regex : ">",
773
613
  next : "pop"
774
614
  },
@@ -776,75 +616,85 @@ var XmlHighlightRules = function(normalize) {
776
616
  }],
777
617
 
778
618
  cdata : [
779
- {token : "string.end", regex : "\\]\\]>", next : "start"},
780
- {token : "text", regex : "\\s+"},
781
- {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"}
619
+ {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
620
+ {token : "text.xml", regex : "\\s+"},
621
+ {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
782
622
  ],
783
623
 
784
624
  comment : [
785
- {token : "comment", regex : "-->", next : "start"},
786
- {defaultToken : "comment"}
625
+ {token : "comment.xml", regex : "-->", next : "start"},
626
+ {defaultToken : "comment.xml"}
787
627
  ],
788
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
+
789
639
  tag : [{
790
- token : ["meta.tag.punctuation.begin", "meta.tag.name"],
791
- 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]+)",
792
642
  next: [
793
643
  {include : "attributes"},
794
- {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"}
795
- ]
796
- }, {
797
- token : ["meta.tag.punctuation.begin", "meta.tag.name"],
798
- regex : "(</)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
799
- next: [
800
- {include : "space"},
801
- {token : "meta.tag.punctuation.end", regex : ">", next : "start"}
644
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
802
645
  ]
803
646
  }],
804
647
 
805
- space : [
806
- {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+"}
807
653
  ],
808
-
809
- reference : [{
810
- token : "constant.language.escape",
811
- regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
812
- }, {
813
- token : "text", regex : "&"
814
- }],
815
-
816
654
  string: [{
817
- token : "string",
655
+ token : "string.xml",
818
656
  regex : "'",
819
- push : "qstring_inner"
657
+ push : [
658
+ {token : "string.xml", regex: "'", next: "pop"},
659
+ {defaultToken : "string.xml"}
660
+ ]
820
661
  }, {
821
- token : "string",
662
+ token : "string.xml",
822
663
  regex : '"',
823
- push : "qqstring_inner"
664
+ push : [
665
+ {token : "string.xml", regex: '"', next: "pop"},
666
+ {defaultToken : "string.xml"}
667
+ ]
824
668
  }],
825
669
 
826
- qstring_inner: [
827
- {token : "string", regex: "'", next: "pop"},
828
- {include : "reference"},
829
- {defaultToken : "string"}
830
- ],
831
-
832
- qqstring_inner: [
833
- {token : "string", regex: '"', next: "pop"},
834
- {include : "reference"},
835
- {defaultToken : "string"}
836
- ],
837
-
838
670
  attributes: [{
839
- token : "entity.other.attribute-name",
671
+ token : "entity.other.attribute-name.xml",
840
672
  regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
841
673
  }, {
842
- token : "keyword.operator.separator",
674
+ token : "keyword.operator.attribute-equals.xml",
843
675
  regex : "="
844
676
  }, {
845
- 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
+ ]
846
690
  }, {
847
- 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
+ ]
848
698
  }]
849
699
  };
850
700
 
@@ -857,18 +707,17 @@ var XmlHighlightRules = function(normalize) {
857
707
 
858
708
  this.embedTagRules = function(HighlightRules, prefix, tag){
859
709
  this.$rules.tag.unshift({
860
- token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag],
861
- regex : "(<)(" + tag + ")",
710
+ token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
711
+ regex : "(<)(" + tag + "(?=\\s|>|$))",
862
712
  next: [
863
- {include : "space"},
864
713
  {include : "attributes"},
865
- {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"}
714
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
866
715
  ]
867
716
  });
868
717
 
869
718
  this.$rules[tag + "-end"] = [
870
- {include : "space"},
871
- {token : "meta.tag.punctuation.end", regex : ">", next: "start",
719
+ {include : "attributes"},
720
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
872
721
  onMatch : function(value, currentState, stack) {
873
722
  stack.splice(0);
874
723
  return this.token;
@@ -876,14 +725,14 @@ var XmlHighlightRules = function(normalize) {
876
725
  ]
877
726
 
878
727
  this.embedRules(HighlightRules, prefix, [{
879
- token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag],
880
- regex : "(</)(" + tag + ")",
728
+ token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
729
+ regex : "(</)(" + tag + "(?=\\s|>|$))",
881
730
  next: tag + "-end"
882
731
  }, {
883
- token: "string.begin",
732
+ token: "string.cdata.xml",
884
733
  regex : "<\\!\\[CDATA\\["
885
734
  }, {
886
- token: "string.end",
735
+ token: "string.cdata.xml",
887
736
  regex : "\\]\\]>"
888
737
  }]);
889
738
  };
@@ -895,77 +744,90 @@ oop.inherits(XmlHighlightRules, TextHighlightRules);
895
744
  exports.XmlHighlightRules = XmlHighlightRules;
896
745
  });
897
746
 
898
- define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
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";
749
+
750
+ var oop = require("../lib/oop");
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;
755
+
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'
774
+ });
899
775
 
776
+ var HtmlHighlightRules = function() {
777
+ XmlHighlightRules.call(this);
900
778
 
901
- function string(state) {
902
- return [{
903
- token : "string",
904
- regex : '"',
905
- next : state + "_qqstring"
906
- }, {
907
- token : "string",
908
- regex : "'",
909
- next : state + "_qstring"
910
- }];
911
- }
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
+ });
912
816
 
913
- function multiLineString(quote, state) {
914
- return [
915
- {token : "string", regex : quote, next : state},
916
- {
917
- token : "constant.language.escape",
918
- regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
919
- },
920
- {defaultToken : "string"}
921
- ];
922
- }
817
+ this.embedTagRules(CssHighlightRules, "css-", "style");
818
+ this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
923
819
 
924
- exports.tag = function(states, name, nextState, tagMap) {
925
- states[name] = [{
926
- token : "text",
927
- regex : "\\s+"
928
- }, {
929
-
930
- token : !tagMap ? "meta.tag.tag-name" : function(value) {
931
- if (tagMap[value])
932
- return "meta.tag.tag-name." + tagMap[value];
933
- else
934
- return "meta.tag.tag-name";
935
- },
936
- regex : "[-_a-zA-Z0-9:]+",
937
- next : name + "_embed_attribute_list"
938
- }, {
939
- token: "empty",
940
- regex: "",
941
- next : name + "_embed_attribute_list"
942
- }];
943
-
944
- states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
945
- states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
946
-
947
- states[name + "_embed_attribute_list"] = [{
948
- token : "meta.tag.r",
949
- regex : "/?>",
950
- next : nextState
951
- }, {
952
- token : "keyword.operator",
953
- regex : "="
954
- }, {
955
- token : "entity.other.attribute-name",
956
- regex : "[-_a-zA-Z0-9:]+"
957
- }, {
958
- token : "constant.numeric", // float
959
- regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
960
- }, {
961
- token : "text",
962
- regex : "\\s+"
963
- }].concat(string(name));
820
+ if (this.constructor === HtmlHighlightRules)
821
+ this.normalizeRules();
964
822
  };
965
823
 
824
+ oop.inherits(HtmlHighlightRules, XmlHighlightRules);
825
+
826
+ exports.HtmlHighlightRules = HtmlHighlightRules;
966
827
  });
967
- define('ace/mode/java_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
968
828
 
829
+ define("ace/mode/java_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
830
+ "use strict";
969
831
 
970
832
  var oop = require("../lib/oop");
971
833
  var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
@@ -1033,9 +895,6 @@ var JavaHighlightRules = function() {
1033
895
  token : "comment", // multi line comment
1034
896
  regex : "\\/\\*",
1035
897
  next : "comment"
1036
- }, {
1037
- token : "string.regexp",
1038
- regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
1039
898
  }, {
1040
899
  token : "string", // single line
1041
900
  regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
@@ -1089,8 +948,70 @@ oop.inherits(JavaHighlightRules, TextHighlightRules);
1089
948
  exports.JavaHighlightRules = JavaHighlightRules;
1090
949
  });
1091
950
 
1092
- define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
951
+ define("ace/mode/jsp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules","ace/mode/java_highlight_rules"], function(require, exports, module) {
952
+ "use strict";
953
+
954
+ var oop = require("../lib/oop");
955
+ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
956
+ var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules;
957
+
958
+ var JspHighlightRules = function() {
959
+ HtmlHighlightRules.call(this);
960
+
961
+ var builtinVariables = 'request|response|out|session|' +
962
+ 'application|config|pageContext|page|Exception';
963
+
964
+ var keywords = 'page|include|taglib';
965
+
966
+ var startRules = [
967
+ {
968
+ token : "comment",
969
+ regex : "<%--",
970
+ push : "jsp-dcomment"
971
+ }, {
972
+ token : "meta.tag", // jsp open tag
973
+ regex : "<%@?|<%=?|<jsp:[^>]+>",
974
+ push : "jsp-start"
975
+ }
976
+ ];
977
+
978
+ var endRules = [
979
+ {
980
+ token : "meta.tag", // jsp close tag
981
+ regex : "%>|<\\/jsp:[^>]+>",
982
+ next : "pop"
983
+ }, {
984
+ token: "variable.language",
985
+ regex : builtinVariables
986
+ }, {
987
+ token: "keyword",
988
+ regex : keywords
989
+ }
990
+ ];
991
+
992
+ for (var key in this.$rules)
993
+ this.$rules[key].unshift.apply(this.$rules[key], startRules);
994
+
995
+ this.embedRules(JavaHighlightRules, "jsp-", endRules, ["start"]);
996
+
997
+ this.addRules({
998
+ "jsp-dcomment" : [{
999
+ token : "comment",
1000
+ regex : ".*?--%>",
1001
+ next : "pop"
1002
+ }]
1003
+ });
1004
+
1005
+ this.normalizeRules();
1006
+ };
1007
+
1008
+ oop.inherits(JspHighlightRules, HtmlHighlightRules);
1009
+
1010
+ exports.JspHighlightRules = JspHighlightRules;
1011
+ });
1093
1012
 
1013
+ define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
1014
+ "use strict";
1094
1015
 
1095
1016
  var Range = require("../range").Range;
1096
1017
 
@@ -1129,8 +1050,8 @@ var MatchingBraceOutdent = function() {};
1129
1050
  exports.MatchingBraceOutdent = MatchingBraceOutdent;
1130
1051
  });
1131
1052
 
1132
- define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
1133
-
1053
+ define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
1054
+ "use strict";
1134
1055
 
1135
1056
  var oop = require("../../lib/oop");
1136
1057
  var Behaviour = require("../behaviour").Behaviour;
@@ -1142,83 +1063,34 @@ var SAFE_INSERT_IN_TOKENS =
1142
1063
  var SAFE_INSERT_BEFORE_TOKENS =
1143
1064
  ["text", "paren.rparen", "punctuation.operator", "comment"];
1144
1065
 
1145
-
1146
- var autoInsertedBrackets = 0;
1147
- var autoInsertedRow = -1;
1148
- var autoInsertedLineEnd = "";
1149
- var maybeInsertedBrackets = 0;
1150
- var maybeInsertedRow = -1;
1151
- var maybeInsertedLineStart = "";
1152
- var maybeInsertedLineEnd = "";
1153
-
1154
- var CstyleBehaviour = function () {
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, autoInsertedLineEnd[0]))
1177
- autoInsertedBrackets = 0;
1178
- autoInsertedRow = cursor.row;
1179
- autoInsertedLineEnd = bracket + line.substr(cursor.column);
1180
- 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
- maybeInsertedBrackets = 0;
1188
- maybeInsertedRow = cursor.row;
1189
- maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
1190
- maybeInsertedLineEnd = line.substr(cursor.column);
1191
- maybeInsertedBrackets++;
1192
- };
1193
-
1194
- CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
1195
- return autoInsertedBrackets > 0 &&
1196
- cursor.row === autoInsertedRow &&
1197
- bracket === autoInsertedLineEnd[0] &&
1198
- line.substr(cursor.column) === autoInsertedLineEnd;
1199
- };
1200
-
1201
- CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
1202
- return maybeInsertedBrackets > 0 &&
1203
- cursor.row === maybeInsertedRow &&
1204
- line.substr(cursor.column) === maybeInsertedLineEnd &&
1205
- line.substr(0, cursor.column) == maybeInsertedLineStart;
1206
- };
1207
-
1208
- CstyleBehaviour.popAutoInsertedClosing = function() {
1209
- autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
1210
- autoInsertedBrackets--;
1211
- };
1212
-
1213
- CstyleBehaviour.clearMaybeInsertedClosing = function() {
1214
- maybeInsertedBrackets = 0;
1215
- maybeInsertedRow = -1;
1066
+ var context;
1067
+ var contextCache = {}
1068
+ var initContext = function(editor) {
1069
+ var id = -1;
1070
+ if (editor.multiSelect) {
1071
+ id = editor.selection.id;
1072
+ if (contextCache.rangeCount != editor.multiSelect.rangeCount)
1073
+ contextCache = {rangeCount: editor.multiSelect.rangeCount};
1074
+ }
1075
+ if (contextCache[id])
1076
+ return context = contextCache[id];
1077
+ context = contextCache[id] = {
1078
+ autoInsertedBrackets: 0,
1079
+ autoInsertedRow: -1,
1080
+ autoInsertedLineEnd: "",
1081
+ maybeInsertedBrackets: 0,
1082
+ maybeInsertedRow: -1,
1083
+ maybeInsertedLineStart: "",
1084
+ maybeInsertedLineEnd: ""
1216
1085
  };
1086
+ };
1217
1087
 
1218
- this.add("braces", "insertion", function (state, action, editor, session, text) {
1088
+ var CstyleBehaviour = function() {
1089
+ this.add("braces", "insertion", function(state, action, editor, session, text) {
1219
1090
  var cursor = editor.getCursorPosition();
1220
1091
  var line = session.doc.getLine(cursor.row);
1221
1092
  if (text == '{') {
1093
+ initContext(editor);
1222
1094
  var selection = editor.getSelectionRange();
1223
1095
  var selected = session.doc.getTextRange(selection);
1224
1096
  if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
@@ -1242,6 +1114,7 @@ var CstyleBehaviour = function () {
1242
1114
  }
1243
1115
  }
1244
1116
  } else if (text == '}') {
1117
+ initContext(editor);
1245
1118
  var rightChar = line.substring(cursor.column, cursor.column + 1);
1246
1119
  if (rightChar == '}') {
1247
1120
  var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
@@ -1254,9 +1127,10 @@ var CstyleBehaviour = function () {
1254
1127
  }
1255
1128
  }
1256
1129
  } else if (text == "\n" || text == "\r\n") {
1130
+ initContext(editor);
1257
1131
  var closing = "";
1258
1132
  if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
1259
- closing = lang.stringRepeat("}", maybeInsertedBrackets);
1133
+ closing = lang.stringRepeat("}", context.maybeInsertedBrackets);
1260
1134
  CstyleBehaviour.clearMaybeInsertedClosing();
1261
1135
  }
1262
1136
  var rightChar = line.substring(cursor.column, cursor.column + 1);
@@ -1268,6 +1142,7 @@ var CstyleBehaviour = function () {
1268
1142
  } else if (closing) {
1269
1143
  var next_indent = this.$getIndent(line);
1270
1144
  } else {
1145
+ CstyleBehaviour.clearMaybeInsertedClosing();
1271
1146
  return;
1272
1147
  }
1273
1148
  var indent = next_indent + session.getTabString();
@@ -1281,22 +1156,24 @@ var CstyleBehaviour = function () {
1281
1156
  }
1282
1157
  });
1283
1158
 
1284
- this.add("braces", "deletion", function (state, action, editor, session, range) {
1159
+ this.add("braces", "deletion", function(state, action, editor, session, range) {
1285
1160
  var selected = session.doc.getTextRange(range);
1286
1161
  if (!range.isMultiLine() && selected == '{') {
1162
+ initContext(editor);
1287
1163
  var line = session.doc.getLine(range.start.row);
1288
1164
  var rightChar = line.substring(range.end.column, range.end.column + 1);
1289
1165
  if (rightChar == '}') {
1290
1166
  range.end.column++;
1291
1167
  return range;
1292
1168
  } else {
1293
- maybeInsertedBrackets--;
1169
+ context.maybeInsertedBrackets--;
1294
1170
  }
1295
1171
  }
1296
1172
  });
1297
1173
 
1298
- this.add("parens", "insertion", function (state, action, editor, session, text) {
1174
+ this.add("parens", "insertion", function(state, action, editor, session, text) {
1299
1175
  if (text == '(') {
1176
+ initContext(editor);
1300
1177
  var selection = editor.getSelectionRange();
1301
1178
  var selected = session.doc.getTextRange(selection);
1302
1179
  if (selected !== "" && editor.getWrapBehavioursEnabled()) {
@@ -1312,6 +1189,7 @@ var CstyleBehaviour = function () {
1312
1189
  };
1313
1190
  }
1314
1191
  } else if (text == ')') {
1192
+ initContext(editor);
1315
1193
  var cursor = editor.getCursorPosition();
1316
1194
  var line = session.doc.getLine(cursor.row);
1317
1195
  var rightChar = line.substring(cursor.column, cursor.column + 1);
@@ -1328,9 +1206,10 @@ var CstyleBehaviour = function () {
1328
1206
  }
1329
1207
  });
1330
1208
 
1331
- this.add("parens", "deletion", function (state, action, editor, session, range) {
1209
+ this.add("parens", "deletion", function(state, action, editor, session, range) {
1332
1210
  var selected = session.doc.getTextRange(range);
1333
1211
  if (!range.isMultiLine() && selected == '(') {
1212
+ initContext(editor);
1334
1213
  var line = session.doc.getLine(range.start.row);
1335
1214
  var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1336
1215
  if (rightChar == ')') {
@@ -1340,8 +1219,9 @@ var CstyleBehaviour = function () {
1340
1219
  }
1341
1220
  });
1342
1221
 
1343
- this.add("brackets", "insertion", function (state, action, editor, session, text) {
1222
+ this.add("brackets", "insertion", function(state, action, editor, session, text) {
1344
1223
  if (text == '[') {
1224
+ initContext(editor);
1345
1225
  var selection = editor.getSelectionRange();
1346
1226
  var selected = session.doc.getTextRange(selection);
1347
1227
  if (selected !== "" && editor.getWrapBehavioursEnabled()) {
@@ -1357,6 +1237,7 @@ var CstyleBehaviour = function () {
1357
1237
  };
1358
1238
  }
1359
1239
  } else if (text == ']') {
1240
+ initContext(editor);
1360
1241
  var cursor = editor.getCursorPosition();
1361
1242
  var line = session.doc.getLine(cursor.row);
1362
1243
  var rightChar = line.substring(cursor.column, cursor.column + 1);
@@ -1373,9 +1254,10 @@ var CstyleBehaviour = function () {
1373
1254
  }
1374
1255
  });
1375
1256
 
1376
- this.add("brackets", "deletion", function (state, action, editor, session, range) {
1257
+ this.add("brackets", "deletion", function(state, action, editor, session, range) {
1377
1258
  var selected = session.doc.getTextRange(range);
1378
1259
  if (!range.isMultiLine() && selected == '[') {
1260
+ initContext(editor);
1379
1261
  var line = session.doc.getLine(range.start.row);
1380
1262
  var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1381
1263
  if (rightChar == ']') {
@@ -1385,8 +1267,9 @@ var CstyleBehaviour = function () {
1385
1267
  }
1386
1268
  });
1387
1269
 
1388
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
1270
+ this.add("string_dquotes", "insertion", function(state, action, editor, session, text) {
1389
1271
  if (text == '"' || text == "'") {
1272
+ initContext(editor);
1390
1273
  var quote = text;
1391
1274
  var selection = editor.getSelectionRange();
1392
1275
  var selected = session.doc.getTextRange(selection);
@@ -1438,9 +1321,10 @@ var CstyleBehaviour = function () {
1438
1321
  }
1439
1322
  });
1440
1323
 
1441
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
1324
+ this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
1442
1325
  var selected = session.doc.getTextRange(range);
1443
1326
  if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
1327
+ initContext(editor);
1444
1328
  var line = session.doc.getLine(range.start.row);
1445
1329
  var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1446
1330
  if (rightChar == selected) {
@@ -1452,13 +1336,80 @@ var CstyleBehaviour = function () {
1452
1336
 
1453
1337
  };
1454
1338
 
1339
+
1340
+ CstyleBehaviour.isSaneInsertion = function(editor, session) {
1341
+ var cursor = editor.getCursorPosition();
1342
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
1343
+ if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
1344
+ var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
1345
+ if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
1346
+ return false;
1347
+ }
1348
+ iterator.stepForward();
1349
+ return iterator.getCurrentTokenRow() !== cursor.row ||
1350
+ this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
1351
+ };
1352
+
1353
+ CstyleBehaviour.$matchTokenType = function(token, types) {
1354
+ return types.indexOf(token.type || token) > -1;
1355
+ };
1356
+
1357
+ CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
1358
+ var cursor = editor.getCursorPosition();
1359
+ var line = session.doc.getLine(cursor.row);
1360
+ if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0]))
1361
+ context.autoInsertedBrackets = 0;
1362
+ context.autoInsertedRow = cursor.row;
1363
+ context.autoInsertedLineEnd = bracket + line.substr(cursor.column);
1364
+ context.autoInsertedBrackets++;
1365
+ };
1366
+
1367
+ CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
1368
+ var cursor = editor.getCursorPosition();
1369
+ var line = session.doc.getLine(cursor.row);
1370
+ if (!this.isMaybeInsertedClosing(cursor, line))
1371
+ context.maybeInsertedBrackets = 0;
1372
+ context.maybeInsertedRow = cursor.row;
1373
+ context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
1374
+ context.maybeInsertedLineEnd = line.substr(cursor.column);
1375
+ context.maybeInsertedBrackets++;
1376
+ };
1377
+
1378
+ CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
1379
+ return context.autoInsertedBrackets > 0 &&
1380
+ cursor.row === context.autoInsertedRow &&
1381
+ bracket === context.autoInsertedLineEnd[0] &&
1382
+ line.substr(cursor.column) === context.autoInsertedLineEnd;
1383
+ };
1384
+
1385
+ CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
1386
+ return context.maybeInsertedBrackets > 0 &&
1387
+ cursor.row === context.maybeInsertedRow &&
1388
+ line.substr(cursor.column) === context.maybeInsertedLineEnd &&
1389
+ line.substr(0, cursor.column) == context.maybeInsertedLineStart;
1390
+ };
1391
+
1392
+ CstyleBehaviour.popAutoInsertedClosing = function() {
1393
+ context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1);
1394
+ context.autoInsertedBrackets--;
1395
+ };
1396
+
1397
+ CstyleBehaviour.clearMaybeInsertedClosing = function() {
1398
+ if (context) {
1399
+ context.maybeInsertedBrackets = 0;
1400
+ context.maybeInsertedRow = -1;
1401
+ }
1402
+ };
1403
+
1404
+
1405
+
1455
1406
  oop.inherits(CstyleBehaviour, Behaviour);
1456
1407
 
1457
1408
  exports.CstyleBehaviour = CstyleBehaviour;
1458
1409
  });
1459
1410
 
1460
- define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
1461
-
1411
+ define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
1412
+ "use strict";
1462
1413
 
1463
1414
  var oop = require("../../lib/oop");
1464
1415
  var Range = require("../../range").Range;
@@ -1551,3 +1502,29 @@ oop.inherits(FoldMode, BaseFoldMode);
1551
1502
  }).call(FoldMode.prototype);
1552
1503
 
1553
1504
  });
1505
+
1506
+ define("ace/mode/jsp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/jsp_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) {
1507
+ "use strict";
1508
+
1509
+ var oop = require("../lib/oop");
1510
+ var TextMode = require("./text").Mode;
1511
+ var JspHighlightRules = require("./jsp_highlight_rules").JspHighlightRules;
1512
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1513
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
1514
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1515
+
1516
+ var Mode = function() {
1517
+ this.HighlightRules = JspHighlightRules;
1518
+ this.$outdent = new MatchingBraceOutdent();
1519
+ this.$behaviour = new CstyleBehaviour();
1520
+ this.foldingRules = new CStyleFoldMode();
1521
+ };
1522
+ oop.inherits(Mode, TextMode);
1523
+
1524
+ (function() {
1525
+
1526
+ this.$id = "ace/mode/jsp";
1527
+ }).call(Mode.prototype);
1528
+
1529
+ exports.Mode = Mode;
1530
+ });