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,67 +1,69 @@
1
- /*
2
- * rdoc.js
3
- *
4
- * Copyright (C) 2009-11 by RStudio, Inc.
5
- *
6
- * The Initial Developer of the Original Code is
7
- * Ajax.org B.V.
8
- * Portions created by the Initial Developer are Copyright (C) 2010
9
- * the Initial Developer. All Rights Reserved.
10
- *
11
- * Distributed under the BSD license:
12
- *
13
- * Copyright (c) 2010, Ajax.org B.V.
14
- * All rights reserved.
15
- *
16
- * Redistribution and use in source and binary forms, with or without
17
- * modification, are permitted provided that the following conditions are met:
18
- * * Redistributions of source code must retain the above copyright
19
- * notice, this list of conditions and the following disclaimer.
20
- * * Redistributions in binary form must reproduce the above copyright
21
- * notice, this list of conditions and the following disclaimer in the
22
- * documentation and/or other materials provided with the distribution.
23
- * * Neither the name of Ajax.org B.V. nor the
24
- * names of its contributors may be used to endorse or promote products
25
- * derived from this software without specific prior written permission.
26
- *
27
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
28
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
29
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
31
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
32
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
33
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
34
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
36
- *
37
- */
38
- define('ace/mode/rdoc', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/text_highlight_rules', 'ace/mode/rdoc_highlight_rules', 'ace/mode/matching_brace_outdent'], function(require, exports, module) {
39
-
1
+ define("ace/mode/latex_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2
+ "use strict";
40
3
 
41
4
  var oop = require("../lib/oop");
42
- var TextMode = require("./text").Mode;
43
- var Tokenizer = require("../tokenizer").Tokenizer;
44
5
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
45
- var RDocHighlightRules = require("./rdoc_highlight_rules").RDocHighlightRules;
46
- var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
47
6
 
48
- var Mode = function(suppressHighlighting) {
49
- this.HighlightRules = RDocHighlightRules;
50
- this.$outdent = new MatchingBraceOutdent();
51
- };
52
- oop.inherits(Mode, TextMode);
7
+ var LatexHighlightRules = function() {
8
+
9
+ this.$rules = {
10
+ "start" : [{
11
+ token : "comment",
12
+ regex : "%.*$"
13
+ }, {
14
+ token : ["keyword", "lparen", "variable.parameter", "rparen", "lparen", "storage.type", "rparen"],
15
+ regex : "(\\\\(?:documentclass|usepackage|input))(?:(\\[)([^\\]]*)(\\]))?({)([^}]*)(})"
16
+ }, {
17
+ token : ["keyword","lparen", "variable.parameter", "rparen"],
18
+ regex : "(\\\\label)(?:({)([^}]*)(}))?"
19
+ }, {
20
+ token : ["storage.type", "lparen", "variable.parameter", "rparen"],
21
+ regex : "(\\\\(?:begin|end))({)(\\w*)(})"
22
+ }, {
23
+ token : "storage.type",
24
+ regex : "\\\\[a-zA-Z]+"
25
+ }, {
26
+ token : "lparen",
27
+ regex : "[[({]"
28
+ }, {
29
+ token : "rparen",
30
+ regex : "[\\])}]"
31
+ }, {
32
+ token : "constant.character.escape",
33
+ regex : "\\\\[^a-zA-Z]?"
34
+ }, {
35
+ token : "string",
36
+ regex : "\\${1,2}",
37
+ next : "equation"
38
+ }],
39
+ "equation" : [{
40
+ token : "comment",
41
+ regex : "%.*$"
42
+ }, {
43
+ token : "string",
44
+ regex : "\\${1,2}",
45
+ next : "start"
46
+ }, {
47
+ token : "constant.character.escape",
48
+ regex : "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)"
49
+ }, {
50
+ token : "error",
51
+ regex : "^\\s*$",
52
+ next : "start"
53
+ }, {
54
+ defaultToken : "string"
55
+ }]
53
56
 
54
- (function() {
55
- this.getNextLineIndent = function(state, line, tab) {
56
- return this.$getIndent(line);
57
57
  };
58
- this.$id = "ace/mode/rdoc";
59
- }).call(Mode.prototype);
58
+ };
59
+ oop.inherits(LatexHighlightRules, TextHighlightRules);
60
+
61
+ exports.LatexHighlightRules = LatexHighlightRules;
60
62
 
61
- exports.Mode = Mode;
62
63
  });
63
- define('ace/mode/rdoc_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules', 'ace/mode/latex_highlight_rules'], function(require, exports, module) {
64
64
 
65
+ define("ace/mode/rdoc_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/latex_highlight_rules"], function(require, exports, module) {
66
+ "use strict";
65
67
 
66
68
  var oop = require("../lib/oop");
67
69
  var lang = require("../lib/lang");
@@ -135,42 +137,10 @@ var RDocHighlightRules = function() {
135
137
  oop.inherits(RDocHighlightRules, TextHighlightRules);
136
138
 
137
139
  exports.RDocHighlightRules = RDocHighlightRules;
138
- });
139
- define('ace/mode/latex_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
140
-
141
-
142
- var oop = require("../lib/oop");
143
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
144
-
145
- var LatexHighlightRules = function() {
146
- this.$rules = {
147
- "start" : [{
148
- token : "keyword",
149
- regex : "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)"
150
- }, {
151
- token : "lparen",
152
- regex : "[[({]"
153
- }, {
154
- token : "rparen",
155
- regex : "[\\])}]"
156
- }, {
157
- token : "string",
158
- regex : "\\$(?:(?:\\\\.)|(?:[^\\$\\\\]))*?\\$"
159
- }, {
160
- token : "comment",
161
- regex : "%.*$"
162
- }]
163
- };
164
- };
165
-
166
- oop.inherits(LatexHighlightRules, TextHighlightRules);
167
-
168
- exports.LatexHighlightRules = LatexHighlightRules;
169
-
170
140
  });
171
141
 
172
- define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
173
-
142
+ define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
143
+ "use strict";
174
144
 
175
145
  var Range = require("../range").Range;
176
146
 
@@ -208,3 +178,28 @@ var MatchingBraceOutdent = function() {};
208
178
 
209
179
  exports.MatchingBraceOutdent = MatchingBraceOutdent;
210
180
  });
181
+
182
+ define("ace/mode/rdoc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/rdoc_highlight_rules","ace/mode/matching_brace_outdent"], function(require, exports, module) {
183
+ "use strict";
184
+
185
+ var oop = require("../lib/oop");
186
+ var TextMode = require("./text").Mode;
187
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
188
+ var RDocHighlightRules = require("./rdoc_highlight_rules").RDocHighlightRules;
189
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
190
+
191
+ var Mode = function(suppressHighlighting) {
192
+ this.HighlightRules = RDocHighlightRules;
193
+ this.$outdent = new MatchingBraceOutdent();
194
+ };
195
+ oop.inherits(Mode, TextMode);
196
+
197
+ (function() {
198
+ this.getNextLineIndent = function(state, line, tab) {
199
+ return this.$getIndent(line);
200
+ };
201
+ this.$id = "ace/mode/rdoc";
202
+ }).call(Mode.prototype);
203
+
204
+ exports.Mode = Mode;
205
+ });
@@ -1,217 +1,55 @@
1
- /*
2
- * rhtml.js
3
- *
4
- * Copyright (C) 2009-11 by RStudio, Inc.
5
- *
6
- * The Initial Developer of the Original Code is
7
- * Ajax.org B.V.
8
- * Portions created by the Initial Developer are Copyright (C) 2010
9
- * the Initial Developer. All Rights Reserved.
10
- *
11
- * Distributed under the BSD license:
12
- *
13
- * Copyright (c) 2010, Ajax.org B.V.
14
- * All rights reserved.
15
- *
16
- * Redistribution and use in source and binary forms, with or without
17
- * modification, are permitted provided that the following conditions are met:
18
- * * Redistributions of source code must retain the above copyright
19
- * notice, this list of conditions and the following disclaimer.
20
- * * Redistributions in binary form must reproduce the above copyright
21
- * notice, this list of conditions and the following disclaimer in the
22
- * documentation and/or other materials provided with the distribution.
23
- * * Neither the name of Ajax.org B.V. nor the
24
- * names of its contributors may be used to endorse or promote products
25
- * derived from this software without specific prior written permission.
26
- *
27
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
28
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
29
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
31
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
32
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
33
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
34
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
36
- */
37
-
38
- define('ace/mode/rhtml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html', 'ace/tokenizer', 'ace/mode/rhtml_highlight_rules'], function(require, exports, module) {
39
-
40
-
41
- var oop = require("../lib/oop");
42
- var HtmlMode = require("./html").Mode;
43
- var Tokenizer = require("../tokenizer").Tokenizer;
44
-
45
- var RHtmlHighlightRules = require("./rhtml_highlight_rules").RHtmlHighlightRules;
46
-
47
- var Mode = function(doc, session) {
48
- this.$session = session;
49
- this.HighlightRules = RHtmlHighlightRules;
50
- };
51
- oop.inherits(Mode, HtmlMode);
52
-
53
- (function() {
54
- this.insertChunkInfo = {
55
- value: "<!--begin.rcode\n\nend.rcode-->\n",
56
- position: {row: 0, column: 15}
57
- };
58
-
59
- this.getLanguageMode = function(position)
60
- {
61
- return this.$session.getState(position.row).match(/^r-/) ? 'R' : 'HTML';
62
- };
63
-
64
- this.$id = "ace/mode/rhtml";
65
- }).call(Mode.prototype);
66
-
67
- exports.Mode = Mode;
68
- });
69
-
70
- define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html', 'ace/mode/html_completions'], function(require, exports, module) {
71
-
1
+ define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2
+ "use strict";
72
3
 
73
4
  var oop = require("../lib/oop");
74
- var TextMode = require("./text").Mode;
75
- var JavaScriptMode = require("./javascript").Mode;
76
- var CssMode = require("./css").Mode;
77
- var Tokenizer = require("../tokenizer").Tokenizer;
78
- var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
79
- var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
80
- var HtmlFoldMode = require("./folding/html").FoldMode;
81
- var HtmlCompletions = require("./html_completions").HtmlCompletions;
82
-
83
- var Mode = function() {
84
- this.HighlightRules = HtmlHighlightRules;
85
- this.$behaviour = new HtmlBehaviour();
86
- this.$completer = new HtmlCompletions();
87
-
88
- this.createModeDelegates({
89
- "js-": JavaScriptMode,
90
- "css-": CssMode
91
- });
92
-
93
- this.foldingRules = new HtmlFoldMode();
94
- };
95
- oop.inherits(Mode, TextMode);
96
-
97
- (function() {
98
-
99
- this.blockComment = {start: "<!--", end: "-->"};
100
-
101
- this.getNextLineIndent = function(state, line, tab) {
102
- return this.$getIndent(line);
103
- };
5
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
104
6
 
105
- this.checkOutdent = function(state, line, input) {
106
- return false;
107
- };
7
+ var DocCommentHighlightRules = function() {
108
8
 
109
- this.getCompletions = function(state, session, pos, prefix) {
110
- return this.$completer.getCompletions(state, session, pos, prefix);
9
+ this.$rules = {
10
+ "start" : [ {
11
+ token : "comment.doc.tag",
12
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
13
+ }, {
14
+ token : "comment.doc.tag",
15
+ regex : "\\bTODO\\b"
16
+ }, {
17
+ defaultToken : "comment.doc"
18
+ }]
111
19
  };
112
-
113
- this.$id = "ace/mode/html";
114
- }).call(Mode.prototype);
115
-
116
- exports.Mode = Mode;
117
- });
118
-
119
- define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
120
-
121
-
122
- var oop = require("../lib/oop");
123
- var TextMode = require("./text").Mode;
124
- var Tokenizer = require("../tokenizer").Tokenizer;
125
- var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
126
- var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
127
- var Range = require("../range").Range;
128
- var WorkerClient = require("../worker/worker_client").WorkerClient;
129
- var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
130
- var CStyleFoldMode = require("./folding/cstyle").FoldMode;
131
-
132
- var Mode = function() {
133
- this.HighlightRules = JavaScriptHighlightRules;
134
-
135
- this.$outdent = new MatchingBraceOutdent();
136
- this.$behaviour = new CstyleBehaviour();
137
- this.foldingRules = new CStyleFoldMode();
138
20
  };
139
- oop.inherits(Mode, TextMode);
140
-
141
- (function() {
142
-
143
- this.lineCommentStart = "//";
144
- this.blockComment = {start: "/*", end: "*/"};
145
-
146
- this.getNextLineIndent = function(state, line, tab) {
147
- var indent = this.$getIndent(line);
148
-
149
- var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
150
- var tokens = tokenizedLine.tokens;
151
- var endState = tokenizedLine.state;
152
-
153
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
154
- return indent;
155
- }
156
-
157
- if (state == "start" || state == "no_regex") {
158
- var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
159
- if (match) {
160
- indent += tab;
161
- }
162
- } else if (state == "doc-start") {
163
- if (endState == "start" || endState == "no_regex") {
164
- return "";
165
- }
166
- var match = line.match(/^\s*(\/?)\*/);
167
- if (match) {
168
- if (match[1]) {
169
- indent += " ";
170
- }
171
- indent += "* ";
172
- }
173
- }
174
21
 
175
- return indent;
176
- };
22
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
177
23
 
178
- this.checkOutdent = function(state, line, input) {
179
- return this.$outdent.checkOutdent(line, input);
24
+ DocCommentHighlightRules.getStartRule = function(start) {
25
+ return {
26
+ token : "comment.doc", // doc comment
27
+ regex : "\\/\\*(?=\\*)",
28
+ next : start
180
29
  };
30
+ };
181
31
 
182
- this.autoOutdent = function(state, doc, row) {
183
- this.$outdent.autoOutdent(doc, row);
32
+ DocCommentHighlightRules.getEndRule = function (start) {
33
+ return {
34
+ token : "comment.doc", // closing comment
35
+ regex : "\\*\\/",
36
+ next : start
184
37
  };
38
+ };
185
39
 
186
- this.createWorker = function(session) {
187
- var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
188
- worker.attachToDocument(session.getDocument());
189
-
190
- worker.on("jslint", function(results) {
191
- session.setAnnotations(results.data);
192
- });
193
-
194
- worker.on("terminate", function() {
195
- session.clearAnnotations();
196
- });
197
-
198
- return worker;
199
- };
200
40
 
201
- this.$id = "ace/mode/javascript";
202
- }).call(Mode.prototype);
41
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
203
42
 
204
- exports.Mode = Mode;
205
43
  });
206
44
 
207
- 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) {
208
-
45
+ 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) {
46
+ "use strict";
209
47
 
210
48
  var oop = require("../lib/oop");
211
49
  var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
212
50
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
213
51
 
214
- var JavaScriptHighlightRules = function() {
52
+ var JavaScriptHighlightRules = function(options) {
215
53
  var keywordMapper = this.createKeywordMapper({
216
54
  "variable.language":
217
55
  "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
@@ -336,19 +174,22 @@ var JavaScriptHighlightRules = function() {
336
174
  }, {
337
175
  token : ["punctuation.operator", "support.constant"],
338
176
  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/
177
+ }, {
178
+ token : ["support.constant"],
179
+ regex : /that\b/
339
180
  }, {
340
181
  token : ["storage.type", "punctuation.operator", "support.function.firebug"],
341
- regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
182
+ regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
342
183
  }, {
343
184
  token : keywordMapper,
344
185
  regex : identifierRe
345
186
  }, {
346
187
  token : "keyword.operator",
347
- regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
188
+ regex : /--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
348
189
  next : "start"
349
190
  }, {
350
191
  token : "punctuation.operator",
351
- regex : /\?|\:|\,|\;|\./,
192
+ regex : /[?:,;.]/,
352
193
  next : "start"
353
194
  }, {
354
195
  token : "paren.lparen",
@@ -357,10 +198,6 @@ var JavaScriptHighlightRules = function() {
357
198
  }, {
358
199
  token : "paren.rparen",
359
200
  regex : /[\])}]/
360
- }, {
361
- token : "keyword.operator",
362
- regex : /\/=?/,
363
- next : "start"
364
201
  }, {
365
202
  token: "comment",
366
203
  regex: /^#!.*$/
@@ -421,7 +258,7 @@ var JavaScriptHighlightRules = function() {
421
258
  ],
422
259
  "regex_character_class": [
423
260
  {
424
- token: "regexp.keyword.operator",
261
+ token: "regexp.charclass.keyword.operator",
425
262
  regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
426
263
  }, {
427
264
  token: "constant.language.escape",
@@ -503,9 +340,49 @@ var JavaScriptHighlightRules = function() {
503
340
  }
504
341
  ]
505
342
  };
506
-
343
+
344
+
345
+ if (!options || !options.noES6) {
346
+ this.$rules.no_regex.unshift({
347
+ regex: "[{}]", onMatch: function(val, state, stack) {
348
+ this.next = val == "{" ? this.nextState : "";
349
+ if (val == "{" && stack.length) {
350
+ stack.unshift("start", state);
351
+ return "paren";
352
+ }
353
+ if (val == "}" && stack.length) {
354
+ stack.shift();
355
+ this.next = stack.shift();
356
+ if (this.next.indexOf("string") != -1)
357
+ return "paren.quasi.end";
358
+ }
359
+ return val == "{" ? "paren.lparen" : "paren.rparen";
360
+ },
361
+ nextState: "start"
362
+ }, {
363
+ token : "string.quasi.start",
364
+ regex : /`/,
365
+ push : [{
366
+ token : "constant.language.escape",
367
+ regex : escapedRe
368
+ }, {
369
+ token : "paren.quasi.start",
370
+ regex : /\${/,
371
+ push : "start"
372
+ }, {
373
+ token : "string.quasi.end",
374
+ regex : /`/,
375
+ next : "pop"
376
+ }, {
377
+ defaultToken: "string.quasi"
378
+ }]
379
+ });
380
+ }
381
+
507
382
  this.embedRules(DocCommentHighlightRules, "doc-",
508
383
  [ DocCommentHighlightRules.getEndRule("no_regex") ]);
384
+
385
+ this.normalizeRules();
509
386
  };
510
387
 
511
388
  oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@@ -513,52 +390,8 @@ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
513
390
  exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
514
391
  });
515
392
 
516
- define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
517
-
518
-
519
- var oop = require("../lib/oop");
520
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
521
-
522
- var DocCommentHighlightRules = function() {
523
-
524
- this.$rules = {
525
- "start" : [ {
526
- token : "comment.doc.tag",
527
- regex : "@[\\w\\d_]+" // TODO: fix email addresses
528
- }, {
529
- token : "comment.doc.tag",
530
- regex : "\\bTODO\\b"
531
- }, {
532
- defaultToken : "comment.doc"
533
- }]
534
- };
535
- };
536
-
537
- oop.inherits(DocCommentHighlightRules, TextHighlightRules);
538
-
539
- DocCommentHighlightRules.getStartRule = function(start) {
540
- return {
541
- token : "comment.doc", // doc comment
542
- regex : "\\/\\*(?=\\*)",
543
- next : start
544
- };
545
- };
546
-
547
- DocCommentHighlightRules.getEndRule = function (start) {
548
- return {
549
- token : "comment.doc", // closing comment
550
- regex : "\\*\\/",
551
- next : start
552
- };
553
- };
554
-
555
-
556
- exports.DocCommentHighlightRules = DocCommentHighlightRules;
557
-
558
- });
559
-
560
- define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
561
-
393
+ define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
394
+ "use strict";
562
395
 
563
396
  var Range = require("../range").Range;
564
397
 
@@ -597,8 +430,8 @@ var MatchingBraceOutdent = function() {};
597
430
  exports.MatchingBraceOutdent = MatchingBraceOutdent;
598
431
  });
599
432
 
600
- define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
601
-
433
+ define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
434
+ "use strict";
602
435
 
603
436
  var oop = require("../../lib/oop");
604
437
  var Behaviour = require("../behaviour").Behaviour;
@@ -610,83 +443,34 @@ var SAFE_INSERT_IN_TOKENS =
610
443
  var SAFE_INSERT_BEFORE_TOKENS =
611
444
  ["text", "paren.rparen", "punctuation.operator", "comment"];
612
445
 
613
-
614
- var autoInsertedBrackets = 0;
615
- var autoInsertedRow = -1;
616
- var autoInsertedLineEnd = "";
617
- var maybeInsertedBrackets = 0;
618
- var maybeInsertedRow = -1;
619
- var maybeInsertedLineStart = "";
620
- var maybeInsertedLineEnd = "";
621
-
622
- var CstyleBehaviour = function () {
623
-
624
- CstyleBehaviour.isSaneInsertion = function(editor, session) {
625
- var cursor = editor.getCursorPosition();
626
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
627
- if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
628
- var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
629
- if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
630
- return false;
631
- }
632
- iterator.stepForward();
633
- return iterator.getCurrentTokenRow() !== cursor.row ||
634
- this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
635
- };
636
-
637
- CstyleBehaviour.$matchTokenType = function(token, types) {
638
- return types.indexOf(token.type || token) > -1;
639
- };
640
-
641
- CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
642
- var cursor = editor.getCursorPosition();
643
- var line = session.doc.getLine(cursor.row);
644
- if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
645
- autoInsertedBrackets = 0;
646
- autoInsertedRow = cursor.row;
647
- autoInsertedLineEnd = bracket + line.substr(cursor.column);
648
- autoInsertedBrackets++;
446
+ var context;
447
+ var contextCache = {}
448
+ var initContext = function(editor) {
449
+ var id = -1;
450
+ if (editor.multiSelect) {
451
+ id = editor.selection.id;
452
+ if (contextCache.rangeCount != editor.multiSelect.rangeCount)
453
+ contextCache = {rangeCount: editor.multiSelect.rangeCount};
454
+ }
455
+ if (contextCache[id])
456
+ return context = contextCache[id];
457
+ context = contextCache[id] = {
458
+ autoInsertedBrackets: 0,
459
+ autoInsertedRow: -1,
460
+ autoInsertedLineEnd: "",
461
+ maybeInsertedBrackets: 0,
462
+ maybeInsertedRow: -1,
463
+ maybeInsertedLineStart: "",
464
+ maybeInsertedLineEnd: ""
649
465
  };
650
-
651
- CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
652
- var cursor = editor.getCursorPosition();
653
- var line = session.doc.getLine(cursor.row);
654
- if (!this.isMaybeInsertedClosing(cursor, line))
655
- maybeInsertedBrackets = 0;
656
- maybeInsertedRow = cursor.row;
657
- maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
658
- maybeInsertedLineEnd = line.substr(cursor.column);
659
- maybeInsertedBrackets++;
660
- };
661
-
662
- CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
663
- return autoInsertedBrackets > 0 &&
664
- cursor.row === autoInsertedRow &&
665
- bracket === autoInsertedLineEnd[0] &&
666
- line.substr(cursor.column) === autoInsertedLineEnd;
667
- };
668
-
669
- CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
670
- return maybeInsertedBrackets > 0 &&
671
- cursor.row === maybeInsertedRow &&
672
- line.substr(cursor.column) === maybeInsertedLineEnd &&
673
- line.substr(0, cursor.column) == maybeInsertedLineStart;
674
- };
675
-
676
- CstyleBehaviour.popAutoInsertedClosing = function() {
677
- autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
678
- autoInsertedBrackets--;
679
- };
680
-
681
- CstyleBehaviour.clearMaybeInsertedClosing = function() {
682
- maybeInsertedBrackets = 0;
683
- maybeInsertedRow = -1;
684
- };
685
-
686
- this.add("braces", "insertion", function (state, action, editor, session, text) {
466
+ };
467
+
468
+ var CstyleBehaviour = function() {
469
+ this.add("braces", "insertion", function(state, action, editor, session, text) {
687
470
  var cursor = editor.getCursorPosition();
688
471
  var line = session.doc.getLine(cursor.row);
689
472
  if (text == '{') {
473
+ initContext(editor);
690
474
  var selection = editor.getSelectionRange();
691
475
  var selected = session.doc.getTextRange(selection);
692
476
  if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
@@ -710,6 +494,7 @@ var CstyleBehaviour = function () {
710
494
  }
711
495
  }
712
496
  } else if (text == '}') {
497
+ initContext(editor);
713
498
  var rightChar = line.substring(cursor.column, cursor.column + 1);
714
499
  if (rightChar == '}') {
715
500
  var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
@@ -722,9 +507,10 @@ var CstyleBehaviour = function () {
722
507
  }
723
508
  }
724
509
  } else if (text == "\n" || text == "\r\n") {
510
+ initContext(editor);
725
511
  var closing = "";
726
512
  if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
727
- closing = lang.stringRepeat("}", maybeInsertedBrackets);
513
+ closing = lang.stringRepeat("}", context.maybeInsertedBrackets);
728
514
  CstyleBehaviour.clearMaybeInsertedClosing();
729
515
  }
730
516
  var rightChar = line.substring(cursor.column, cursor.column + 1);
@@ -736,6 +522,7 @@ var CstyleBehaviour = function () {
736
522
  } else if (closing) {
737
523
  var next_indent = this.$getIndent(line);
738
524
  } else {
525
+ CstyleBehaviour.clearMaybeInsertedClosing();
739
526
  return;
740
527
  }
741
528
  var indent = next_indent + session.getTabString();
@@ -749,22 +536,24 @@ var CstyleBehaviour = function () {
749
536
  }
750
537
  });
751
538
 
752
- this.add("braces", "deletion", function (state, action, editor, session, range) {
539
+ this.add("braces", "deletion", function(state, action, editor, session, range) {
753
540
  var selected = session.doc.getTextRange(range);
754
541
  if (!range.isMultiLine() && selected == '{') {
542
+ initContext(editor);
755
543
  var line = session.doc.getLine(range.start.row);
756
544
  var rightChar = line.substring(range.end.column, range.end.column + 1);
757
545
  if (rightChar == '}') {
758
546
  range.end.column++;
759
547
  return range;
760
548
  } else {
761
- maybeInsertedBrackets--;
549
+ context.maybeInsertedBrackets--;
762
550
  }
763
551
  }
764
552
  });
765
553
 
766
- this.add("parens", "insertion", function (state, action, editor, session, text) {
554
+ this.add("parens", "insertion", function(state, action, editor, session, text) {
767
555
  if (text == '(') {
556
+ initContext(editor);
768
557
  var selection = editor.getSelectionRange();
769
558
  var selected = session.doc.getTextRange(selection);
770
559
  if (selected !== "" && editor.getWrapBehavioursEnabled()) {
@@ -780,6 +569,7 @@ var CstyleBehaviour = function () {
780
569
  };
781
570
  }
782
571
  } else if (text == ')') {
572
+ initContext(editor);
783
573
  var cursor = editor.getCursorPosition();
784
574
  var line = session.doc.getLine(cursor.row);
785
575
  var rightChar = line.substring(cursor.column, cursor.column + 1);
@@ -796,9 +586,10 @@ var CstyleBehaviour = function () {
796
586
  }
797
587
  });
798
588
 
799
- this.add("parens", "deletion", function (state, action, editor, session, range) {
589
+ this.add("parens", "deletion", function(state, action, editor, session, range) {
800
590
  var selected = session.doc.getTextRange(range);
801
591
  if (!range.isMultiLine() && selected == '(') {
592
+ initContext(editor);
802
593
  var line = session.doc.getLine(range.start.row);
803
594
  var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
804
595
  if (rightChar == ')') {
@@ -808,8 +599,9 @@ var CstyleBehaviour = function () {
808
599
  }
809
600
  });
810
601
 
811
- this.add("brackets", "insertion", function (state, action, editor, session, text) {
602
+ this.add("brackets", "insertion", function(state, action, editor, session, text) {
812
603
  if (text == '[') {
604
+ initContext(editor);
813
605
  var selection = editor.getSelectionRange();
814
606
  var selected = session.doc.getTextRange(selection);
815
607
  if (selected !== "" && editor.getWrapBehavioursEnabled()) {
@@ -825,6 +617,7 @@ var CstyleBehaviour = function () {
825
617
  };
826
618
  }
827
619
  } else if (text == ']') {
620
+ initContext(editor);
828
621
  var cursor = editor.getCursorPosition();
829
622
  var line = session.doc.getLine(cursor.row);
830
623
  var rightChar = line.substring(cursor.column, cursor.column + 1);
@@ -841,9 +634,10 @@ var CstyleBehaviour = function () {
841
634
  }
842
635
  });
843
636
 
844
- this.add("brackets", "deletion", function (state, action, editor, session, range) {
637
+ this.add("brackets", "deletion", function(state, action, editor, session, range) {
845
638
  var selected = session.doc.getTextRange(range);
846
639
  if (!range.isMultiLine() && selected == '[') {
640
+ initContext(editor);
847
641
  var line = session.doc.getLine(range.start.row);
848
642
  var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
849
643
  if (rightChar == ']') {
@@ -853,8 +647,9 @@ var CstyleBehaviour = function () {
853
647
  }
854
648
  });
855
649
 
856
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
650
+ this.add("string_dquotes", "insertion", function(state, action, editor, session, text) {
857
651
  if (text == '"' || text == "'") {
652
+ initContext(editor);
858
653
  var quote = text;
859
654
  var selection = editor.getSelectionRange();
860
655
  var selected = session.doc.getTextRange(selection);
@@ -906,9 +701,10 @@ var CstyleBehaviour = function () {
906
701
  }
907
702
  });
908
703
 
909
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
704
+ this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
910
705
  var selected = session.doc.getTextRange(range);
911
706
  if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
707
+ initContext(editor);
912
708
  var line = session.doc.getLine(range.start.row);
913
709
  var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
914
710
  if (rightChar == selected) {
@@ -920,13 +716,80 @@ var CstyleBehaviour = function () {
920
716
 
921
717
  };
922
718
 
719
+
720
+ CstyleBehaviour.isSaneInsertion = function(editor, session) {
721
+ var cursor = editor.getCursorPosition();
722
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
723
+ if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
724
+ var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
725
+ if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
726
+ return false;
727
+ }
728
+ iterator.stepForward();
729
+ return iterator.getCurrentTokenRow() !== cursor.row ||
730
+ this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
731
+ };
732
+
733
+ CstyleBehaviour.$matchTokenType = function(token, types) {
734
+ return types.indexOf(token.type || token) > -1;
735
+ };
736
+
737
+ CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
738
+ var cursor = editor.getCursorPosition();
739
+ var line = session.doc.getLine(cursor.row);
740
+ if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0]))
741
+ context.autoInsertedBrackets = 0;
742
+ context.autoInsertedRow = cursor.row;
743
+ context.autoInsertedLineEnd = bracket + line.substr(cursor.column);
744
+ context.autoInsertedBrackets++;
745
+ };
746
+
747
+ CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
748
+ var cursor = editor.getCursorPosition();
749
+ var line = session.doc.getLine(cursor.row);
750
+ if (!this.isMaybeInsertedClosing(cursor, line))
751
+ context.maybeInsertedBrackets = 0;
752
+ context.maybeInsertedRow = cursor.row;
753
+ context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
754
+ context.maybeInsertedLineEnd = line.substr(cursor.column);
755
+ context.maybeInsertedBrackets++;
756
+ };
757
+
758
+ CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
759
+ return context.autoInsertedBrackets > 0 &&
760
+ cursor.row === context.autoInsertedRow &&
761
+ bracket === context.autoInsertedLineEnd[0] &&
762
+ line.substr(cursor.column) === context.autoInsertedLineEnd;
763
+ };
764
+
765
+ CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
766
+ return context.maybeInsertedBrackets > 0 &&
767
+ cursor.row === context.maybeInsertedRow &&
768
+ line.substr(cursor.column) === context.maybeInsertedLineEnd &&
769
+ line.substr(0, cursor.column) == context.maybeInsertedLineStart;
770
+ };
771
+
772
+ CstyleBehaviour.popAutoInsertedClosing = function() {
773
+ context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1);
774
+ context.autoInsertedBrackets--;
775
+ };
776
+
777
+ CstyleBehaviour.clearMaybeInsertedClosing = function() {
778
+ if (context) {
779
+ context.maybeInsertedBrackets = 0;
780
+ context.maybeInsertedRow = -1;
781
+ }
782
+ };
783
+
784
+
785
+
923
786
  oop.inherits(CstyleBehaviour, Behaviour);
924
787
 
925
788
  exports.CstyleBehaviour = CstyleBehaviour;
926
789
  });
927
790
 
928
- define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
929
-
791
+ define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
792
+ "use strict";
930
793
 
931
794
  var oop = require("../../lib/oop");
932
795
  var Range = require("../../range").Range;
@@ -1020,41 +883,59 @@ oop.inherits(FoldMode, BaseFoldMode);
1020
883
 
1021
884
  });
1022
885
 
1023
- define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) {
1024
-
886
+ define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) {
887
+ "use strict";
1025
888
 
1026
889
  var oop = require("../lib/oop");
1027
890
  var TextMode = require("./text").Mode;
1028
- var Tokenizer = require("../tokenizer").Tokenizer;
1029
- var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
891
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1030
892
  var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
893
+ var Range = require("../range").Range;
1031
894
  var WorkerClient = require("../worker/worker_client").WorkerClient;
1032
- var CssBehaviour = require("./behaviour/css").CssBehaviour;
895
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
1033
896
  var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1034
897
 
1035
898
  var Mode = function() {
1036
- this.HighlightRules = CssHighlightRules;
899
+ this.HighlightRules = JavaScriptHighlightRules;
900
+
1037
901
  this.$outdent = new MatchingBraceOutdent();
1038
- this.$behaviour = new CssBehaviour();
902
+ this.$behaviour = new CstyleBehaviour();
1039
903
  this.foldingRules = new CStyleFoldMode();
1040
904
  };
1041
905
  oop.inherits(Mode, TextMode);
1042
906
 
1043
907
  (function() {
1044
908
 
1045
- this.foldingRules = "cStyle";
909
+ this.lineCommentStart = "//";
1046
910
  this.blockComment = {start: "/*", end: "*/"};
1047
911
 
1048
912
  this.getNextLineIndent = function(state, line, tab) {
1049
913
  var indent = this.$getIndent(line);
1050
- var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
914
+
915
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
916
+ var tokens = tokenizedLine.tokens;
917
+ var endState = tokenizedLine.state;
918
+
1051
919
  if (tokens.length && tokens[tokens.length-1].type == "comment") {
1052
920
  return indent;
1053
921
  }
1054
922
 
1055
- var match = line.match(/^.*\{\s*$/);
1056
- if (match) {
1057
- indent += tab;
923
+ if (state == "start" || state == "no_regex") {
924
+ var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
925
+ if (match) {
926
+ indent += tab;
927
+ }
928
+ } else if (state == "doc-start") {
929
+ if (endState == "start" || endState == "no_regex") {
930
+ return "";
931
+ }
932
+ var match = line.match(/^\s*(\/?)\*/);
933
+ if (match) {
934
+ if (match[1]) {
935
+ indent += " ";
936
+ }
937
+ indent += "* ";
938
+ }
1058
939
  }
1059
940
 
1060
941
  return indent;
@@ -1069,11 +950,11 @@ oop.inherits(Mode, TextMode);
1069
950
  };
1070
951
 
1071
952
  this.createWorker = function(session) {
1072
- var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
953
+ var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
1073
954
  worker.attachToDocument(session.getDocument());
1074
955
 
1075
- worker.on("csslint", function(e) {
1076
- session.setAnnotations(e.data);
956
+ worker.on("jslint", function(results) {
957
+ session.setAnnotations(results.data);
1077
958
  });
1078
959
 
1079
960
  worker.on("terminate", function() {
@@ -1083,15 +964,14 @@ oop.inherits(Mode, TextMode);
1083
964
  return worker;
1084
965
  };
1085
966
 
1086
- this.$id = "ace/mode/css";
967
+ this.$id = "ace/mode/javascript";
1087
968
  }).call(Mode.prototype);
1088
969
 
1089
970
  exports.Mode = Mode;
1090
-
1091
971
  });
1092
972
 
1093
- define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
1094
-
973
+ define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
974
+ "use strict";
1095
975
 
1096
976
  var oop = require("../lib/oop");
1097
977
  var lang = require("../lib/lang");
@@ -1234,8 +1114,8 @@ exports.CssHighlightRules = CssHighlightRules;
1234
1114
 
1235
1115
  });
1236
1116
 
1237
- define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) {
1238
-
1117
+ define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) {
1118
+ "use strict";
1239
1119
 
1240
1120
  var oop = require("../../lib/oop");
1241
1121
  var Behaviour = require("../behaviour").Behaviour;
@@ -1313,161 +1193,150 @@ oop.inherits(CssBehaviour, CstyleBehaviour);
1313
1193
  exports.CssBehaviour = CssBehaviour;
1314
1194
  });
1315
1195
 
1316
- 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) {
1317
-
1196
+ define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
1197
+ "use strict";
1318
1198
 
1319
1199
  var oop = require("../lib/oop");
1320
- var lang = require("../lib/lang");
1200
+ var TextMode = require("./text").Mode;
1321
1201
  var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1322
- var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1323
- var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
1202
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1203
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
1204
+ var CssBehaviour = require("./behaviour/css").CssBehaviour;
1205
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1324
1206
 
1325
- var tagMap = lang.createMap({
1326
- a : 'anchor',
1327
- button : 'form',
1328
- form : 'form',
1329
- img : 'image',
1330
- input : 'form',
1331
- label : 'form',
1332
- option : 'form',
1333
- script : 'script',
1334
- select : 'form',
1335
- textarea : 'form',
1336
- style : 'style',
1337
- table : 'table',
1338
- tbody : 'table',
1339
- td : 'table',
1340
- tfoot : 'table',
1341
- th : 'table',
1342
- tr : 'table'
1343
- });
1207
+ var Mode = function() {
1208
+ this.HighlightRules = CssHighlightRules;
1209
+ this.$outdent = new MatchingBraceOutdent();
1210
+ this.$behaviour = new CssBehaviour();
1211
+ this.foldingRules = new CStyleFoldMode();
1212
+ };
1213
+ oop.inherits(Mode, TextMode);
1344
1214
 
1345
- var HtmlHighlightRules = function() {
1346
- XmlHighlightRules.call(this);
1215
+ (function() {
1347
1216
 
1348
- this.addRules({
1349
- attributes: [{
1350
- include : "space"
1351
- }, {
1352
- token : "entity.other.attribute-name",
1353
- regex : "[-_a-zA-Z0-9:]+"
1354
- }, {
1355
- token : "keyword.operator.separator",
1356
- regex : "=",
1357
- push : [{
1358
- include: "space"
1359
- }, {
1360
- token : "string",
1361
- regex : "[^<>='\"`\\s]+",
1362
- next : "pop"
1363
- }, {
1364
- token : "empty",
1365
- regex : "",
1366
- next : "pop"
1367
- }]
1368
- }, {
1369
- include : "string"
1370
- }],
1371
- tag: [{
1372
- token : function(start, tag) {
1373
- var group = tagMap[tag];
1374
- return ["meta.tag.punctuation.begin",
1375
- "meta.tag.name" + (group ? "." + group : "")];
1376
- },
1377
- regex : "(<)([-_a-zA-Z0-9:]+)",
1378
- next: "start_tag_stuff"
1379
- }, {
1380
- token : function(start, tag) {
1381
- var group = tagMap[tag];
1382
- return ["meta.tag.punctuation.begin",
1383
- "meta.tag.name" + (group ? "." + group : "")];
1384
- },
1385
- regex : "(</)([-_a-zA-Z0-9:]+)",
1386
- next: "end_tag_stuff"
1387
- }],
1388
- start_tag_stuff: [
1389
- {include : "attributes"},
1390
- {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"}
1391
- ],
1392
- end_tag_stuff: [
1393
- {include : "space"},
1394
- {token : "meta.tag.punctuation.end", regex : ">", next : "start"}
1395
- ]
1396
- });
1217
+ this.foldingRules = "cStyle";
1218
+ this.blockComment = {start: "/*", end: "*/"};
1397
1219
 
1398
- this.embedTagRules(CssHighlightRules, "css-", "style");
1399
- this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
1220
+ this.getNextLineIndent = function(state, line, tab) {
1221
+ var indent = this.$getIndent(line);
1222
+ var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
1223
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
1224
+ return indent;
1225
+ }
1400
1226
 
1401
- if (this.constructor === HtmlHighlightRules)
1402
- this.normalizeRules();
1403
- };
1227
+ var match = line.match(/^.*\{\s*$/);
1228
+ if (match) {
1229
+ indent += tab;
1230
+ }
1404
1231
 
1405
- oop.inherits(HtmlHighlightRules, XmlHighlightRules);
1232
+ return indent;
1233
+ };
1406
1234
 
1407
- exports.HtmlHighlightRules = HtmlHighlightRules;
1408
- });
1235
+ this.checkOutdent = function(state, line, input) {
1236
+ return this.$outdent.checkOutdent(line, input);
1237
+ };
1238
+
1239
+ this.autoOutdent = function(state, doc, row) {
1240
+ this.$outdent.autoOutdent(doc, row);
1241
+ };
1242
+
1243
+ this.createWorker = function(session) {
1244
+ var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
1245
+ worker.attachToDocument(session.getDocument());
1246
+
1247
+ worker.on("csslint", function(e) {
1248
+ session.setAnnotations(e.data);
1249
+ });
1250
+
1251
+ worker.on("terminate", function() {
1252
+ session.clearAnnotations();
1253
+ });
1254
+
1255
+ return worker;
1256
+ };
1257
+
1258
+ this.$id = "ace/mode/css";
1259
+ }).call(Mode.prototype);
1409
1260
 
1410
- 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) {
1261
+ exports.Mode = Mode;
1262
+
1263
+ });
1411
1264
 
1265
+ define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
1266
+ "use strict";
1412
1267
 
1413
1268
  var oop = require("../lib/oop");
1414
- var xmlUtil = require("./xml_util");
1415
1269
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1416
1270
 
1417
1271
  var XmlHighlightRules = function(normalize) {
1418
1272
  this.$rules = {
1419
1273
  start : [
1420
- {token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"},
1274
+ {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
1421
1275
  {
1422
- token : ["punctuation.instruction.begin", "keyword.instruction"],
1423
- regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration"
1276
+ token : ["punctuation.xml-decl.xml", "keyword.xml-decl.xml"],
1277
+ regex : "(<\\?)(xml)(?=[\\s])", next : "xml_decl", caseInsensitive: true
1424
1278
  },
1425
1279
  {
1426
- token : ["punctuation.instruction.begin", "keyword.instruction"],
1427
- regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction"
1280
+ token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
1281
+ regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "processing_instruction",
1428
1282
  },
1429
- {token : "comment", regex : "<\\!--", next : "comment"},
1283
+ {token : "comment.xml", regex : "<\\!--", next : "comment"},
1430
1284
  {
1431
- token : ["punctuation.doctype.begin", "meta.tag.doctype"],
1432
- regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype"
1285
+ token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
1286
+ regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
1433
1287
  },
1434
1288
  {include : "tag"},
1435
- {include : "reference"}
1289
+ {token : "text.end-tag-open.xml", regex: "</"},
1290
+ {token : "text.tag-open.xml", regex: "<"},
1291
+ {include : "reference"},
1292
+ {defaultToken : "text.xml"}
1436
1293
  ],
1437
1294
 
1438
- xml_declaration : [
1439
- {include : "attributes"},
1440
- {include : "instruction"}
1441
- ],
1295
+ xml_decl : [{
1296
+ token : "entity.other.attribute-name.decl-attribute-name.xml",
1297
+ regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
1298
+ }, {
1299
+ token : "keyword.operator.decl-attribute-equals.xml",
1300
+ regex : "="
1301
+ }, {
1302
+ include: "whitespace"
1303
+ }, {
1304
+ include: "string"
1305
+ }, {
1306
+ token : "punctuation.xml-decl.xml",
1307
+ regex : "\\?>",
1308
+ next : "start"
1309
+ }],
1442
1310
 
1443
- instruction : [
1444
- {token : "punctuation.instruction.end", regex : "\\?>", next : "start"}
1311
+ processing_instruction : [
1312
+ {token : "punctuation.instruction.xml", regex : "\\?>", next : "start"},
1313
+ {defaultToken : "instruction.xml"}
1445
1314
  ],
1446
1315
 
1447
1316
  doctype : [
1448
- {include : "space"},
1317
+ {include : "whitespace"},
1449
1318
  {include : "string"},
1450
- {token : "punctuation.doctype.end", regex : ">", next : "start"},
1451
- {token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"},
1452
- {token : "punctuation.begin", regex : "\\[", push : "declarations"}
1319
+ {token : "xml-pe.doctype.xml", regex : ">", next : "start"},
1320
+ {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
1321
+ {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
1453
1322
  ],
1454
1323
 
1455
- declarations : [{
1456
- token : "text",
1324
+ int_subset : [{
1325
+ token : "text.xml",
1457
1326
  regex : "\\s+"
1458
1327
  }, {
1459
- token: "punctuation.end",
1328
+ token: "punctuation.int-subset.xml",
1460
1329
  regex: "]",
1461
1330
  next: "pop"
1462
1331
  }, {
1463
- token : ["punctuation.begin", "keyword"],
1332
+ token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
1464
1333
  regex : "(<\\!)([-_a-zA-Z0-9]+)",
1465
1334
  push : [{
1466
1335
  token : "text",
1467
1336
  regex : "\\s+"
1468
1337
  },
1469
1338
  {
1470
- token : "punctuation.end",
1339
+ token : "punctuation.markup-decl.xml",
1471
1340
  regex : ">",
1472
1341
  next : "pop"
1473
1342
  },
@@ -1475,75 +1344,85 @@ var XmlHighlightRules = function(normalize) {
1475
1344
  }],
1476
1345
 
1477
1346
  cdata : [
1478
- {token : "string.end", regex : "\\]\\]>", next : "start"},
1479
- {token : "text", regex : "\\s+"},
1480
- {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"}
1347
+ {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
1348
+ {token : "text.xml", regex : "\\s+"},
1349
+ {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
1481
1350
  ],
1482
1351
 
1483
1352
  comment : [
1484
- {token : "comment", regex : "-->", next : "start"},
1485
- {defaultToken : "comment"}
1353
+ {token : "comment.xml", regex : "-->", next : "start"},
1354
+ {defaultToken : "comment.xml"}
1486
1355
  ],
1487
1356
 
1357
+ reference : [{
1358
+ token : "constant.language.escape.reference.xml",
1359
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1360
+ }],
1361
+
1362
+ attr_reference : [{
1363
+ token : "constant.language.escape.reference.attribute-value.xml",
1364
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1365
+ }],
1366
+
1488
1367
  tag : [{
1489
- token : ["meta.tag.punctuation.begin", "meta.tag.name"],
1490
- regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
1368
+ token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
1369
+ regex : "(?:(<)|(</))((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
1491
1370
  next: [
1492
1371
  {include : "attributes"},
1493
- {token : "meta.tag.punctuation.end", regex : "/?>", next : "start"}
1494
- ]
1495
- }, {
1496
- token : ["meta.tag.punctuation.begin", "meta.tag.name"],
1497
- regex : "(</)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
1498
- next: [
1499
- {include : "space"},
1500
- {token : "meta.tag.punctuation.end", regex : ">", next : "start"}
1372
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
1501
1373
  ]
1502
1374
  }],
1503
1375
 
1504
- space : [
1505
- {token : "text", regex : "\\s+"}
1376
+ tag_whitespace : [
1377
+ {token : "text.tag-whitespace.xml", regex : "\\s+"}
1378
+ ],
1379
+ whitespace : [
1380
+ {token : "text.whitespace.xml", regex : "\\s+"}
1506
1381
  ],
1507
-
1508
- reference : [{
1509
- token : "constant.language.escape",
1510
- regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1511
- }, {
1512
- token : "text", regex : "&"
1513
- }],
1514
-
1515
1382
  string: [{
1516
- token : "string",
1383
+ token : "string.xml",
1517
1384
  regex : "'",
1518
- push : "qstring_inner"
1385
+ push : [
1386
+ {token : "string.xml", regex: "'", next: "pop"},
1387
+ {defaultToken : "string.xml"}
1388
+ ]
1519
1389
  }, {
1520
- token : "string",
1390
+ token : "string.xml",
1521
1391
  regex : '"',
1522
- push : "qqstring_inner"
1392
+ push : [
1393
+ {token : "string.xml", regex: '"', next: "pop"},
1394
+ {defaultToken : "string.xml"}
1395
+ ]
1523
1396
  }],
1524
1397
 
1525
- qstring_inner: [
1526
- {token : "string", regex: "'", next: "pop"},
1527
- {include : "reference"},
1528
- {defaultToken : "string"}
1529
- ],
1530
-
1531
- qqstring_inner: [
1532
- {token : "string", regex: '"', next: "pop"},
1533
- {include : "reference"},
1534
- {defaultToken : "string"}
1535
- ],
1536
-
1537
1398
  attributes: [{
1538
- token : "entity.other.attribute-name",
1399
+ token : "entity.other.attribute-name.xml",
1539
1400
  regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
1540
1401
  }, {
1541
- token : "keyword.operator.separator",
1402
+ token : "keyword.operator.attribute-equals.xml",
1542
1403
  regex : "="
1543
1404
  }, {
1544
- include : "space"
1405
+ include: "tag_whitespace"
1406
+ }, {
1407
+ include: "attribute_value"
1408
+ }],
1409
+
1410
+ attribute_value: [{
1411
+ token : "string.attribute-value.xml",
1412
+ regex : "'",
1413
+ push : [
1414
+ {token : "string.attribute-value.xml", regex: "'", next: "pop"},
1415
+ {include : "attr_reference"},
1416
+ {defaultToken : "string.attribute-value.xml"}
1417
+ ]
1545
1418
  }, {
1546
- include : "string"
1419
+ token : "string.attribute-value.xml",
1420
+ regex : '"',
1421
+ push : [
1422
+ {token : "string.attribute-value.xml", regex: '"', next: "pop"},
1423
+ {include : "attr_reference"},
1424
+ {defaultToken : "string.attribute-value.xml"}
1425
+ ]
1547
1426
  }]
1548
1427
  };
1549
1428
 
@@ -1556,18 +1435,17 @@ var XmlHighlightRules = function(normalize) {
1556
1435
 
1557
1436
  this.embedTagRules = function(HighlightRules, prefix, tag){
1558
1437
  this.$rules.tag.unshift({
1559
- token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag],
1560
- regex : "(<)(" + tag + ")",
1438
+ token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
1439
+ regex : "(<)(" + tag + "(?=\\s|>|$))",
1561
1440
  next: [
1562
- {include : "space"},
1563
1441
  {include : "attributes"},
1564
- {token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"}
1442
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
1565
1443
  ]
1566
1444
  });
1567
1445
 
1568
1446
  this.$rules[tag + "-end"] = [
1569
- {include : "space"},
1570
- {token : "meta.tag.punctuation.end", regex : ">", next: "start",
1447
+ {include : "attributes"},
1448
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
1571
1449
  onMatch : function(value, currentState, stack) {
1572
1450
  stack.splice(0);
1573
1451
  return this.token;
@@ -1575,14 +1453,14 @@ var XmlHighlightRules = function(normalize) {
1575
1453
  ]
1576
1454
 
1577
1455
  this.embedRules(HighlightRules, prefix, [{
1578
- token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag],
1579
- regex : "(</)(" + tag + ")",
1456
+ token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
1457
+ regex : "(</)(" + tag + "(?=\\s|>|$))",
1580
1458
  next: tag + "-end"
1581
1459
  }, {
1582
- token: "string.begin",
1460
+ token: "string.cdata.xml",
1583
1461
  regex : "<\\!\\[CDATA\\["
1584
1462
  }, {
1585
- token: "string.end",
1463
+ token: "string.cdata.xml",
1586
1464
  regex : "\\]\\]>"
1587
1465
  }]);
1588
1466
  };
@@ -1594,183 +1472,194 @@ oop.inherits(XmlHighlightRules, TextHighlightRules);
1594
1472
  exports.XmlHighlightRules = XmlHighlightRules;
1595
1473
  });
1596
1474
 
1597
- define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
1598
-
1475
+ 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) {
1476
+ "use strict";
1599
1477
 
1600
- function string(state) {
1601
- return [{
1602
- token : "string",
1603
- regex : '"',
1604
- next : state + "_qqstring"
1605
- }, {
1606
- token : "string",
1607
- regex : "'",
1608
- next : state + "_qstring"
1609
- }];
1610
- }
1478
+ var oop = require("../lib/oop");
1479
+ var lang = require("../lib/lang");
1480
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1481
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1482
+ var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
1611
1483
 
1612
- function multiLineString(quote, state) {
1613
- return [
1614
- {token : "string", regex : quote, next : state},
1615
- {
1616
- token : "constant.language.escape",
1617
- regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1618
- },
1619
- {defaultToken : "string"}
1620
- ];
1621
- }
1484
+ var tagMap = lang.createMap({
1485
+ a : 'anchor',
1486
+ button : 'form',
1487
+ form : 'form',
1488
+ img : 'image',
1489
+ input : 'form',
1490
+ label : 'form',
1491
+ option : 'form',
1492
+ script : 'script',
1493
+ select : 'form',
1494
+ textarea : 'form',
1495
+ style : 'style',
1496
+ table : 'table',
1497
+ tbody : 'table',
1498
+ td : 'table',
1499
+ tfoot : 'table',
1500
+ th : 'table',
1501
+ tr : 'table'
1502
+ });
1622
1503
 
1623
- exports.tag = function(states, name, nextState, tagMap) {
1624
- states[name] = [{
1625
- token : "text",
1626
- regex : "\\s+"
1627
- }, {
1628
-
1629
- token : !tagMap ? "meta.tag.tag-name" : function(value) {
1630
- if (tagMap[value])
1631
- return "meta.tag.tag-name." + tagMap[value];
1632
- else
1633
- return "meta.tag.tag-name";
1634
- },
1635
- regex : "[-_a-zA-Z0-9:]+",
1636
- next : name + "_embed_attribute_list"
1637
- }, {
1638
- token: "empty",
1639
- regex: "",
1640
- next : name + "_embed_attribute_list"
1641
- }];
1642
-
1643
- states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
1644
- states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
1645
-
1646
- states[name + "_embed_attribute_list"] = [{
1647
- token : "meta.tag.r",
1648
- regex : "/?>",
1649
- next : nextState
1650
- }, {
1651
- token : "keyword.operator",
1652
- regex : "="
1653
- }, {
1654
- token : "entity.other.attribute-name",
1655
- regex : "[-_a-zA-Z0-9:]+"
1656
- }, {
1657
- token : "constant.numeric", // float
1658
- regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
1659
- }, {
1660
- token : "text",
1661
- regex : "\\s+"
1662
- }].concat(string(name));
1504
+ var HtmlHighlightRules = function() {
1505
+ XmlHighlightRules.call(this);
1506
+
1507
+ this.addRules({
1508
+ attributes: [{
1509
+ include : "tag_whitespace"
1510
+ }, {
1511
+ token : "entity.other.attribute-name.xml",
1512
+ regex : "[-_a-zA-Z0-9:]+"
1513
+ }, {
1514
+ token : "keyword.operator.attribute-equals.xml",
1515
+ regex : "=",
1516
+ push : [{
1517
+ include: "tag_whitespace"
1518
+ }, {
1519
+ token : "string.unquoted.attribute-value.html",
1520
+ regex : "[^<>='\"`\\s]+",
1521
+ next : "pop"
1522
+ }, {
1523
+ token : "empty",
1524
+ regex : "",
1525
+ next : "pop"
1526
+ }]
1527
+ }, {
1528
+ include : "attribute_value"
1529
+ }],
1530
+ tag: [{
1531
+ token : function(start, tag) {
1532
+ var group = tagMap[tag];
1533
+ return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
1534
+ "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
1535
+ },
1536
+ regex : "(</?)([-_a-zA-Z0-9:]+)",
1537
+ next: "tag_stuff"
1538
+ }],
1539
+ tag_stuff: [
1540
+ {include : "attributes"},
1541
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
1542
+ ],
1543
+ });
1544
+
1545
+ this.embedTagRules(CssHighlightRules, "css-", "style");
1546
+ this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
1547
+
1548
+ if (this.constructor === HtmlHighlightRules)
1549
+ this.normalizeRules();
1663
1550
  };
1664
1551
 
1665
- });
1552
+ oop.inherits(HtmlHighlightRules, XmlHighlightRules);
1666
1553
 
1667
- define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) {
1554
+ exports.HtmlHighlightRules = HtmlHighlightRules;
1555
+ });
1668
1556
 
1557
+ define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module) {
1558
+ "use strict";
1669
1559
 
1670
1560
  var oop = require("../../lib/oop");
1671
- var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
1672
- var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
1561
+ var Behaviour = require("../behaviour").Behaviour;
1673
1562
  var TokenIterator = require("../../token_iterator").TokenIterator;
1674
- var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
1675
1563
 
1676
- function hasType(token, type) {
1677
- var tokenTypes = token.type.split('.');
1678
- return type.split('.').every(function(type){
1679
- return (tokenTypes.indexOf(type) !== -1);
1680
- });
1681
- return hasType;
1564
+ function is(token, type) {
1565
+ return token.type.lastIndexOf(type + ".xml") > -1;
1682
1566
  }
1683
1567
 
1684
- var HtmlBehaviour = function () {
1568
+ var XmlBehaviour = function () {
1685
1569
 
1686
- this.inherit(XmlBehaviour); // Get xml behaviour
1687
-
1688
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
1689
- if (text == '>') {
1690
- var position = editor.getCursorPosition();
1691
- var iterator = new TokenIterator(session, position.row, position.column);
1570
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
1571
+ if (text == '"' || text == "'") {
1572
+ var quote = text;
1573
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
1574
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
1575
+ return {
1576
+ text: quote + selected + quote,
1577
+ selection: false
1578
+ };
1579
+ }
1580
+
1581
+ var cursor = editor.getCursorPosition();
1582
+ var line = session.doc.getLine(cursor.row);
1583
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
1584
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
1692
1585
  var token = iterator.getCurrentToken();
1693
1586
 
1694
- if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column)
1695
- return;
1696
- var atCursor = false;
1697
- if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
1698
- do {
1699
- token = iterator.stepBackward();
1700
- } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
1701
- } else {
1702
- atCursor = true;
1703
- }
1704
- if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) {
1705
- return;
1706
- }
1707
- var element = token.value;
1708
- if (atCursor){
1709
- var element = element.substring(0, position.column - token.start);
1587
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
1588
+ return {
1589
+ text: "",
1590
+ selection: [1, 1]
1591
+ };
1710
1592
  }
1711
- if (voidElements.indexOf(element) !== -1){
1593
+
1594
+ if (!token)
1595
+ token = iterator.stepBackward();
1596
+
1597
+ if (!token)
1712
1598
  return;
1599
+
1600
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
1601
+ token = iterator.stepBackward();
1713
1602
  }
1714
- return {
1715
- text: '>' + '</' + element + '>',
1716
- selection: [1, 1]
1603
+ var rightSpace = !rightChar || rightChar.match(/\s/);
1604
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
1605
+ return {
1606
+ text: quote + quote,
1607
+ selection: [1, 1]
1608
+ };
1717
1609
  }
1718
1610
  }
1719
1611
  });
1720
- }
1721
- oop.inherits(HtmlBehaviour, XmlBehaviour);
1722
-
1723
- exports.HtmlBehaviour = HtmlBehaviour;
1724
- });
1725
-
1726
- 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) {
1727
1612
 
1728
-
1729
- var oop = require("../../lib/oop");
1730
- var Behaviour = require("../behaviour").Behaviour;
1731
- var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
1732
- var TokenIterator = require("../../token_iterator").TokenIterator;
1733
-
1734
- function hasType(token, type) {
1735
- var tokenTypes = token.type.split('.');
1736
- return type.split('.').every(function(type){
1737
- return (tokenTypes.indexOf(type) !== -1);
1613
+ this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
1614
+ var selected = session.doc.getTextRange(range);
1615
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
1616
+ var line = session.doc.getLine(range.start.row);
1617
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1618
+ if (rightChar == selected) {
1619
+ range.end.column++;
1620
+ return range;
1621
+ }
1622
+ }
1738
1623
  });
1739
- return hasType;
1740
- }
1741
1624
 
1742
- var XmlBehaviour = function () {
1743
-
1744
- this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
1745
-
1746
1625
  this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
1747
1626
  if (text == '>') {
1748
1627
  var position = editor.getCursorPosition();
1749
1628
  var iterator = new TokenIterator(session, position.row, position.column);
1750
- var token = iterator.getCurrentToken();
1751
-
1752
- if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column)
1629
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
1630
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
1753
1631
  return;
1754
- var atCursor = false;
1755
- if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
1756
- do {
1757
- token = iterator.stepBackward();
1758
- } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
1759
- } else {
1760
- atCursor = true;
1761
- }
1762
- if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) {
1632
+ if (is(token, "reference.attribute-value"))
1763
1633
  return;
1634
+ if (is(token, "attribute-value")) {
1635
+ var firstChar = token.value.charAt(0);
1636
+ if (firstChar == '"' || firstChar == "'") {
1637
+ var lastChar = token.value.charAt(token.value.length - 1);
1638
+ var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length;
1639
+ if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar)
1640
+ return;
1641
+ }
1764
1642
  }
1765
- var tag = token.value;
1766
- if (atCursor){
1767
- var tag = tag.substring(0, position.column - token.start);
1643
+ while (!is(token, "tag-name")) {
1644
+ token = iterator.stepBackward();
1768
1645
  }
1769
1646
 
1647
+ var tokenRow = iterator.getCurrentTokenRow();
1648
+ var tokenColumn = iterator.getCurrentTokenColumn();
1649
+ if (is(iterator.stepBackward(), "end-tag-open"))
1650
+ return;
1651
+
1652
+ var element = token.value;
1653
+ if (tokenRow == position.row)
1654
+ element = element.substring(0, position.column - tokenColumn);
1655
+
1656
+ if (this.voidElements.hasOwnProperty(element.toLowerCase()))
1657
+ return;
1658
+
1770
1659
  return {
1771
- text: '>' + '</' + tag + '>',
1660
+ text: '>' + '</' + element + '>',
1772
1661
  selection: [1, 1]
1773
- }
1662
+ };
1774
1663
  }
1775
1664
  });
1776
1665
 
@@ -1786,66 +1675,20 @@ var XmlBehaviour = function () {
1786
1675
  return {
1787
1676
  text: '\n' + indent + '\n' + next_indent,
1788
1677
  selection: [1, indent.length, 1, indent.length]
1789
- }
1678
+ };
1790
1679
  }
1791
1680
  }
1792
1681
  });
1793
1682
 
1794
- }
1795
- oop.inherits(XmlBehaviour, Behaviour);
1796
-
1797
- exports.XmlBehaviour = XmlBehaviour;
1798
- });
1799
-
1800
- define('ace/mode/folding/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/mixed', 'ace/mode/folding/xml', 'ace/mode/folding/cstyle'], function(require, exports, module) {
1801
-
1802
-
1803
- var oop = require("../../lib/oop");
1804
- var MixedFoldMode = require("./mixed").FoldMode;
1805
- var XmlFoldMode = require("./xml").FoldMode;
1806
- var CStyleFoldMode = require("./cstyle").FoldMode;
1807
-
1808
- var FoldMode = exports.FoldMode = function() {
1809
- MixedFoldMode.call(this, new XmlFoldMode({
1810
- "area": 1,
1811
- "base": 1,
1812
- "br": 1,
1813
- "col": 1,
1814
- "command": 1,
1815
- "embed": 1,
1816
- "hr": 1,
1817
- "img": 1,
1818
- "input": 1,
1819
- "keygen": 1,
1820
- "link": 1,
1821
- "meta": 1,
1822
- "param": 1,
1823
- "source": 1,
1824
- "track": 1,
1825
- "wbr": 1,
1826
- "li": 1,
1827
- "dt": 1,
1828
- "dd": 1,
1829
- "p": 1,
1830
- "rt": 1,
1831
- "rp": 1,
1832
- "optgroup": 1,
1833
- "option": 1,
1834
- "colgroup": 1,
1835
- "td": 1,
1836
- "th": 1
1837
- }), {
1838
- "js-": new CStyleFoldMode(),
1839
- "css-": new CStyleFoldMode()
1840
- });
1841
1683
  };
1842
1684
 
1843
- oop.inherits(FoldMode, MixedFoldMode);
1685
+ oop.inherits(XmlBehaviour, Behaviour);
1844
1686
 
1687
+ exports.XmlBehaviour = XmlBehaviour;
1845
1688
  });
1846
1689
 
1847
- define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
1848
-
1690
+ define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module) {
1691
+ "use strict";
1849
1692
 
1850
1693
  var oop = require("../../lib/oop");
1851
1694
  var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1898,8 +1741,8 @@ oop.inherits(FoldMode, BaseFoldMode);
1898
1741
 
1899
1742
  });
1900
1743
 
1901
- 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) {
1902
-
1744
+ define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/range","ace/mode/folding/fold_mode","ace/token_iterator"], function(require, exports, module) {
1745
+ "use strict";
1903
1746
 
1904
1747
  var oop = require("../../lib/oop");
1905
1748
  var lang = require("../../lib/lang");
@@ -1907,91 +1750,118 @@ var Range = require("../../range").Range;
1907
1750
  var BaseFoldMode = require("./fold_mode").FoldMode;
1908
1751
  var TokenIterator = require("../../token_iterator").TokenIterator;
1909
1752
 
1910
- var FoldMode = exports.FoldMode = function(voidElements) {
1753
+ var FoldMode = exports.FoldMode = function(voidElements, optionalEndTags) {
1911
1754
  BaseFoldMode.call(this);
1912
1755
  this.voidElements = voidElements || {};
1756
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
1757
+ if (optionalEndTags)
1758
+ oop.mixin(this.optionalEndTags, optionalEndTags);
1759
+
1913
1760
  };
1914
1761
  oop.inherits(FoldMode, BaseFoldMode);
1915
1762
 
1763
+ var Tag = function() {
1764
+ this.tagName = "";
1765
+ this.closing = false;
1766
+ this.selfClosing = false;
1767
+ this.start = {row: 0, column: 0};
1768
+ this.end = {row: 0, column: 0};
1769
+ };
1770
+
1771
+ function is(token, type) {
1772
+ return token.type.lastIndexOf(type + ".xml") > -1;
1773
+ }
1774
+
1916
1775
  (function() {
1917
1776
 
1918
1777
  this.getFoldWidget = function(session, foldStyle, row) {
1919
1778
  var tag = this._getFirstTagInLine(session, row);
1920
1779
 
1921
- if (tag.closing)
1922
- return foldStyle == "markbeginend" ? "end" : "";
1923
-
1924
- if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()])
1780
+ if (!tag)
1925
1781
  return "";
1926
1782
 
1927
- if (tag.selfClosing)
1783
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
1784
+ return foldStyle == "markbeginend" ? "end" : "";
1785
+
1786
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
1928
1787
  return "";
1929
1788
 
1930
- if (tag.value.indexOf("/" + tag.tagName) !== -1)
1789
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
1931
1790
  return "";
1932
1791
 
1933
1792
  return "start";
1934
1793
  };
1935
-
1936
1794
  this._getFirstTagInLine = function(session, row) {
1937
1795
  var tokens = session.getTokens(row);
1938
- var value = "";
1796
+ var tag = new Tag();
1797
+
1939
1798
  for (var i = 0; i < tokens.length; i++) {
1940
1799
  var token = tokens[i];
1941
- if (token.type.lastIndexOf("meta.tag", 0) === 0)
1942
- value += token.value;
1943
- else
1944
- value += lang.stringRepeat(" ", token.value.length);
1800
+ if (is(token, "tag-open")) {
1801
+ tag.end.column = tag.start.column + token.value.length;
1802
+ tag.closing = is(token, "end-tag-open");
1803
+ token = tokens[++i];
1804
+ if (!token)
1805
+ return null;
1806
+ tag.tagName = token.value;
1807
+ tag.end.column += token.value.length;
1808
+ for (i++; i < tokens.length; i++) {
1809
+ token = tokens[i];
1810
+ tag.end.column += token.value.length;
1811
+ if (is(token, "tag-close")) {
1812
+ tag.selfClosing = token.value == '/>';
1813
+ break;
1814
+ }
1815
+ }
1816
+ return tag;
1817
+ } else if (is(token, "tag-close")) {
1818
+ tag.selfClosing = token.value == '/>';
1819
+ return tag;
1820
+ }
1821
+ tag.start.column += token.value.length;
1945
1822
  }
1946
-
1947
- return this._parseTag(value);
1823
+
1824
+ return null;
1948
1825
  };
1949
1826
 
1950
- this.tagRe = /^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;
1951
- this._parseTag = function(tag) {
1952
-
1953
- var match = tag.match(this.tagRe);
1827
+ this._findEndTagInLine = function(session, row, tagName, startColumn) {
1828
+ var tokens = session.getTokens(row);
1954
1829
  var column = 0;
1955
-
1956
- return {
1957
- value: tag,
1958
- match: match ? match[2] : "",
1959
- closing: match ? !!match[3] : false,
1960
- selfClosing: match ? !!match[5] || match[2] == "/>" : false,
1961
- tagName: match ? match[4] : "",
1962
- column: match[1] ? column + match[1].length : column
1963
- };
1830
+ for (var i = 0; i < tokens.length; i++) {
1831
+ var token = tokens[i];
1832
+ column += token.value.length;
1833
+ if (column < startColumn)
1834
+ continue;
1835
+ if (is(token, "end-tag-open")) {
1836
+ token = tokens[i + 1];
1837
+ if (token && token.value == tagName)
1838
+ return true;
1839
+ }
1840
+ }
1841
+ return false;
1964
1842
  };
1965
1843
  this._readTagForward = function(iterator) {
1966
1844
  var token = iterator.getCurrentToken();
1967
1845
  if (!token)
1968
1846
  return null;
1969
-
1970
- var value = "";
1971
- var start;
1972
-
1847
+
1848
+ var tag = new Tag();
1973
1849
  do {
1974
- if (token.type.lastIndexOf("meta.tag", 0) === 0) {
1975
- if (!start) {
1976
- var start = {
1977
- row: iterator.getCurrentTokenRow(),
1978
- column: iterator.getCurrentTokenColumn()
1979
- };
1980
- }
1981
- value += token.value;
1982
- if (value.indexOf(">") !== -1) {
1983
- var tag = this._parseTag(value);
1984
- tag.start = start;
1985
- tag.end = {
1986
- row: iterator.getCurrentTokenRow(),
1987
- column: iterator.getCurrentTokenColumn() + token.value.length
1988
- };
1989
- iterator.stepForward();
1990
- return tag;
1991
- }
1850
+ if (is(token, "tag-open")) {
1851
+ tag.closing = is(token, "end-tag-open");
1852
+ tag.start.row = iterator.getCurrentTokenRow();
1853
+ tag.start.column = iterator.getCurrentTokenColumn();
1854
+ } else if (is(token, "tag-name")) {
1855
+ tag.tagName = token.value;
1856
+ } else if (is(token, "tag-close")) {
1857
+ tag.selfClosing = token.value == "/>";
1858
+ tag.end.row = iterator.getCurrentTokenRow();
1859
+ tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
1860
+ iterator.stepForward();
1861
+ return tag;
1992
1862
  }
1993
1863
  } while(token = iterator.stepForward());
1994
-
1864
+
1995
1865
  return null;
1996
1866
  };
1997
1867
 
@@ -1999,32 +1869,24 @@ oop.inherits(FoldMode, BaseFoldMode);
1999
1869
  var token = iterator.getCurrentToken();
2000
1870
  if (!token)
2001
1871
  return null;
2002
-
2003
- var value = "";
2004
- var end;
2005
1872
 
1873
+ var tag = new Tag();
2006
1874
  do {
2007
- if (token.type.lastIndexOf("meta.tag", 0) === 0) {
2008
- if (!end) {
2009
- end = {
2010
- row: iterator.getCurrentTokenRow(),
2011
- column: iterator.getCurrentTokenColumn() + token.value.length
2012
- };
2013
- }
2014
- value = token.value + value;
2015
- if (value.indexOf("<") !== -1) {
2016
- var tag = this._parseTag(value);
2017
- tag.end = end;
2018
- tag.start = {
2019
- row: iterator.getCurrentTokenRow(),
2020
- column: iterator.getCurrentTokenColumn()
2021
- };
2022
- iterator.stepBackward();
2023
- return tag;
2024
- }
1875
+ if (is(token, "tag-open")) {
1876
+ tag.closing = is(token, "end-tag-open");
1877
+ tag.start.row = iterator.getCurrentTokenRow();
1878
+ tag.start.column = iterator.getCurrentTokenColumn();
1879
+ iterator.stepBackward();
1880
+ return tag;
1881
+ } else if (is(token, "tag-name")) {
1882
+ tag.tagName = token.value;
1883
+ } else if (is(token, "tag-close")) {
1884
+ tag.selfClosing = token.value == "/>";
1885
+ tag.end.row = iterator.getCurrentTokenRow();
1886
+ tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
2025
1887
  }
2026
1888
  } while(token = iterator.stepBackward());
2027
-
1889
+
2028
1890
  return null;
2029
1891
  };
2030
1892
 
@@ -2035,10 +1897,10 @@ oop.inherits(FoldMode, BaseFoldMode);
2035
1897
  if (!tag || top.tagName == tag.tagName) {
2036
1898
  return stack.pop();
2037
1899
  }
2038
- else if (this.voidElements[tag.tagName]) {
1900
+ else if (this.optionalEndTags.hasOwnProperty(tag.tagName)) {
2039
1901
  return;
2040
1902
  }
2041
- else if (this.voidElements[top.tagName]) {
1903
+ else if (this.optionalEndTags.hasOwnProperty(top.tagName)) {
2042
1904
  stack.pop();
2043
1905
  continue;
2044
1906
  } else {
@@ -2050,7 +1912,7 @@ oop.inherits(FoldMode, BaseFoldMode);
2050
1912
  this.getFoldWidgetRange = function(session, foldStyle, row) {
2051
1913
  var firstTag = this._getFirstTagInLine(session, row);
2052
1914
 
2053
- if (!firstTag.match)
1915
+ if (!firstTag)
2054
1916
  return null;
2055
1917
 
2056
1918
  var isBackward = firstTag.closing || firstTag.selfClosing;
@@ -2058,10 +1920,10 @@ oop.inherits(FoldMode, BaseFoldMode);
2058
1920
  var tag;
2059
1921
 
2060
1922
  if (!isBackward) {
2061
- var iterator = new TokenIterator(session, row, firstTag.column);
1923
+ var iterator = new TokenIterator(session, row, firstTag.start.column);
2062
1924
  var start = {
2063
1925
  row: row,
2064
- column: firstTag.column + firstTag.tagName.length + 2
1926
+ column: firstTag.start.column + firstTag.tagName.length + 2
2065
1927
  };
2066
1928
  while (tag = this._readTagForward(iterator)) {
2067
1929
  if (tag.selfClosing) {
@@ -2079,15 +1941,15 @@ oop.inherits(FoldMode, BaseFoldMode);
2079
1941
  return Range.fromPoints(start, tag.start);
2080
1942
  }
2081
1943
  else {
2082
- stack.push(tag)
1944
+ stack.push(tag);
2083
1945
  }
2084
1946
  }
2085
1947
  }
2086
1948
  else {
2087
- var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
1949
+ var iterator = new TokenIterator(session, row, firstTag.end.column);
2088
1950
  var end = {
2089
1951
  row: row,
2090
- column: firstTag.column
1952
+ column: firstTag.start.column
2091
1953
  };
2092
1954
 
2093
1955
  while (tag = this._readTagBackward(iterator)) {
@@ -2108,7 +1970,7 @@ oop.inherits(FoldMode, BaseFoldMode);
2108
1970
  }
2109
1971
  }
2110
1972
  else {
2111
- stack.push(tag)
1973
+ stack.push(tag);
2112
1974
  }
2113
1975
  }
2114
1976
  }
@@ -2119,8 +1981,27 @@ oop.inherits(FoldMode, BaseFoldMode);
2119
1981
 
2120
1982
  });
2121
1983
 
2122
- define('ace/mode/html_completions', ['require', 'exports', 'module' , 'ace/token_iterator'], function(require, exports, module) {
1984
+ define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) {
1985
+ "use strict";
1986
+
1987
+ var oop = require("../../lib/oop");
1988
+ var MixedFoldMode = require("./mixed").FoldMode;
1989
+ var XmlFoldMode = require("./xml").FoldMode;
1990
+ var CStyleFoldMode = require("./cstyle").FoldMode;
1991
+
1992
+ var FoldMode = exports.FoldMode = function(voidElements, optionalTags) {
1993
+ MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
1994
+ "js-": new CStyleFoldMode(),
1995
+ "css-": new CStyleFoldMode()
1996
+ });
1997
+ };
2123
1998
 
1999
+ oop.inherits(FoldMode, MixedFoldMode);
2000
+
2001
+ });
2002
+
2003
+ define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) {
2004
+ "use strict";
2124
2005
 
2125
2006
  var TokenIterator = require("../token_iterator").TokenIterator;
2126
2007
 
@@ -2134,6 +2015,12 @@ var commonAttributes = [
2134
2015
  "dropzone",
2135
2016
  "hidden",
2136
2017
  "id",
2018
+ "inert",
2019
+ "itemid",
2020
+ "itemprop",
2021
+ "itemref",
2022
+ "itemscope",
2023
+ "itemtype",
2137
2024
  "lang",
2138
2025
  "spellcheck",
2139
2026
  "style",
@@ -2317,24 +2204,19 @@ var attributeMap = {
2317
2204
  "dialog": ["open"]
2318
2205
  };
2319
2206
 
2320
- var allElements = Object.keys(attributeMap);
2207
+ var elements = Object.keys(attributeMap);
2321
2208
 
2322
- function hasType(token, type) {
2323
- var tokenTypes = token.type.split('.');
2324
- return type.split('.').every(function(type){
2325
- return (tokenTypes.indexOf(type) !== -1);
2326
- });
2209
+ function is(token, type) {
2210
+ return token.type.lastIndexOf(type + ".xml") > -1;
2327
2211
  }
2328
2212
 
2329
2213
  function findTagName(session, pos) {
2330
2214
  var iterator = new TokenIterator(session, pos.row, pos.column);
2331
2215
  var token = iterator.getCurrentToken();
2332
- if (!token || !hasType(token, 'tag') && !(hasType(token, 'text') && token.value.match('/'))){
2333
- do {
2334
- token = iterator.stepBackward();
2335
- } while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text')));
2216
+ while (token && !is(token, "tag-name")){
2217
+ token = iterator.stepBackward();
2336
2218
  }
2337
- if (token && hasType(token, 'tag-name') && !iterator.stepBackward().value.match('/'))
2219
+ if (token)
2338
2220
  return token.value;
2339
2221
  }
2340
2222
 
@@ -2349,25 +2231,20 @@ var HtmlCompletions = function() {
2349
2231
 
2350
2232
  if (!token)
2351
2233
  return [];
2352
- if (hasType(token, "tag-name") || (token.value == '<' && hasType(token, "text")))
2234
+ if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
2353
2235
  return this.getTagCompletions(state, session, pos, prefix);
2354
- if (hasType(token, 'text') || hasType(token, 'attribute-name'))
2236
+ if (is(token, "tag-whitespace") || is(token, "attribute-name"))
2355
2237
  return this.getAttributeCompetions(state, session, pos, prefix);
2356
2238
 
2357
2239
  return [];
2358
2240
  };
2359
2241
 
2360
2242
  this.getTagCompletions = function(state, session, pos, prefix) {
2361
- var elements = allElements;
2362
- if (prefix) {
2363
- elements = elements.filter(function(element){
2364
- return element.indexOf(prefix) === 0;
2365
- });
2366
- }
2367
2243
  return elements.map(function(element){
2368
2244
  return {
2369
2245
  value: element,
2370
- meta: "tag"
2246
+ meta: "tag",
2247
+ score: Number.MAX_VALUE
2371
2248
  };
2372
2249
  });
2373
2250
  };
@@ -2380,16 +2257,12 @@ var HtmlCompletions = function() {
2380
2257
  if (tagName in attributeMap) {
2381
2258
  attributes = attributes.concat(attributeMap[tagName]);
2382
2259
  }
2383
- if (prefix) {
2384
- attributes = attributes.filter(function(attribute){
2385
- return attribute.indexOf(prefix) === 0;
2386
- });
2387
- }
2388
2260
  return attributes.map(function(attribute){
2389
2261
  return {
2390
2262
  caption: attribute,
2391
2263
  snippet: attribute + '="$0"',
2392
- meta: "attribute"
2264
+ meta: "attribute",
2265
+ score: Number.MAX_VALUE
2393
2266
  };
2394
2267
  });
2395
2268
  };
@@ -2398,36 +2271,163 @@ var HtmlCompletions = function() {
2398
2271
 
2399
2272
  exports.HtmlCompletions = HtmlCompletions;
2400
2273
  });
2401
- define('ace/mode/rhtml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/r_highlight_rules', 'ace/mode/html_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
2402
2274
 
2275
+ define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) {
2276
+ "use strict";
2403
2277
 
2404
2278
  var oop = require("../lib/oop");
2405
- var RHighlightRules = require("./r_highlight_rules").RHighlightRules;
2279
+ var lang = require("../lib/lang");
2280
+ var TextMode = require("./text").Mode;
2281
+ var JavaScriptMode = require("./javascript").Mode;
2282
+ var CssMode = require("./css").Mode;
2406
2283
  var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
2407
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
2408
-
2409
- var RHtmlHighlightRules = function() {
2410
- HtmlHighlightRules.call(this);
2284
+ var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
2285
+ var HtmlFoldMode = require("./folding/html").FoldMode;
2286
+ var HtmlCompletions = require("./html_completions").HtmlCompletions;
2287
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
2288
+ var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
2289
+ var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
2411
2290
 
2412
- this.$rules["start"].unshift({
2413
- token: "support.function.codebegin",
2414
- regex: "^<" + "!--\\s*begin.rcode\\s*(?:.*)",
2415
- next: "r-start"
2291
+ var Mode = function(options) {
2292
+ this.fragmentContext = options && options.fragmentContext;
2293
+ this.HighlightRules = HtmlHighlightRules;
2294
+ this.$behaviour = new XmlBehaviour();
2295
+ this.$completer = new HtmlCompletions();
2296
+
2297
+ this.createModeDelegates({
2298
+ "js-": JavaScriptMode,
2299
+ "css-": CssMode
2416
2300
  });
2301
+
2302
+ this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
2303
+ };
2304
+ oop.inherits(Mode, TextMode);
2417
2305
 
2418
- this.embedRules(RHighlightRules, "r-", [{
2419
- token: "support.function.codeend",
2420
- regex: "^\\s*end.rcode\\s*-->",
2421
- next: "start"
2422
- }], ["start"]);
2306
+ (function() {
2423
2307
 
2424
- this.normalizeRules();
2308
+ this.blockComment = {start: "<!--", end: "-->"};
2309
+
2310
+ this.voidElements = lang.arrayToMap(voidElements);
2311
+
2312
+ this.getNextLineIndent = function(state, line, tab) {
2313
+ return this.$getIndent(line);
2314
+ };
2315
+
2316
+ this.checkOutdent = function(state, line, input) {
2317
+ return false;
2318
+ };
2319
+
2320
+ this.getCompletions = function(state, session, pos, prefix) {
2321
+ return this.$completer.getCompletions(state, session, pos, prefix);
2322
+ };
2323
+
2324
+ this.createWorker = function(session) {
2325
+ if (this.constructor != Mode)
2326
+ return;
2327
+ var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
2328
+ worker.attachToDocument(session.getDocument());
2329
+
2330
+ if (this.fragmentContext)
2331
+ worker.call("setOptions", [{context: this.fragmentContext}]);
2332
+
2333
+ worker.on("error", function(e) {
2334
+ session.setAnnotations(e.data);
2335
+ });
2336
+
2337
+ worker.on("terminate", function() {
2338
+ session.clearAnnotations();
2339
+ });
2340
+
2341
+ return worker;
2342
+ };
2343
+
2344
+ this.$id = "ace/mode/html";
2345
+ }).call(Mode.prototype);
2346
+
2347
+ exports.Mode = Mode;
2348
+ });
2349
+
2350
+ define("ace/mode/tex_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
2351
+ "use strict";
2352
+
2353
+ var oop = require("../lib/oop");
2354
+ var lang = require("../lib/lang");
2355
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
2356
+
2357
+ var TexHighlightRules = function(textClass) {
2358
+
2359
+ if (!textClass)
2360
+ textClass = "text";
2361
+
2362
+ this.$rules = {
2363
+ "start" : [
2364
+ {
2365
+ token : "comment",
2366
+ regex : "%.*$"
2367
+ }, {
2368
+ token : textClass, // non-command
2369
+ regex : "\\\\[$&%#\\{\\}]"
2370
+ }, {
2371
+ token : "keyword", // command
2372
+ regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",
2373
+ next : "nospell"
2374
+ }, {
2375
+ token : "keyword", // command
2376
+ regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])"
2377
+ }, {
2378
+ token : "paren.keyword.operator",
2379
+ regex : "[[({]"
2380
+ }, {
2381
+ token : "paren.keyword.operator",
2382
+ regex : "[\\])}]"
2383
+ }, {
2384
+ token : textClass,
2385
+ regex : "\\s+"
2386
+ }
2387
+ ],
2388
+ "nospell" : [
2389
+ {
2390
+ token : "comment",
2391
+ regex : "%.*$",
2392
+ next : "start"
2393
+ }, {
2394
+ token : "nospell." + textClass, // non-command
2395
+ regex : "\\\\[$&%#\\{\\}]"
2396
+ }, {
2397
+ token : "keyword", // command
2398
+ regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"
2399
+ }, {
2400
+ token : "keyword", // command
2401
+ regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])",
2402
+ next : "start"
2403
+ }, {
2404
+ token : "paren.keyword.operator",
2405
+ regex : "[[({]"
2406
+ }, {
2407
+ token : "paren.keyword.operator",
2408
+ regex : "[\\])]"
2409
+ }, {
2410
+ token : "paren.keyword.operator",
2411
+ regex : "}",
2412
+ next : "start"
2413
+ }, {
2414
+ token : "nospell." + textClass,
2415
+ regex : "\\s+"
2416
+ }, {
2417
+ token : "nospell." + textClass,
2418
+ regex : "\\w+"
2419
+ }
2420
+ ]
2421
+ };
2425
2422
  };
2426
- oop.inherits(RHtmlHighlightRules, TextHighlightRules);
2427
2423
 
2428
- exports.RHtmlHighlightRules = RHtmlHighlightRules;
2424
+ oop.inherits(TexHighlightRules, TextHighlightRules);
2425
+
2426
+ exports.TexHighlightRules = TexHighlightRules;
2429
2427
  });
2430
- define('ace/mode/r_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules', 'ace/mode/tex_highlight_rules'], function(require, exports, module) {
2428
+
2429
+ define("ace/mode/r_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/tex_highlight_rules"], function(require, exports, module)
2430
+ {
2431
2431
 
2432
2432
  var oop = require("../lib/oop");
2433
2433
  var lang = require("../lib/lang");
@@ -2583,81 +2583,65 @@ define('ace/mode/r_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/
2583
2583
 
2584
2584
  exports.RHighlightRules = RHighlightRules;
2585
2585
  });
2586
- define('ace/mode/tex_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
2587
2586
 
2587
+ define("ace/mode/rhtml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/r_highlight_rules","ace/mode/html_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
2588
+ "use strict";
2588
2589
 
2589
2590
  var oop = require("../lib/oop");
2590
- var lang = require("../lib/lang");
2591
+ var RHighlightRules = require("./r_highlight_rules").RHighlightRules;
2592
+ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
2591
2593
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
2592
2594
 
2593
- var TexHighlightRules = function(textClass) {
2595
+ var RHtmlHighlightRules = function() {
2596
+ HtmlHighlightRules.call(this);
2594
2597
 
2595
- if (!textClass)
2596
- textClass = "text";
2598
+ this.$rules["start"].unshift({
2599
+ token: "support.function.codebegin",
2600
+ regex: "^<" + "!--\\s*begin.rcode\\s*(?:.*)",
2601
+ next: "r-start"
2602
+ });
2597
2603
 
2598
- this.$rules = {
2599
- "start" : [
2600
- {
2601
- token : "comment",
2602
- regex : "%.*$"
2603
- }, {
2604
- token : textClass, // non-command
2605
- regex : "\\\\[$&%#\\{\\}]"
2606
- }, {
2607
- token : "keyword", // command
2608
- regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",
2609
- next : "nospell"
2610
- }, {
2611
- token : "keyword", // command
2612
- regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])"
2613
- }, {
2614
- token : "paren.keyword.operator",
2615
- regex : "[[({]"
2616
- }, {
2617
- token : "paren.keyword.operator",
2618
- regex : "[\\])}]"
2619
- }, {
2620
- token : textClass,
2621
- regex : "\\s+"
2622
- }
2623
- ],
2624
- "nospell" : [
2625
- {
2626
- token : "comment",
2627
- regex : "%.*$",
2628
- next : "start"
2629
- }, {
2630
- token : "nospell." + textClass, // non-command
2631
- regex : "\\\\[$&%#\\{\\}]"
2632
- }, {
2633
- token : "keyword", // command
2634
- regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"
2635
- }, {
2636
- token : "keyword", // command
2637
- regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])",
2638
- next : "start"
2639
- }, {
2640
- token : "paren.keyword.operator",
2641
- regex : "[[({]"
2642
- }, {
2643
- token : "paren.keyword.operator",
2644
- regex : "[\\])]"
2645
- }, {
2646
- token : "paren.keyword.operator",
2647
- regex : "}",
2648
- next : "start"
2649
- }, {
2650
- token : "nospell." + textClass,
2651
- regex : "\\s+"
2652
- }, {
2653
- token : "nospell." + textClass,
2654
- regex : "\\w+"
2655
- }
2656
- ]
2657
- };
2604
+ this.embedRules(RHighlightRules, "r-", [{
2605
+ token: "support.function.codeend",
2606
+ regex: "^\\s*end.rcode\\s*-->",
2607
+ next: "start"
2608
+ }], ["start"]);
2609
+
2610
+ this.normalizeRules();
2658
2611
  };
2612
+ oop.inherits(RHtmlHighlightRules, TextHighlightRules);
2659
2613
 
2660
- oop.inherits(TexHighlightRules, TextHighlightRules);
2614
+ exports.RHtmlHighlightRules = RHtmlHighlightRules;
2615
+ });
2661
2616
 
2662
- exports.TexHighlightRules = TexHighlightRules;
2617
+ define("ace/mode/rhtml",["require","exports","module","ace/lib/oop","ace/mode/html","ace/mode/rhtml_highlight_rules"], function(require, exports, module) {
2618
+ "use strict";
2619
+
2620
+ var oop = require("../lib/oop");
2621
+ var HtmlMode = require("./html").Mode;
2622
+
2623
+ var RHtmlHighlightRules = require("./rhtml_highlight_rules").RHtmlHighlightRules;
2624
+
2625
+ var Mode = function(doc, session) {
2626
+ HtmlMode.call(this);
2627
+ this.$session = session;
2628
+ this.HighlightRules = RHtmlHighlightRules;
2629
+ };
2630
+ oop.inherits(Mode, HtmlMode);
2631
+
2632
+ (function() {
2633
+ this.insertChunkInfo = {
2634
+ value: "<!--begin.rcode\n\nend.rcode-->\n",
2635
+ position: {row: 0, column: 15}
2636
+ };
2637
+
2638
+ this.getLanguageMode = function(position)
2639
+ {
2640
+ return this.$session.getState(position.row).match(/^r-/) ? 'R' : 'HTML';
2641
+ };
2642
+
2643
+ this.$id = "ace/mode/rhtml";
2644
+ }).call(Mode.prototype);
2645
+
2646
+ exports.Mode = Mode;
2663
2647
  });