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
- /* ***** 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/verilog', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/verilog_highlight_rules', 'ace/range'], 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 VerilogHighlightRules = require("./verilog_highlight_rules").VerilogHighlightRules;
38
- var Range = require("../range").Range;
39
-
40
- var Mode = function() {
41
- this.HighlightRules = VerilogHighlightRules;
42
- };
43
- oop.inherits(Mode, TextMode);
44
-
45
- (function() {
46
-
47
- this.lineCommentStart = "//";
48
- this.blockComment = {start: "/*", end: "*/"};
49
-
50
- this.$id = "ace/mode/verilog";
51
- }).call(Mode.prototype);
52
-
53
- exports.Mode = Mode;
54
-
55
- });
56
-
57
-
58
- define('ace/mode/verilog_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
59
-
1
+ define("ace/mode/verilog_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2
+ "use strict";
60
3
 
61
4
  var oop = require("../lib/oop");
62
5
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
@@ -125,3 +68,28 @@ oop.inherits(VerilogHighlightRules, TextHighlightRules);
125
68
 
126
69
  exports.VerilogHighlightRules = VerilogHighlightRules;
127
70
  });
71
+
72
+ define("ace/mode/verilog",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/verilog_highlight_rules","ace/range"], function(require, exports, module) {
73
+ "use strict";
74
+
75
+ var oop = require("../lib/oop");
76
+ var TextMode = require("./text").Mode;
77
+ var VerilogHighlightRules = require("./verilog_highlight_rules").VerilogHighlightRules;
78
+ var Range = require("../range").Range;
79
+
80
+ var Mode = function() {
81
+ this.HighlightRules = VerilogHighlightRules;
82
+ };
83
+ oop.inherits(Mode, TextMode);
84
+
85
+ (function() {
86
+
87
+ this.lineCommentStart = "//";
88
+ this.blockComment = {start: "/*", end: "*/"};
89
+
90
+ this.$id = "ace/mode/verilog";
91
+ }).call(Mode.prototype);
92
+
93
+ exports.Mode = Mode;
94
+
95
+ });
@@ -1,58 +1,5 @@
1
- /* ***** BEGIN LICENSE BLOCK *****
2
- * Distributed under the BSD license:
3
- *
4
- * Copyright (c) 2013, 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
- define('ace/mode/vhdl', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/vhdl_highlight_rules', 'ace/range'], function(require, exports, module) {
31
-
32
-
33
- var oop = require("../lib/oop");
34
- var TextMode = require("./text").Mode;
35
- var Tokenizer = require("../tokenizer").Tokenizer;
36
- var VHDLHighlightRules = require("./vhdl_highlight_rules").VHDLHighlightRules;
37
- var Range = require("../range").Range;
38
-
39
- var Mode = function() {
40
- this.HighlightRules = VHDLHighlightRules;
41
- };
42
- oop.inherits(Mode, TextMode);
43
-
44
- (function() {
45
-
46
- this.lineCommentStart = "--";
47
-
48
- this.$id = "ace/mode/vhdl";
49
- }).call(Mode.prototype);
50
-
51
- exports.Mode = Mode;
52
-
53
- });
54
- define('ace/mode/vhdl_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
55
-
1
+ define("ace/mode/vhdl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2
+ "use strict";
56
3
 
57
4
  var oop = require("../lib/oop");
58
5
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
@@ -137,3 +84,27 @@ oop.inherits(VHDLHighlightRules, TextHighlightRules);
137
84
 
138
85
  exports.VHDLHighlightRules = VHDLHighlightRules;
139
86
  });
87
+
88
+ define("ace/mode/vhdl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/vhdl_highlight_rules","ace/range"], function(require, exports, module) {
89
+ "use strict";
90
+
91
+ var oop = require("../lib/oop");
92
+ var TextMode = require("./text").Mode;
93
+ var VHDLHighlightRules = require("./vhdl_highlight_rules").VHDLHighlightRules;
94
+ var Range = require("../range").Range;
95
+
96
+ var Mode = function() {
97
+ this.HighlightRules = VHDLHighlightRules;
98
+ };
99
+ oop.inherits(Mode, TextMode);
100
+
101
+ (function() {
102
+
103
+ this.lineCommentStart = "--";
104
+
105
+ this.$id = "ace/mode/vhdl";
106
+ }).call(Mode.prototype);
107
+
108
+ exports.Mode = Mode;
109
+
110
+ });
@@ -1,122 +1,78 @@
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/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/xml_highlight_rules', 'ace/mode/behaviour/xml', 'ace/mode/folding/xml'], function(require, exports, module) {
32
-
1
+ define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2
+ "use strict";
33
3
 
34
4
  var oop = require("../lib/oop");
35
- var TextMode = require("./text").Mode;
36
- var Tokenizer = require("../tokenizer").Tokenizer;
37
- var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
38
- var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
39
- var XmlFoldMode = require("./folding/xml").FoldMode;
40
-
41
- var Mode = function() {
42
- this.HighlightRules = XmlHighlightRules;
43
- this.$behaviour = new XmlBehaviour();
44
- this.foldingRules = new XmlFoldMode();
45
- };
46
-
47
- oop.inherits(Mode, TextMode);
48
-
49
- (function() {
50
-
51
- this.blockComment = {start: "<!--", end: "-->"};
52
-
53
- this.$id = "ace/mode/xml";
54
- }).call(Mode.prototype);
55
-
56
- exports.Mode = Mode;
57
- });
58
-
59
- 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) {
60
-
61
-
62
- var oop = require("../lib/oop");
63
- var xmlUtil = require("./xml_util");
64
5
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
65
6
 
66
7
  var XmlHighlightRules = function(normalize) {
67
8
  this.$rules = {
68
9
  start : [
69
- {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"},
10
+ {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
70
11
  {
71
- token : ["punctuation.instruction.begin", "keyword.instruction"],
72
- regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration"
12
+ token : ["punctuation.xml-decl.xml", "keyword.xml-decl.xml"],
13
+ regex : "(<\\?)(xml)(?=[\\s])", next : "xml_decl", caseInsensitive: true
73
14
  },
74
15
  {
75
- token : ["punctuation.instruction.begin", "keyword.instruction"],
76
- regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction"
16
+ token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
17
+ regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "processing_instruction",
77
18
  },
78
- {token : "comment", regex : "<\\!--", next : "comment"},
19
+ {token : "comment.xml", regex : "<\\!--", next : "comment"},
79
20
  {
80
- token : ["punctuation.doctype.begin", "meta.tag.doctype"],
81
- regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype"
21
+ token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
22
+ regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
82
23
  },
83
24
  {include : "tag"},
84
- {include : "reference"}
25
+ {token : "text.end-tag-open.xml", regex: "</"},
26
+ {token : "text.tag-open.xml", regex: "<"},
27
+ {include : "reference"},
28
+ {defaultToken : "text.xml"}
85
29
  ],
86
30
 
87
- xml_declaration : [
88
- {include : "attributes"},
89
- {include : "instruction"}
90
- ],
31
+ xml_decl : [{
32
+ token : "entity.other.attribute-name.decl-attribute-name.xml",
33
+ regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
34
+ }, {
35
+ token : "keyword.operator.decl-attribute-equals.xml",
36
+ regex : "="
37
+ }, {
38
+ include: "whitespace"
39
+ }, {
40
+ include: "string"
41
+ }, {
42
+ token : "punctuation.xml-decl.xml",
43
+ regex : "\\?>",
44
+ next : "start"
45
+ }],
91
46
 
92
- instruction : [
93
- {token : "punctuation.instruction.end", regex : "\\?>", next : "start"}
47
+ processing_instruction : [
48
+ {token : "punctuation.instruction.xml", regex : "\\?>", next : "start"},
49
+ {defaultToken : "instruction.xml"}
94
50
  ],
95
51
 
96
52
  doctype : [
97
- {include : "space"},
53
+ {include : "whitespace"},
98
54
  {include : "string"},
99
- {token : "punctuation.doctype.end", regex : ">", next : "start"},
100
- {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"},
101
- {token : "punctuation.begin", regex : "\\[", push : "declarations"}
55
+ {token : "xml-pe.doctype.xml", regex : ">", next : "start"},
56
+ {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
57
+ {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
102
58
  ],
103
59
 
104
- declarations : [{
105
- token : "text",
60
+ int_subset : [{
61
+ token : "text.xml",
106
62
  regex : "\\s+"
107
63
  }, {
108
- token: "punctuation.end",
64
+ token: "punctuation.int-subset.xml",
109
65
  regex: "]",
110
66
  next: "pop"
111
67
  }, {
112
- token : ["punctuation.begin", "keyword"],
68
+ token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
113
69
  regex : "(<\\!)([-_a-zA-Z0-9]+)",
114
70
  push : [{
115
71
  token : "text",
116
72
  regex : "\\s+"
117
73
  },
118
74
  {
119
- token : "punctuation.end",
75
+ token : "punctuation.markup-decl.xml",
120
76
  regex : ">",
121
77
  next : "pop"
122
78
  },
@@ -124,75 +80,85 @@ var XmlHighlightRules = function(normalize) {
124
80
  }],
125
81
 
126
82
  cdata : [
127
- {token : "string.end", regex : "\\]\\]>", next : "start"},
128
- {token : "text", regex : "\\s+"},
129
- {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"}
83
+ {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
84
+ {token : "text.xml", regex : "\\s+"},
85
+ {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
130
86
  ],
131
87
 
132
88
  comment : [
133
- {token : "comment", regex : "-->", next : "start"},
134
- {defaultToken : "comment"}
89
+ {token : "comment.xml", regex : "-->", next : "start"},
90
+ {defaultToken : "comment.xml"}
135
91
  ],
136
92
 
93
+ reference : [{
94
+ token : "constant.language.escape.reference.xml",
95
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
96
+ }],
97
+
98
+ attr_reference : [{
99
+ token : "constant.language.escape.reference.attribute-value.xml",
100
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
101
+ }],
102
+
137
103
  tag : [{
138
- token : ["meta.tag.punctuation.begin", "meta.tag.name"],
139
- regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
104
+ token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
105
+ regex : "(?:(<)|(</))((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
140
106
  next: [
141
107
  {include : "attributes"},
142
- {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"}
143
- ]
144
- }, {
145
- token : ["meta.tag.punctuation.begin", "meta.tag.name"],
146
- regex : "(</)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
147
- next: [
148
- {include : "space"},
149
- {token : "meta.tag.punctuation.end", regex : ">", next : "start"}
108
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
150
109
  ]
151
110
  }],
152
111
 
153
- space : [
154
- {token : "text", regex : "\\s+"}
112
+ tag_whitespace : [
113
+ {token : "text.tag-whitespace.xml", regex : "\\s+"}
114
+ ],
115
+ whitespace : [
116
+ {token : "text.whitespace.xml", regex : "\\s+"}
155
117
  ],
156
-
157
- reference : [{
158
- token : "constant.language.escape",
159
- regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
160
- }, {
161
- token : "text", regex : "&"
162
- }],
163
-
164
118
  string: [{
165
- token : "string",
119
+ token : "string.xml",
166
120
  regex : "'",
167
- push : "qstring_inner"
121
+ push : [
122
+ {token : "string.xml", regex: "'", next: "pop"},
123
+ {defaultToken : "string.xml"}
124
+ ]
168
125
  }, {
169
- token : "string",
126
+ token : "string.xml",
170
127
  regex : '"',
171
- push : "qqstring_inner"
128
+ push : [
129
+ {token : "string.xml", regex: '"', next: "pop"},
130
+ {defaultToken : "string.xml"}
131
+ ]
172
132
  }],
173
133
 
174
- qstring_inner: [
175
- {token : "string", regex: "'", next: "pop"},
176
- {include : "reference"},
177
- {defaultToken : "string"}
178
- ],
179
-
180
- qqstring_inner: [
181
- {token : "string", regex: '"', next: "pop"},
182
- {include : "reference"},
183
- {defaultToken : "string"}
184
- ],
185
-
186
134
  attributes: [{
187
- token : "entity.other.attribute-name",
135
+ token : "entity.other.attribute-name.xml",
188
136
  regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
189
137
  }, {
190
- token : "keyword.operator.separator",
138
+ token : "keyword.operator.attribute-equals.xml",
191
139
  regex : "="
192
140
  }, {
193
- include : "space"
141
+ include: "tag_whitespace"
142
+ }, {
143
+ include: "attribute_value"
144
+ }],
145
+
146
+ attribute_value: [{
147
+ token : "string.attribute-value.xml",
148
+ regex : "'",
149
+ push : [
150
+ {token : "string.attribute-value.xml", regex: "'", next: "pop"},
151
+ {include : "attr_reference"},
152
+ {defaultToken : "string.attribute-value.xml"}
153
+ ]
194
154
  }, {
195
- include : "string"
155
+ token : "string.attribute-value.xml",
156
+ regex : '"',
157
+ push : [
158
+ {token : "string.attribute-value.xml", regex: '"', next: "pop"},
159
+ {include : "attr_reference"},
160
+ {defaultToken : "string.attribute-value.xml"}
161
+ ]
196
162
  }]
197
163
  };
198
164
 
@@ -205,18 +171,17 @@ var XmlHighlightRules = function(normalize) {
205
171
 
206
172
  this.embedTagRules = function(HighlightRules, prefix, tag){
207
173
  this.$rules.tag.unshift({
208
- token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag],
209
- regex : "(<)(" + tag + ")",
174
+ token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
175
+ regex : "(<)(" + tag + "(?=\\s|>|$))",
210
176
  next: [
211
- {include : "space"},
212
177
  {include : "attributes"},
213
- {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"}
178
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
214
179
  ]
215
180
  });
216
181
 
217
182
  this.$rules[tag + "-end"] = [
218
- {include : "space"},
219
- {token : "meta.tag.punctuation.end", regex : ">", next: "start",
183
+ {include : "attributes"},
184
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
220
185
  onMatch : function(value, currentState, stack) {
221
186
  stack.splice(0);
222
187
  return this.token;
@@ -224,14 +189,14 @@ var XmlHighlightRules = function(normalize) {
224
189
  ]
225
190
 
226
191
  this.embedRules(HighlightRules, prefix, [{
227
- token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag],
228
- regex : "(</)(" + tag + ")",
192
+ token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
193
+ regex : "(</)(" + tag + "(?=\\s|>|$))",
229
194
  next: tag + "-end"
230
195
  }, {
231
- token: "string.begin",
196
+ token: "string.cdata.xml",
232
197
  regex : "<\\!\\[CDATA\\["
233
198
  }, {
234
- token: "string.end",
199
+ token: "string.cdata.xml",
235
200
  regex : "\\]\\]>"
236
201
  }]);
237
202
  };
@@ -243,480 +208,141 @@ oop.inherits(XmlHighlightRules, TextHighlightRules);
243
208
  exports.XmlHighlightRules = XmlHighlightRules;
244
209
  });
245
210
 
246
- define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
247
-
248
-
249
- function string(state) {
250
- return [{
251
- token : "string",
252
- regex : '"',
253
- next : state + "_qqstring"
254
- }, {
255
- token : "string",
256
- regex : "'",
257
- next : state + "_qstring"
258
- }];
259
- }
260
-
261
- function multiLineString(quote, state) {
262
- return [
263
- {token : "string", regex : quote, next : state},
264
- {
265
- token : "constant.language.escape",
266
- regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
267
- },
268
- {defaultToken : "string"}
269
- ];
270
- }
271
-
272
- exports.tag = function(states, name, nextState, tagMap) {
273
- states[name] = [{
274
- token : "text",
275
- regex : "\\s+"
276
- }, {
277
-
278
- token : !tagMap ? "meta.tag.tag-name" : function(value) {
279
- if (tagMap[value])
280
- return "meta.tag.tag-name." + tagMap[value];
281
- else
282
- return "meta.tag.tag-name";
283
- },
284
- regex : "[-_a-zA-Z0-9:]+",
285
- next : name + "_embed_attribute_list"
286
- }, {
287
- token: "empty",
288
- regex: "",
289
- next : name + "_embed_attribute_list"
290
- }];
291
-
292
- states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
293
- states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
294
-
295
- states[name + "_embed_attribute_list"] = [{
296
- token : "meta.tag.r",
297
- regex : "/?>",
298
- next : nextState
299
- }, {
300
- token : "keyword.operator",
301
- regex : "="
302
- }, {
303
- token : "entity.other.attribute-name",
304
- regex : "[-_a-zA-Z0-9:]+"
305
- }, {
306
- token : "constant.numeric", // float
307
- regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
308
- }, {
309
- token : "text",
310
- regex : "\\s+"
311
- }].concat(string(name));
312
- };
313
-
314
- });
315
-
316
- 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) {
317
-
211
+ define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module) {
212
+ "use strict";
318
213
 
319
214
  var oop = require("../../lib/oop");
320
215
  var Behaviour = require("../behaviour").Behaviour;
321
- var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
322
216
  var TokenIterator = require("../../token_iterator").TokenIterator;
323
217
 
324
- function hasType(token, type) {
325
- var tokenTypes = token.type.split('.');
326
- return type.split('.').every(function(type){
327
- return (tokenTypes.indexOf(type) !== -1);
328
- });
329
- return hasType;
218
+ function is(token, type) {
219
+ return token.type.lastIndexOf(type + ".xml") > -1;
330
220
  }
331
221
 
332
222
  var XmlBehaviour = function () {
333
-
334
- this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
335
-
336
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
337
- if (text == '>') {
338
- var position = editor.getCursorPosition();
339
- var iterator = new TokenIterator(session, position.row, position.column);
340
- var token = iterator.getCurrentToken();
341
223
 
342
- if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column)
343
- return;
344
- var atCursor = false;
345
- if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
346
- do {
347
- token = iterator.stepBackward();
348
- } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
349
- } else {
350
- atCursor = true;
351
- }
352
- if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) {
353
- return;
354
- }
355
- var tag = token.value;
356
- if (atCursor){
357
- var tag = tag.substring(0, position.column - token.start);
358
- }
359
-
360
- return {
361
- text: '>' + '</' + tag + '>',
362
- selection: [1, 1]
224
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
225
+ if (text == '"' || text == "'") {
226
+ var quote = text;
227
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
228
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
229
+ return {
230
+ text: quote + selected + quote,
231
+ selection: false
232
+ };
363
233
  }
364
- }
365
- });
366
234
 
367
- this.add('autoindent', 'insertion', function (state, action, editor, session, text) {
368
- if (text == "\n") {
369
235
  var cursor = editor.getCursorPosition();
370
- var line = session.getLine(cursor.row);
371
- var rightChars = line.substring(cursor.column, cursor.column + 2);
372
- if (rightChars == '</') {
373
- var next_indent = this.$getIndent(line);
374
- var indent = next_indent + session.getTabString();
236
+ var line = session.doc.getLine(cursor.row);
237
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
238
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
239
+ var token = iterator.getCurrentToken();
375
240
 
241
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
376
242
  return {
377
- text: '\n' + indent + '\n' + next_indent,
378
- selection: [1, indent.length, 1, indent.length]
379
- }
243
+ text: "",
244
+ selection: [1, 1]
245
+ };
380
246
  }
381
- }
382
- });
383
-
384
- }
385
- oop.inherits(XmlBehaviour, Behaviour);
386
-
387
- exports.XmlBehaviour = XmlBehaviour;
388
- });
389
247
 
390
- define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
391
-
392
-
393
- var oop = require("../../lib/oop");
394
- var Behaviour = require("../behaviour").Behaviour;
395
- var TokenIterator = require("../../token_iterator").TokenIterator;
396
- var lang = require("../../lib/lang");
397
-
398
- var SAFE_INSERT_IN_TOKENS =
399
- ["text", "paren.rparen", "punctuation.operator"];
400
- var SAFE_INSERT_BEFORE_TOKENS =
401
- ["text", "paren.rparen", "punctuation.operator", "comment"];
402
-
403
-
404
- var autoInsertedBrackets = 0;
405
- var autoInsertedRow = -1;
406
- var autoInsertedLineEnd = "";
407
- var maybeInsertedBrackets = 0;
408
- var maybeInsertedRow = -1;
409
- var maybeInsertedLineStart = "";
410
- var maybeInsertedLineEnd = "";
411
-
412
- var CstyleBehaviour = function () {
413
-
414
- CstyleBehaviour.isSaneInsertion = function(editor, session) {
415
- var cursor = editor.getCursorPosition();
416
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
417
- if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
418
- var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
419
- if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
420
- return false;
421
- }
422
- iterator.stepForward();
423
- return iterator.getCurrentTokenRow() !== cursor.row ||
424
- this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
425
- };
426
-
427
- CstyleBehaviour.$matchTokenType = function(token, types) {
428
- return types.indexOf(token.type || token) > -1;
429
- };
430
-
431
- CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
432
- var cursor = editor.getCursorPosition();
433
- var line = session.doc.getLine(cursor.row);
434
- if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
435
- autoInsertedBrackets = 0;
436
- autoInsertedRow = cursor.row;
437
- autoInsertedLineEnd = bracket + line.substr(cursor.column);
438
- autoInsertedBrackets++;
439
- };
440
-
441
- CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
442
- var cursor = editor.getCursorPosition();
443
- var line = session.doc.getLine(cursor.row);
444
- if (!this.isMaybeInsertedClosing(cursor, line))
445
- maybeInsertedBrackets = 0;
446
- maybeInsertedRow = cursor.row;
447
- maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
448
- maybeInsertedLineEnd = line.substr(cursor.column);
449
- maybeInsertedBrackets++;
450
- };
451
-
452
- CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
453
- return autoInsertedBrackets > 0 &&
454
- cursor.row === autoInsertedRow &&
455
- bracket === autoInsertedLineEnd[0] &&
456
- line.substr(cursor.column) === autoInsertedLineEnd;
457
- };
458
-
459
- CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
460
- return maybeInsertedBrackets > 0 &&
461
- cursor.row === maybeInsertedRow &&
462
- line.substr(cursor.column) === maybeInsertedLineEnd &&
463
- line.substr(0, cursor.column) == maybeInsertedLineStart;
464
- };
465
-
466
- CstyleBehaviour.popAutoInsertedClosing = function() {
467
- autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
468
- autoInsertedBrackets--;
469
- };
470
-
471
- CstyleBehaviour.clearMaybeInsertedClosing = function() {
472
- maybeInsertedBrackets = 0;
473
- maybeInsertedRow = -1;
474
- };
248
+ if (!token)
249
+ token = iterator.stepBackward();
475
250
 
476
- this.add("braces", "insertion", function (state, action, editor, session, text) {
477
- var cursor = editor.getCursorPosition();
478
- var line = session.doc.getLine(cursor.row);
479
- if (text == '{') {
480
- var selection = editor.getSelectionRange();
481
- var selected = session.doc.getTextRange(selection);
482
- if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
483
- return {
484
- text: '{' + selected + '}',
485
- selection: false
486
- };
487
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
488
- if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) {
489
- CstyleBehaviour.recordAutoInsert(editor, session, "}");
490
- return {
491
- text: '{}',
492
- selection: [1, 1]
493
- };
494
- } else {
495
- CstyleBehaviour.recordMaybeInsert(editor, session, "{");
496
- return {
497
- text: '{',
498
- selection: [1, 1]
499
- };
500
- }
501
- }
502
- } else if (text == '}') {
503
- var rightChar = line.substring(cursor.column, cursor.column + 1);
504
- if (rightChar == '}') {
505
- var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
506
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
507
- CstyleBehaviour.popAutoInsertedClosing();
508
- return {
509
- text: '',
510
- selection: [1, 1]
511
- };
512
- }
513
- }
514
- } else if (text == "\n" || text == "\r\n") {
515
- var closing = "";
516
- if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
517
- closing = lang.stringRepeat("}", maybeInsertedBrackets);
518
- CstyleBehaviour.clearMaybeInsertedClosing();
519
- }
520
- var rightChar = line.substring(cursor.column, cursor.column + 1);
521
- if (rightChar === '}') {
522
- var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}');
523
- if (!openBracePos)
524
- return null;
525
- var next_indent = this.$getIndent(session.getLine(openBracePos.row));
526
- } else if (closing) {
527
- var next_indent = this.$getIndent(line);
528
- } else {
251
+ if (!token)
529
252
  return;
530
- }
531
- var indent = next_indent + session.getTabString();
532
253
 
533
- return {
534
- text: '\n' + indent + '\n' + next_indent + closing,
535
- selection: [1, indent.length, 1, indent.length]
536
- };
537
- } else {
538
- CstyleBehaviour.clearMaybeInsertedClosing();
539
- }
540
- });
541
-
542
- this.add("braces", "deletion", function (state, action, editor, session, range) {
543
- var selected = session.doc.getTextRange(range);
544
- if (!range.isMultiLine() && selected == '{') {
545
- var line = session.doc.getLine(range.start.row);
546
- var rightChar = line.substring(range.end.column, range.end.column + 1);
547
- if (rightChar == '}') {
548
- range.end.column++;
549
- return range;
550
- } else {
551
- maybeInsertedBrackets--;
254
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
255
+ token = iterator.stepBackward();
552
256
  }
553
- }
554
- });
555
-
556
- this.add("parens", "insertion", function (state, action, editor, session, text) {
557
- if (text == '(') {
558
- var selection = editor.getSelectionRange();
559
- var selected = session.doc.getTextRange(selection);
560
- if (selected !== "" && editor.getWrapBehavioursEnabled()) {
257
+ var rightSpace = !rightChar || rightChar.match(/\s/);
258
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
561
259
  return {
562
- text: '(' + selected + ')',
563
- selection: false
564
- };
565
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
566
- CstyleBehaviour.recordAutoInsert(editor, session, ")");
567
- return {
568
- text: '()',
260
+ text: quote + quote,
569
261
  selection: [1, 1]
570
262
  };
571
263
  }
572
- } else if (text == ')') {
573
- var cursor = editor.getCursorPosition();
574
- var line = session.doc.getLine(cursor.row);
575
- var rightChar = line.substring(cursor.column, cursor.column + 1);
576
- if (rightChar == ')') {
577
- var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
578
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
579
- CstyleBehaviour.popAutoInsertedClosing();
580
- return {
581
- text: '',
582
- selection: [1, 1]
583
- };
584
- }
585
- }
586
264
  }
587
265
  });
588
266
 
589
- this.add("parens", "deletion", function (state, action, editor, session, range) {
267
+ this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
590
268
  var selected = session.doc.getTextRange(range);
591
- if (!range.isMultiLine() && selected == '(') {
269
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
592
270
  var line = session.doc.getLine(range.start.row);
593
271
  var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
594
- if (rightChar == ')') {
272
+ if (rightChar == selected) {
595
273
  range.end.column++;
596
274
  return range;
597
275
  }
598
276
  }
599
277
  });
600
278
 
601
- this.add("brackets", "insertion", function (state, action, editor, session, text) {
602
- if (text == '[') {
603
- var selection = editor.getSelectionRange();
604
- var selected = session.doc.getTextRange(selection);
605
- if (selected !== "" && editor.getWrapBehavioursEnabled()) {
606
- return {
607
- text: '[' + selected + ']',
608
- selection: false
609
- };
610
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
611
- CstyleBehaviour.recordAutoInsert(editor, session, "]");
612
- return {
613
- text: '[]',
614
- selection: [1, 1]
615
- };
616
- }
617
- } else if (text == ']') {
618
- var cursor = editor.getCursorPosition();
619
- var line = session.doc.getLine(cursor.row);
620
- var rightChar = line.substring(cursor.column, cursor.column + 1);
621
- if (rightChar == ']') {
622
- var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
623
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
624
- CstyleBehaviour.popAutoInsertedClosing();
625
- return {
626
- text: '',
627
- selection: [1, 1]
628
- };
279
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
280
+ if (text == '>') {
281
+ var position = editor.getCursorPosition();
282
+ var iterator = new TokenIterator(session, position.row, position.column);
283
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
284
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
285
+ return;
286
+ if (is(token, "reference.attribute-value"))
287
+ return;
288
+ if (is(token, "attribute-value")) {
289
+ var firstChar = token.value.charAt(0);
290
+ if (firstChar == '"' || firstChar == "'") {
291
+ var lastChar = token.value.charAt(token.value.length - 1);
292
+ var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length;
293
+ if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar)
294
+ return;
629
295
  }
630
296
  }
631
- }
632
- });
633
-
634
- this.add("brackets", "deletion", function (state, action, editor, session, range) {
635
- var selected = session.doc.getTextRange(range);
636
- if (!range.isMultiLine() && selected == '[') {
637
- var line = session.doc.getLine(range.start.row);
638
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
639
- if (rightChar == ']') {
640
- range.end.column++;
641
- return range;
297
+ while (!is(token, "tag-name")) {
298
+ token = iterator.stepBackward();
642
299
  }
300
+
301
+ var tokenRow = iterator.getCurrentTokenRow();
302
+ var tokenColumn = iterator.getCurrentTokenColumn();
303
+ if (is(iterator.stepBackward(), "end-tag-open"))
304
+ return;
305
+
306
+ var element = token.value;
307
+ if (tokenRow == position.row)
308
+ element = element.substring(0, position.column - tokenColumn);
309
+
310
+ if (this.voidElements.hasOwnProperty(element.toLowerCase()))
311
+ return;
312
+
313
+ return {
314
+ text: '>' + '</' + element + '>',
315
+ selection: [1, 1]
316
+ };
643
317
  }
644
318
  });
645
319
 
646
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
647
- if (text == '"' || text == "'") {
648
- var quote = text;
649
- var selection = editor.getSelectionRange();
650
- var selected = session.doc.getTextRange(selection);
651
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
320
+ this.add('autoindent', 'insertion', function (state, action, editor, session, text) {
321
+ if (text == "\n") {
322
+ var cursor = editor.getCursorPosition();
323
+ var line = session.getLine(cursor.row);
324
+ var rightChars = line.substring(cursor.column, cursor.column + 2);
325
+ if (rightChars == '</') {
326
+ var next_indent = this.$getIndent(line);
327
+ var indent = next_indent + session.getTabString();
328
+
652
329
  return {
653
- text: quote + selected + quote,
654
- selection: false
330
+ text: '\n' + indent + '\n' + next_indent,
331
+ selection: [1, indent.length, 1, indent.length]
655
332
  };
656
- } else {
657
- var cursor = editor.getCursorPosition();
658
- var line = session.doc.getLine(cursor.row);
659
- var leftChar = line.substring(cursor.column-1, cursor.column);
660
- if (leftChar == '\\') {
661
- return null;
662
- }
663
- var tokens = session.getTokens(selection.start.row);
664
- var col = 0, token;
665
- var quotepos = -1; // Track whether we're inside an open quote.
666
-
667
- for (var x = 0; x < tokens.length; x++) {
668
- token = tokens[x];
669
- if (token.type == "string") {
670
- quotepos = -1;
671
- } else if (quotepos < 0) {
672
- quotepos = token.value.indexOf(quote);
673
- }
674
- if ((token.value.length + col) > selection.start.column) {
675
- break;
676
- }
677
- col += tokens[x].value.length;
678
- }
679
- if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
680
- if (!CstyleBehaviour.isSaneInsertion(editor, session))
681
- return;
682
- return {
683
- text: quote + quote,
684
- selection: [1,1]
685
- };
686
- } else if (token && token.type === "string") {
687
- var rightChar = line.substring(cursor.column, cursor.column + 1);
688
- if (rightChar == quote) {
689
- return {
690
- text: '',
691
- selection: [1, 1]
692
- };
693
- }
694
- }
695
333
  }
696
334
  }
697
335
  });
698
-
699
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
700
- var selected = session.doc.getTextRange(range);
701
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
702
- var line = session.doc.getLine(range.start.row);
703
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
704
- if (rightChar == selected) {
705
- range.end.column++;
706
- return range;
707
- }
708
- }
709
- });
710
-
336
+
711
337
  };
712
338
 
713
- oop.inherits(CstyleBehaviour, Behaviour);
339
+ oop.inherits(XmlBehaviour, Behaviour);
714
340
 
715
- exports.CstyleBehaviour = CstyleBehaviour;
341
+ exports.XmlBehaviour = XmlBehaviour;
716
342
  });
717
343
 
718
- 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) {
719
-
344
+ 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) {
345
+ "use strict";
720
346
 
721
347
  var oop = require("../../lib/oop");
722
348
  var lang = require("../../lib/lang");
@@ -724,91 +350,118 @@ var Range = require("../../range").Range;
724
350
  var BaseFoldMode = require("./fold_mode").FoldMode;
725
351
  var TokenIterator = require("../../token_iterator").TokenIterator;
726
352
 
727
- var FoldMode = exports.FoldMode = function(voidElements) {
353
+ var FoldMode = exports.FoldMode = function(voidElements, optionalEndTags) {
728
354
  BaseFoldMode.call(this);
729
355
  this.voidElements = voidElements || {};
356
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
357
+ if (optionalEndTags)
358
+ oop.mixin(this.optionalEndTags, optionalEndTags);
359
+
730
360
  };
731
361
  oop.inherits(FoldMode, BaseFoldMode);
732
362
 
363
+ var Tag = function() {
364
+ this.tagName = "";
365
+ this.closing = false;
366
+ this.selfClosing = false;
367
+ this.start = {row: 0, column: 0};
368
+ this.end = {row: 0, column: 0};
369
+ };
370
+
371
+ function is(token, type) {
372
+ return token.type.lastIndexOf(type + ".xml") > -1;
373
+ }
374
+
733
375
  (function() {
734
376
 
735
377
  this.getFoldWidget = function(session, foldStyle, row) {
736
378
  var tag = this._getFirstTagInLine(session, row);
737
379
 
738
- if (tag.closing)
739
- return foldStyle == "markbeginend" ? "end" : "";
740
-
741
- if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()])
380
+ if (!tag)
742
381
  return "";
743
382
 
744
- if (tag.selfClosing)
383
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
384
+ return foldStyle == "markbeginend" ? "end" : "";
385
+
386
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
745
387
  return "";
746
388
 
747
- if (tag.value.indexOf("/" + tag.tagName) !== -1)
389
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
748
390
  return "";
749
391
 
750
392
  return "start";
751
393
  };
752
-
753
394
  this._getFirstTagInLine = function(session, row) {
754
395
  var tokens = session.getTokens(row);
755
- var value = "";
396
+ var tag = new Tag();
397
+
756
398
  for (var i = 0; i < tokens.length; i++) {
757
399
  var token = tokens[i];
758
- if (token.type.lastIndexOf("meta.tag", 0) === 0)
759
- value += token.value;
760
- else
761
- value += lang.stringRepeat(" ", token.value.length);
400
+ if (is(token, "tag-open")) {
401
+ tag.end.column = tag.start.column + token.value.length;
402
+ tag.closing = is(token, "end-tag-open");
403
+ token = tokens[++i];
404
+ if (!token)
405
+ return null;
406
+ tag.tagName = token.value;
407
+ tag.end.column += token.value.length;
408
+ for (i++; i < tokens.length; i++) {
409
+ token = tokens[i];
410
+ tag.end.column += token.value.length;
411
+ if (is(token, "tag-close")) {
412
+ tag.selfClosing = token.value == '/>';
413
+ break;
414
+ }
415
+ }
416
+ return tag;
417
+ } else if (is(token, "tag-close")) {
418
+ tag.selfClosing = token.value == '/>';
419
+ return tag;
420
+ }
421
+ tag.start.column += token.value.length;
762
422
  }
763
-
764
- return this._parseTag(value);
423
+
424
+ return null;
765
425
  };
766
426
 
767
- this.tagRe = /^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;
768
- this._parseTag = function(tag) {
769
-
770
- var match = tag.match(this.tagRe);
427
+ this._findEndTagInLine = function(session, row, tagName, startColumn) {
428
+ var tokens = session.getTokens(row);
771
429
  var column = 0;
772
-
773
- return {
774
- value: tag,
775
- match: match ? match[2] : "",
776
- closing: match ? !!match[3] : false,
777
- selfClosing: match ? !!match[5] || match[2] == "/>" : false,
778
- tagName: match ? match[4] : "",
779
- column: match[1] ? column + match[1].length : column
780
- };
430
+ for (var i = 0; i < tokens.length; i++) {
431
+ var token = tokens[i];
432
+ column += token.value.length;
433
+ if (column < startColumn)
434
+ continue;
435
+ if (is(token, "end-tag-open")) {
436
+ token = tokens[i + 1];
437
+ if (token && token.value == tagName)
438
+ return true;
439
+ }
440
+ }
441
+ return false;
781
442
  };
782
443
  this._readTagForward = function(iterator) {
783
444
  var token = iterator.getCurrentToken();
784
445
  if (!token)
785
446
  return null;
786
-
787
- var value = "";
788
- var start;
789
-
447
+
448
+ var tag = new Tag();
790
449
  do {
791
- if (token.type.lastIndexOf("meta.tag", 0) === 0) {
792
- if (!start) {
793
- var start = {
794
- row: iterator.getCurrentTokenRow(),
795
- column: iterator.getCurrentTokenColumn()
796
- };
797
- }
798
- value += token.value;
799
- if (value.indexOf(">") !== -1) {
800
- var tag = this._parseTag(value);
801
- tag.start = start;
802
- tag.end = {
803
- row: iterator.getCurrentTokenRow(),
804
- column: iterator.getCurrentTokenColumn() + token.value.length
805
- };
806
- iterator.stepForward();
807
- return tag;
808
- }
450
+ if (is(token, "tag-open")) {
451
+ tag.closing = is(token, "end-tag-open");
452
+ tag.start.row = iterator.getCurrentTokenRow();
453
+ tag.start.column = iterator.getCurrentTokenColumn();
454
+ } else if (is(token, "tag-name")) {
455
+ tag.tagName = token.value;
456
+ } else if (is(token, "tag-close")) {
457
+ tag.selfClosing = token.value == "/>";
458
+ tag.end.row = iterator.getCurrentTokenRow();
459
+ tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
460
+ iterator.stepForward();
461
+ return tag;
809
462
  }
810
463
  } while(token = iterator.stepForward());
811
-
464
+
812
465
  return null;
813
466
  };
814
467
 
@@ -816,32 +469,24 @@ oop.inherits(FoldMode, BaseFoldMode);
816
469
  var token = iterator.getCurrentToken();
817
470
  if (!token)
818
471
  return null;
819
-
820
- var value = "";
821
- var end;
822
472
 
473
+ var tag = new Tag();
823
474
  do {
824
- if (token.type.lastIndexOf("meta.tag", 0) === 0) {
825
- if (!end) {
826
- end = {
827
- row: iterator.getCurrentTokenRow(),
828
- column: iterator.getCurrentTokenColumn() + token.value.length
829
- };
830
- }
831
- value = token.value + value;
832
- if (value.indexOf("<") !== -1) {
833
- var tag = this._parseTag(value);
834
- tag.end = end;
835
- tag.start = {
836
- row: iterator.getCurrentTokenRow(),
837
- column: iterator.getCurrentTokenColumn()
838
- };
839
- iterator.stepBackward();
840
- return tag;
841
- }
475
+ if (is(token, "tag-open")) {
476
+ tag.closing = is(token, "end-tag-open");
477
+ tag.start.row = iterator.getCurrentTokenRow();
478
+ tag.start.column = iterator.getCurrentTokenColumn();
479
+ iterator.stepBackward();
480
+ return tag;
481
+ } else if (is(token, "tag-name")) {
482
+ tag.tagName = token.value;
483
+ } else if (is(token, "tag-close")) {
484
+ tag.selfClosing = token.value == "/>";
485
+ tag.end.row = iterator.getCurrentTokenRow();
486
+ tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
842
487
  }
843
488
  } while(token = iterator.stepBackward());
844
-
489
+
845
490
  return null;
846
491
  };
847
492
 
@@ -852,10 +497,10 @@ oop.inherits(FoldMode, BaseFoldMode);
852
497
  if (!tag || top.tagName == tag.tagName) {
853
498
  return stack.pop();
854
499
  }
855
- else if (this.voidElements[tag.tagName]) {
500
+ else if (this.optionalEndTags.hasOwnProperty(tag.tagName)) {
856
501
  return;
857
502
  }
858
- else if (this.voidElements[top.tagName]) {
503
+ else if (this.optionalEndTags.hasOwnProperty(top.tagName)) {
859
504
  stack.pop();
860
505
  continue;
861
506
  } else {
@@ -867,7 +512,7 @@ oop.inherits(FoldMode, BaseFoldMode);
867
512
  this.getFoldWidgetRange = function(session, foldStyle, row) {
868
513
  var firstTag = this._getFirstTagInLine(session, row);
869
514
 
870
- if (!firstTag.match)
515
+ if (!firstTag)
871
516
  return null;
872
517
 
873
518
  var isBackward = firstTag.closing || firstTag.selfClosing;
@@ -875,10 +520,10 @@ oop.inherits(FoldMode, BaseFoldMode);
875
520
  var tag;
876
521
 
877
522
  if (!isBackward) {
878
- var iterator = new TokenIterator(session, row, firstTag.column);
523
+ var iterator = new TokenIterator(session, row, firstTag.start.column);
879
524
  var start = {
880
525
  row: row,
881
- column: firstTag.column + firstTag.tagName.length + 2
526
+ column: firstTag.start.column + firstTag.tagName.length + 2
882
527
  };
883
528
  while (tag = this._readTagForward(iterator)) {
884
529
  if (tag.selfClosing) {
@@ -896,15 +541,15 @@ oop.inherits(FoldMode, BaseFoldMode);
896
541
  return Range.fromPoints(start, tag.start);
897
542
  }
898
543
  else {
899
- stack.push(tag)
544
+ stack.push(tag);
900
545
  }
901
546
  }
902
547
  }
903
548
  else {
904
- var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
549
+ var iterator = new TokenIterator(session, row, firstTag.end.column);
905
550
  var end = {
906
551
  row: row,
907
- column: firstTag.column
552
+ column: firstTag.start.column
908
553
  };
909
554
 
910
555
  while (tag = this._readTagBackward(iterator)) {
@@ -925,7 +570,7 @@ oop.inherits(FoldMode, BaseFoldMode);
925
570
  }
926
571
  }
927
572
  else {
928
- stack.push(tag)
573
+ stack.push(tag);
929
574
  }
930
575
  }
931
576
  }
@@ -935,3 +580,33 @@ oop.inherits(FoldMode, BaseFoldMode);
935
580
  }).call(FoldMode.prototype);
936
581
 
937
582
  });
583
+
584
+ define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml"], function(require, exports, module) {
585
+ "use strict";
586
+
587
+ var oop = require("../lib/oop");
588
+ var lang = require("../lib/lang");
589
+ var TextMode = require("./text").Mode;
590
+ var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
591
+ var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
592
+ var XmlFoldMode = require("./folding/xml").FoldMode;
593
+
594
+ var Mode = function() {
595
+ this.HighlightRules = XmlHighlightRules;
596
+ this.$behaviour = new XmlBehaviour();
597
+ this.foldingRules = new XmlFoldMode();
598
+ };
599
+
600
+ oop.inherits(Mode, TextMode);
601
+
602
+ (function() {
603
+
604
+ this.voidElements = lang.arrayToMap([]);
605
+
606
+ this.blockComment = {start: "<!--", end: "-->"};
607
+
608
+ this.$id = "ace/mode/xml";
609
+ }).call(Mode.prototype);
610
+
611
+ exports.Mode = Mode;
612
+ });