ace-rails-ap 0.0.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. data/lib/ace/rails/version.rb +1 -1
  2. data/vendor/assets/javascripts/ace.js +15680 -1
  3. data/vendor/assets/javascripts/keybinding-emacs.js +367 -1
  4. data/vendor/assets/javascripts/keybinding-vim.js +1635 -1
  5. data/vendor/assets/javascripts/mode-c9search.js +275 -0
  6. data/vendor/assets/javascripts/mode-c_cpp.js +744 -1
  7. data/vendor/assets/javascripts/mode-clojure.js +364 -1
  8. data/vendor/assets/javascripts/mode-coffee.js +527 -1
  9. data/vendor/assets/javascripts/mode-coldfusion.js +1966 -1
  10. data/vendor/assets/javascripts/mode-csharp.js +633 -1
  11. data/vendor/assets/javascripts/mode-css.js +499 -1
  12. data/vendor/assets/javascripts/mode-diff.js +250 -0
  13. data/vendor/assets/javascripts/{mode-c_cpp-uncompressed.js → mode-glsl.js} +147 -244
  14. data/vendor/assets/javascripts/mode-golang.js +681 -1
  15. data/vendor/assets/javascripts/mode-groovy.js +1240 -1
  16. data/vendor/assets/javascripts/mode-haxe.js +633 -1
  17. data/vendor/assets/javascripts/mode-html.js +2064 -1
  18. data/vendor/assets/javascripts/mode-java.js +1202 -1
  19. data/vendor/assets/javascripts/mode-javascript.js +1069 -1
  20. data/vendor/assets/javascripts/mode-json.js +588 -1
  21. data/vendor/assets/javascripts/{mode-haxe-uncompressed.js → mode-jsx.js} +189 -312
  22. data/vendor/assets/javascripts/mode-latex.js +95 -1
  23. data/vendor/assets/javascripts/mode-less.js +512 -1
  24. data/vendor/assets/javascripts/mode-liquid.js +1125 -1
  25. data/vendor/assets/javascripts/mode-lua.js +551 -1
  26. data/vendor/assets/javascripts/{mode-html-uncompressed.js → mode-luahtml.js} +544 -604
  27. data/vendor/assets/javascripts/{mode-coldfusion-uncompressed.js → mode-luapage.js} +2326 -2180
  28. data/vendor/assets/javascripts/mode-markdown.js +2369 -1
  29. data/vendor/assets/javascripts/mode-ocaml.js +464 -1
  30. data/vendor/assets/javascripts/mode-perl.js +432 -1
  31. data/vendor/assets/javascripts/mode-pgsql.js +970 -1
  32. data/vendor/assets/javascripts/mode-php.js +1718 -1
  33. data/vendor/assets/javascripts/mode-powershell.js +610 -1
  34. data/vendor/assets/javascripts/mode-python.js +397 -1
  35. data/vendor/assets/javascripts/mode-ruby.js +318 -1
  36. data/vendor/assets/javascripts/mode-scad.js +732 -1
  37. data/vendor/assets/javascripts/mode-scala.js +1237 -1
  38. data/vendor/assets/javascripts/mode-scss.js +537 -1
  39. data/vendor/assets/javascripts/mode-sh.js +250 -1
  40. data/vendor/assets/javascripts/mode-sql.js +140 -1
  41. data/vendor/assets/javascripts/mode-svg.js +1681 -1
  42. data/vendor/assets/javascripts/mode-tcl.js +320 -0
  43. data/vendor/assets/javascripts/mode-textile.js +182 -1
  44. data/vendor/assets/javascripts/mode-xml.js +829 -1
  45. data/vendor/assets/javascripts/mode-xquery.js +605 -1
  46. data/vendor/assets/javascripts/mode-yaml.js +189 -0
  47. data/vendor/assets/javascripts/theme-chrome.js +213 -1
  48. data/vendor/assets/javascripts/theme-clouds.js +167 -1
  49. data/vendor/assets/javascripts/theme-clouds_midnight.js +168 -1
  50. data/vendor/assets/javascripts/theme-cobalt.js +194 -1
  51. data/vendor/assets/javascripts/theme-crimson_editor.js +200 -1
  52. data/vendor/assets/javascripts/theme-dawn.js +198 -1
  53. data/vendor/assets/javascripts/theme-dreamweaver.js +230 -1
  54. data/vendor/assets/javascripts/theme-eclipse.js +157 -1
  55. data/vendor/assets/javascripts/theme-github.js +182 -0
  56. data/vendor/assets/javascripts/theme-idle_fingers.js +186 -1
  57. data/vendor/assets/javascripts/theme-kr_theme.js +189 -1
  58. data/vendor/assets/javascripts/theme-merbivore.js +189 -1
  59. data/vendor/assets/javascripts/theme-merbivore_soft.js +195 -1
  60. data/vendor/assets/javascripts/theme-mono_industrial.js +197 -1
  61. data/vendor/assets/javascripts/theme-monokai.js +194 -1
  62. data/vendor/assets/javascripts/theme-pastel_on_dark.js +199 -1
  63. data/vendor/assets/javascripts/theme-solarized_dark.js +180 -1
  64. data/vendor/assets/javascripts/theme-solarized_light.js +179 -1
  65. data/vendor/assets/javascripts/theme-textmate.js +216 -0
  66. data/vendor/assets/javascripts/theme-tomorrow.js +213 -1
  67. data/vendor/assets/javascripts/theme-tomorrow_night.js +213 -1
  68. data/vendor/assets/javascripts/theme-tomorrow_night_blue.js +213 -1
  69. data/vendor/assets/javascripts/theme-tomorrow_night_bright.js +213 -1
  70. data/vendor/assets/javascripts/theme-tomorrow_night_eighties.js +209 -1
  71. data/vendor/assets/javascripts/theme-twilight.js +211 -1
  72. data/vendor/assets/javascripts/theme-vibrant_ink.js +190 -1
  73. data/vendor/assets/javascripts/worker-coffee.js +83 -893
  74. data/vendor/assets/javascripts/worker-css.js +88 -1402
  75. data/vendor/assets/javascripts/worker-javascript.js +97 -812
  76. data/vendor/assets/javascripts/worker-json.js +84 -761
  77. data/vendor/assets/javascripts/worker-xquery.js +66464 -0
  78. metadata +12 -195
  79. data/vendor/assets/javascripts/ace-compat-noconflict.js +0 -1
  80. data/vendor/assets/javascripts/ace-compat-uncompressed-noconflict.js +0 -480
  81. data/vendor/assets/javascripts/ace-compat-uncompressed.js +0 -480
  82. data/vendor/assets/javascripts/ace-compat.js +0 -1
  83. data/vendor/assets/javascripts/ace-noconflict.js +0 -10
  84. data/vendor/assets/javascripts/ace-uncompressed-noconflict.js +0 -19976
  85. data/vendor/assets/javascripts/ace-uncompressed.js +0 -19976
  86. data/vendor/assets/javascripts/keybinding-emacs-noconflict.js +0 -1
  87. data/vendor/assets/javascripts/keybinding-emacs-uncompressed-noconflict.js +0 -150
  88. data/vendor/assets/javascripts/keybinding-emacs-uncompressed.js +0 -150
  89. data/vendor/assets/javascripts/keybinding-vim-noconflict.js +0 -1
  90. data/vendor/assets/javascripts/keybinding-vim-uncompressed-noconflict.js +0 -138
  91. data/vendor/assets/javascripts/keybinding-vim-uncompressed.js +0 -138
  92. data/vendor/assets/javascripts/mode-c_cpp-noconflict.js +0 -1
  93. data/vendor/assets/javascripts/mode-c_cpp-uncompressed-noconflict.js +0 -919
  94. data/vendor/assets/javascripts/mode-clojure-noconflict.js +0 -1
  95. data/vendor/assets/javascripts/mode-clojure-uncompressed-noconflict.js +0 -422
  96. data/vendor/assets/javascripts/mode-clojure-uncompressed.js +0 -422
  97. data/vendor/assets/javascripts/mode-coffee-noconflict.js +0 -1
  98. data/vendor/assets/javascripts/mode-coffee-uncompressed-noconflict.js +0 -607
  99. data/vendor/assets/javascripts/mode-coffee-uncompressed.js +0 -607
  100. data/vendor/assets/javascripts/mode-coldfusion-noconflict.js +0 -1
  101. data/vendor/assets/javascripts/mode-coldfusion-uncompressed-noconflict.js +0 -2458
  102. data/vendor/assets/javascripts/mode-csharp-noconflict.js +0 -1
  103. data/vendor/assets/javascripts/mode-csharp-uncompressed-noconflict.js +0 -769
  104. data/vendor/assets/javascripts/mode-csharp-uncompressed.js +0 -769
  105. data/vendor/assets/javascripts/mode-css-noconflict.js +0 -1
  106. data/vendor/assets/javascripts/mode-css-uncompressed-noconflict.js +0 -641
  107. data/vendor/assets/javascripts/mode-css-uncompressed.js +0 -641
  108. data/vendor/assets/javascripts/mode-golang-noconflict.js +0 -1
  109. data/vendor/assets/javascripts/mode-golang-uncompressed-noconflict.js +0 -378
  110. data/vendor/assets/javascripts/mode-golang-uncompressed.js +0 -378
  111. data/vendor/assets/javascripts/mode-groovy-noconflict.js +0 -1
  112. data/vendor/assets/javascripts/mode-groovy-uncompressed-noconflict.js +0 -1393
  113. data/vendor/assets/javascripts/mode-groovy-uncompressed.js +0 -1393
  114. data/vendor/assets/javascripts/mode-haxe-noconflict.js +0 -1
  115. data/vendor/assets/javascripts/mode-haxe-uncompressed-noconflict.js +0 -769
  116. data/vendor/assets/javascripts/mode-html-noconflict.js +0 -1
  117. data/vendor/assets/javascripts/mode-html-uncompressed-noconflict.js +0 -2475
  118. data/vendor/assets/javascripts/mode-java-noconflict.js +0 -1
  119. data/vendor/assets/javascripts/mode-java-uncompressed-noconflict.js +0 -1395
  120. data/vendor/assets/javascripts/mode-java-uncompressed.js +0 -1395
  121. data/vendor/assets/javascripts/mode-javascript-noconflict.js +0 -1
  122. data/vendor/assets/javascripts/mode-javascript-uncompressed-noconflict.js +0 -1226
  123. data/vendor/assets/javascripts/mode-javascript-uncompressed.js +0 -1226
  124. data/vendor/assets/javascripts/mode-json-noconflict.js +0 -1
  125. data/vendor/assets/javascripts/mode-json-uncompressed-noconflict.js +0 -701
  126. data/vendor/assets/javascripts/mode-json-uncompressed.js +0 -701
  127. data/vendor/assets/javascripts/mode-latex-noconflict.js +0 -1
  128. data/vendor/assets/javascripts/mode-latex-uncompressed-noconflict.js +0 -95
  129. data/vendor/assets/javascripts/mode-latex-uncompressed.js +0 -95
  130. data/vendor/assets/javascripts/mode-less-noconflict.js +0 -1
  131. data/vendor/assets/javascripts/mode-less-uncompressed-noconflict.js +0 -655
  132. data/vendor/assets/javascripts/mode-less-uncompressed.js +0 -655
  133. data/vendor/assets/javascripts/mode-liquid-noconflict.js +0 -1
  134. data/vendor/assets/javascripts/mode-liquid-uncompressed-noconflict.js +0 -1353
  135. data/vendor/assets/javascripts/mode-liquid-uncompressed.js +0 -1353
  136. data/vendor/assets/javascripts/mode-lua-noconflict.js +0 -1
  137. data/vendor/assets/javascripts/mode-lua-uncompressed-noconflict.js +0 -523
  138. data/vendor/assets/javascripts/mode-lua-uncompressed.js +0 -523
  139. data/vendor/assets/javascripts/mode-markdown-noconflict.js +0 -1
  140. data/vendor/assets/javascripts/mode-markdown-uncompressed-noconflict.js +0 -2925
  141. data/vendor/assets/javascripts/mode-markdown-uncompressed.js +0 -2925
  142. data/vendor/assets/javascripts/mode-ocaml-noconflict.js +0 -1
  143. data/vendor/assets/javascripts/mode-ocaml-uncompressed-noconflict.js +0 -539
  144. data/vendor/assets/javascripts/mode-ocaml-uncompressed.js +0 -539
  145. data/vendor/assets/javascripts/mode-perl-noconflict.js +0 -1
  146. data/vendor/assets/javascripts/mode-perl-uncompressed-noconflict.js +0 -574
  147. data/vendor/assets/javascripts/mode-perl-uncompressed.js +0 -574
  148. data/vendor/assets/javascripts/mode-pgsql-noconflict.js +0 -1
  149. data/vendor/assets/javascripts/mode-pgsql-uncompressed-noconflict.js +0 -1104
  150. data/vendor/assets/javascripts/mode-pgsql-uncompressed.js +0 -1104
  151. data/vendor/assets/javascripts/mode-php-noconflict.js +0 -1
  152. data/vendor/assets/javascripts/mode-php-uncompressed-noconflict.js +0 -1885
  153. data/vendor/assets/javascripts/mode-php-uncompressed.js +0 -1885
  154. data/vendor/assets/javascripts/mode-powershell-noconflict.js +0 -1
  155. data/vendor/assets/javascripts/mode-powershell-uncompressed-noconflict.js +0 -710
  156. data/vendor/assets/javascripts/mode-powershell-uncompressed.js +0 -710
  157. data/vendor/assets/javascripts/mode-python-noconflict.js +0 -1
  158. data/vendor/assets/javascripts/mode-python-uncompressed-noconflict.js +0 -507
  159. data/vendor/assets/javascripts/mode-python-uncompressed.js +0 -507
  160. data/vendor/assets/javascripts/mode-ruby-noconflict.js +0 -1
  161. data/vendor/assets/javascripts/mode-ruby-uncompressed-noconflict.js +0 -391
  162. data/vendor/assets/javascripts/mode-ruby-uncompressed.js +0 -391
  163. data/vendor/assets/javascripts/mode-scad-noconflict.js +0 -1
  164. data/vendor/assets/javascripts/mode-scad-uncompressed-noconflict.js +0 -907
  165. data/vendor/assets/javascripts/mode-scad-uncompressed.js +0 -907
  166. data/vendor/assets/javascripts/mode-scala-noconflict.js +0 -1
  167. data/vendor/assets/javascripts/mode-scala-uncompressed-noconflict.js +0 -1395
  168. data/vendor/assets/javascripts/mode-scala-uncompressed.js +0 -1395
  169. data/vendor/assets/javascripts/mode-scss-noconflict.js +0 -1
  170. data/vendor/assets/javascripts/mode-scss-uncompressed-noconflict.js +0 -679
  171. data/vendor/assets/javascripts/mode-scss-uncompressed.js +0 -679
  172. data/vendor/assets/javascripts/mode-sh-noconflict.js +0 -1
  173. data/vendor/assets/javascripts/mode-sh-uncompressed-noconflict.js +0 -289
  174. data/vendor/assets/javascripts/mode-sh-uncompressed.js +0 -289
  175. data/vendor/assets/javascripts/mode-sql-noconflict.js +0 -1
  176. data/vendor/assets/javascripts/mode-sql-uncompressed-noconflict.js +0 -159
  177. data/vendor/assets/javascripts/mode-sql-uncompressed.js +0 -159
  178. data/vendor/assets/javascripts/mode-svg-noconflict.js +0 -1
  179. data/vendor/assets/javascripts/mode-svg-uncompressed-noconflict.js +0 -2137
  180. data/vendor/assets/javascripts/mode-svg-uncompressed.js +0 -2137
  181. data/vendor/assets/javascripts/mode-text-noconflict.js +0 -0
  182. data/vendor/assets/javascripts/mode-text-uncompressed-noconflict.js +0 -0
  183. data/vendor/assets/javascripts/mode-text-uncompressed.js +0 -0
  184. data/vendor/assets/javascripts/mode-textile-noconflict.js +0 -1
  185. data/vendor/assets/javascripts/mode-textile-uncompressed-noconflict.js +0 -254
  186. data/vendor/assets/javascripts/mode-textile-uncompressed.js +0 -254
  187. data/vendor/assets/javascripts/mode-xml-noconflict.js +0 -1
  188. data/vendor/assets/javascripts/mode-xml-uncompressed-noconflict.js +0 -1012
  189. data/vendor/assets/javascripts/mode-xml-uncompressed.js +0 -1012
  190. data/vendor/assets/javascripts/mode-xquery-noconflict.js +0 -1
  191. data/vendor/assets/javascripts/mode-xquery-uncompressed-noconflict.js +0 -540
  192. data/vendor/assets/javascripts/mode-xquery-uncompressed.js +0 -540
  193. data/vendor/assets/javascripts/theme-chrome-noconflict.js +0 -1
  194. data/vendor/assets/javascripts/theme-chrome-uncompressed-noconflict.js +0 -207
  195. data/vendor/assets/javascripts/theme-chrome-uncompressed.js +0 -207
  196. data/vendor/assets/javascripts/theme-clouds-noconflict.js +0 -1
  197. data/vendor/assets/javascripts/theme-clouds-uncompressed-noconflict.js +0 -160
  198. data/vendor/assets/javascripts/theme-clouds-uncompressed.js +0 -160
  199. data/vendor/assets/javascripts/theme-clouds_midnight-noconflict.js +0 -1
  200. data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed-noconflict.js +0 -161
  201. data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed.js +0 -161
  202. data/vendor/assets/javascripts/theme-cobalt-noconflict.js +0 -1
  203. data/vendor/assets/javascripts/theme-cobalt-uncompressed-noconflict.js +0 -187
  204. data/vendor/assets/javascripts/theme-cobalt-uncompressed.js +0 -187
  205. data/vendor/assets/javascripts/theme-crimson_editor-noconflict.js +0 -1
  206. data/vendor/assets/javascripts/theme-crimson_editor-uncompressed-noconflict.js +0 -198
  207. data/vendor/assets/javascripts/theme-crimson_editor-uncompressed.js +0 -198
  208. data/vendor/assets/javascripts/theme-dawn-noconflict.js +0 -1
  209. data/vendor/assets/javascripts/theme-dawn-uncompressed-noconflict.js +0 -191
  210. data/vendor/assets/javascripts/theme-dawn-uncompressed.js +0 -191
  211. data/vendor/assets/javascripts/theme-dreamweaver-noconflict.js +0 -1
  212. data/vendor/assets/javascripts/theme-dreamweaver-uncompressed-noconflict.js +0 -227
  213. data/vendor/assets/javascripts/theme-dreamweaver-uncompressed.js +0 -227
  214. data/vendor/assets/javascripts/theme-eclipse-noconflict.js +0 -1
  215. data/vendor/assets/javascripts/theme-eclipse-uncompressed-noconflict.js +0 -147
  216. data/vendor/assets/javascripts/theme-eclipse-uncompressed.js +0 -147
  217. data/vendor/assets/javascripts/theme-idle_fingers-noconflict.js +0 -1
  218. data/vendor/assets/javascripts/theme-idle_fingers-uncompressed-noconflict.js +0 -179
  219. data/vendor/assets/javascripts/theme-idle_fingers-uncompressed.js +0 -179
  220. data/vendor/assets/javascripts/theme-kr_theme-noconflict.js +0 -1
  221. data/vendor/assets/javascripts/theme-kr_theme-uncompressed-noconflict.js +0 -182
  222. data/vendor/assets/javascripts/theme-kr_theme-uncompressed.js +0 -182
  223. data/vendor/assets/javascripts/theme-merbivore-noconflict.js +0 -1
  224. data/vendor/assets/javascripts/theme-merbivore-uncompressed-noconflict.js +0 -182
  225. data/vendor/assets/javascripts/theme-merbivore-uncompressed.js +0 -182
  226. data/vendor/assets/javascripts/theme-merbivore_soft-noconflict.js +0 -1
  227. data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed-noconflict.js +0 -188
  228. data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed.js +0 -188
  229. data/vendor/assets/javascripts/theme-mono_industrial-noconflict.js +0 -1
  230. data/vendor/assets/javascripts/theme-mono_industrial-uncompressed-noconflict.js +0 -190
  231. data/vendor/assets/javascripts/theme-mono_industrial-uncompressed.js +0 -190
  232. data/vendor/assets/javascripts/theme-monokai-noconflict.js +0 -1
  233. data/vendor/assets/javascripts/theme-monokai-uncompressed-noconflict.js +0 -191
  234. data/vendor/assets/javascripts/theme-monokai-uncompressed.js +0 -191
  235. data/vendor/assets/javascripts/theme-pastel_on_dark-noconflict.js +0 -1
  236. data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed-noconflict.js +0 -192
  237. data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed.js +0 -192
  238. data/vendor/assets/javascripts/theme-solarized_dark-noconflict.js +0 -1
  239. data/vendor/assets/javascripts/theme-solarized_dark-uncompressed-noconflict.js +0 -176
  240. data/vendor/assets/javascripts/theme-solarized_dark-uncompressed.js +0 -176
  241. data/vendor/assets/javascripts/theme-solarized_light-noconflict.js +0 -1
  242. data/vendor/assets/javascripts/theme-solarized_light-uncompressed-noconflict.js +0 -172
  243. data/vendor/assets/javascripts/theme-solarized_light-uncompressed.js +0 -172
  244. data/vendor/assets/javascripts/theme-textmate-noconflict.js +0 -0
  245. data/vendor/assets/javascripts/theme-textmate-uncompressed-noconflict.js +0 -0
  246. data/vendor/assets/javascripts/theme-textmate-uncompressed.js +0 -0
  247. data/vendor/assets/javascripts/theme-tomorrow-noconflict.js +0 -1
  248. data/vendor/assets/javascripts/theme-tomorrow-uncompressed-noconflict.js +0 -206
  249. data/vendor/assets/javascripts/theme-tomorrow-uncompressed.js +0 -206
  250. data/vendor/assets/javascripts/theme-tomorrow_night-noconflict.js +0 -1
  251. data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed-noconflict.js +0 -206
  252. data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed.js +0 -206
  253. data/vendor/assets/javascripts/theme-tomorrow_night_blue-noconflict.js +0 -1
  254. data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed-noconflict.js +0 -209
  255. data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed.js +0 -209
  256. data/vendor/assets/javascripts/theme-tomorrow_night_bright-noconflict.js +0 -1
  257. data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed-noconflict.js +0 -206
  258. data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed.js +0 -206
  259. data/vendor/assets/javascripts/theme-tomorrow_night_eighties-noconflict.js +0 -1
  260. data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed-noconflict.js +0 -202
  261. data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed.js +0 -202
  262. data/vendor/assets/javascripts/theme-twilight-noconflict.js +0 -1
  263. data/vendor/assets/javascripts/theme-twilight-uncompressed-noconflict.js +0 -204
  264. data/vendor/assets/javascripts/theme-twilight-uncompressed.js +0 -204
  265. data/vendor/assets/javascripts/theme-vibrant_ink-noconflict.js +0 -1
  266. data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed-noconflict.js +0 -183
  267. data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed.js +0 -183
@@ -1 +1,250 @@
1
- define("ace/mode/sh",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/sh_highlight_rules","ace/range"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text").Mode,f=a("../tokenizer").Tokenizer,g=a("./sh_highlight_rules").ShHighlightRules,h=a("../range").Range,i=function(){this.$tokenizer=new f((new g).getRules())};d.inherits(i,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=/^(\s*)#/;for(var g=c;g<=d;g++)if(!f.test(b.getLine(g))){e=!1;break}if(e){var i=new h(0,0,0,0);for(var g=c;g<=d;g++){var j=b.getLine(g),k=j.match(f);i.start.row=g,i.end.row=g,i.end.column=k[0].length,b.replace(i,k[1])}}else b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var g=b.match(/^.*[\{\(\[\:]\s*$/);g&&(d+=c)}return d};var a={pass:1,"return":1,raise:1,"break":1,"continue":1};this.checkOutdent=function(b,c,d){if(d!=="\r\n"&&d!=="\r"&&d!=="\n")return!1;var e=this.$tokenizer.getLineTokens(c.trim(),b).tokens;if(!e)return!1;do var f=e.pop();while(f&&(f.type=="comment"||f.type=="text"&&f.value.match(/^\s+$/)));return f?f.type=="keyword"&&a[f.value]:!1},this.autoOutdent=function(a,b,c){c+=1;var d=this.$getIndent(b.getLine(c)),e=b.getTabString();d.slice(-e.length)==e&&b.remove(new h(c,d.length-e.length,c,d.length))}}.call(i.prototype),b.Mode=i}),define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("../lib/lang"),f=a("./text_highlight_rules").TextHighlightRules,g=function(){var a=e.arrayToMap("!|{|}|case|do|done|elif|else|esac|fi|for|if|in|then|until|while|&|;|export|local|read|typeset|unset|elif|select|set".split("|")),b=e.arrayToMap("[|]|alias|bg|bind|break|builtin|cd|command|compgen|complete|continue|dirs|disown|echo|enable|eval|exec|exit|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|popd|printf|pushd|pwd|return|set|shift|shopt|source|suspend|test|times|trap|type|ulimit|umask|unalias|wait".split("|")),c="(?:(?:[1-9]\\d*)|(?:0))",d="(?:\\.\\d+)",f="(?:\\d+)",g="(?:(?:"+f+"?"+d+")|(?:"+f+"\\.))",h="(?:(?:"+g+"|"+f+")"+")",i="(?:"+h+"|"+g+")",j="(?:&"+f+")",k="[a-zA-Z][a-zA-Z0-9_]*",l="(?:(?:\\$"+k+")|(?:"+k+"=))",m="(?:\\$(?:SHLVL|\\$|\\!|\\?))",n="(?:"+k+"\\s*\\(\\))";this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:'"(?:[^\\\\]|\\\\.)*?"'},{token:"variable.language",regex:m},{token:"variable",regex:l},{token:"support.function",regex:n},{token:"support.function",regex:j},{token:"string",regex:"'(?:[^\\\\]|\\\\.)*?'"},{token:"constant.numeric",regex:i},{token:"constant.numeric",regex:c+"\\b"},{token:function(c){return a.hasOwnProperty(c)?"keyword":b.hasOwnProperty(c)?"constant.language":c=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!="},{token:"lparen.paren",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}]}};d.inherits(g,f),b.ShHighlightRules=g})
1
+ /* ***** BEGIN LICENSE BLOCK *****
2
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3
+ *
4
+ * The contents of this file are subject to the Mozilla Public License Version
5
+ * 1.1 (the "License"); you may not use this file except in compliance with
6
+ * the License. You may obtain a copy of the License at
7
+ * http://www.mozilla.org/MPL/
8
+ *
9
+ * Software distributed under the License is distributed on an "AS IS" basis,
10
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
+ * for the specific language governing rights and limitations under the
12
+ * License.
13
+ *
14
+ * The Original Code is Ajax.org Code Editor (ACE).
15
+ *
16
+ * The Initial Developer of the Original Code is
17
+ * Ajax.org B.V.
18
+ * Portions created by the Initial Developer are Copyright (C) 2010
19
+ * the Initial Developer. All Rights Reserved.
20
+ *
21
+ * Contributor(s):
22
+ * Rich Healey <richo AT psych0tik DOT net>
23
+ *
24
+ * Alternatively, the contents of this file may be used under the terms of
25
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
26
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
+ * in which case the provisions of the GPL or the LGPL are applicable instead
28
+ * of those above. If you wish to allow use of your version of this file only
29
+ * under the terms of either the GPL or the LGPL, and not to allow others to
30
+ * use your version of this file under the terms of the MPL, indicate your
31
+ * decision by deleting the provisions above and replace them with the notice
32
+ * and other provisions required by the GPL or the LGPL. If you do not delete
33
+ * the provisions above, a recipient may use your version of this file under
34
+ * the terms of any one of the MPL, the GPL or the LGPL.
35
+ *
36
+ * ***** END LICENSE BLOCK ***** */
37
+
38
+ define('ace/mode/sh', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/sh_highlight_rules', 'ace/range'], function(require, exports, module) {
39
+
40
+
41
+ var oop = require("../lib/oop");
42
+ var TextMode = require("./text").Mode;
43
+ var Tokenizer = require("../tokenizer").Tokenizer;
44
+ var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules;
45
+ var Range = require("../range").Range;
46
+
47
+ var Mode = function() {
48
+ this.$tokenizer = new Tokenizer(new ShHighlightRules().getRules());
49
+ };
50
+ oop.inherits(Mode, TextMode);
51
+
52
+ (function() {
53
+
54
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
55
+ var outdent = true;
56
+ var re = /^(\s*)#/;
57
+
58
+ for (var i=startRow; i<= endRow; i++) {
59
+ if (!re.test(doc.getLine(i))) {
60
+ outdent = false;
61
+ break;
62
+ }
63
+ }
64
+
65
+ if (outdent) {
66
+ var deleteRange = new Range(0, 0, 0, 0);
67
+ for (var i=startRow; i<= endRow; i++)
68
+ {
69
+ var line = doc.getLine(i);
70
+ var m = line.match(re);
71
+ deleteRange.start.row = i;
72
+ deleteRange.end.row = i;
73
+ deleteRange.end.column = m[0].length;
74
+ doc.replace(deleteRange, m[1]);
75
+ }
76
+ }
77
+ else {
78
+ doc.indentRows(startRow, endRow, "#");
79
+ }
80
+ };
81
+
82
+ this.getNextLineIndent = function(state, line, tab) {
83
+ var indent = this.$getIndent(line);
84
+
85
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
86
+ var tokens = tokenizedLine.tokens;
87
+
88
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
89
+ return indent;
90
+ }
91
+
92
+ if (state == "start") {
93
+ var match = line.match(/^.*[\{\(\[\:]\s*$/);
94
+ if (match) {
95
+ indent += tab;
96
+ }
97
+ }
98
+
99
+ return indent;
100
+ };
101
+
102
+ var outdents = {
103
+ "pass": 1,
104
+ "return": 1,
105
+ "raise": 1,
106
+ "break": 1,
107
+ "continue": 1
108
+ };
109
+
110
+ this.checkOutdent = function(state, line, input) {
111
+ if (input !== "\r\n" && input !== "\r" && input !== "\n")
112
+ return false;
113
+
114
+ var tokens = this.$tokenizer.getLineTokens(line.trim(), state).tokens;
115
+
116
+ if (!tokens)
117
+ return false;
118
+
119
+ // ignore trailing comments
120
+ do {
121
+ var last = tokens.pop();
122
+ } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
123
+
124
+ if (!last)
125
+ return false;
126
+
127
+ return (last.type == "keyword" && outdents[last.value]);
128
+ };
129
+
130
+ this.autoOutdent = function(state, doc, row) {
131
+ // outdenting in sh is slightly different because it always applies
132
+ // to the next line and only of a new line is inserted
133
+
134
+ row += 1;
135
+ var indent = this.$getIndent(doc.getLine(row));
136
+ var tab = doc.getTabString();
137
+ if (indent.slice(-tab.length) == tab)
138
+ doc.remove(new Range(row, indent.length-tab.length, row, indent.length));
139
+ };
140
+
141
+ }).call(Mode.prototype);
142
+
143
+ exports.Mode = Mode;
144
+ });
145
+ define('ace/mode/sh_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
146
+
147
+
148
+ var oop = require("../lib/oop");
149
+ var lang = require("../lib/lang");
150
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
151
+
152
+ var ShHighlightRules = function() {
153
+
154
+ var reservedKeywords = lang.arrayToMap(
155
+ ('!|{|}|case|do|done|elif|else|'+
156
+ 'esac|fi|for|if|in|then|until|while|'+
157
+ '&|;|export|local|read|typeset|unset|'+
158
+ 'elif|select|set'
159
+ ).split('|')
160
+ );
161
+
162
+ var languageConstructs = lang.arrayToMap(
163
+ ('[|]|alias|bg|bind|break|builtin|'+
164
+ 'cd|command|compgen|complete|continue|'+
165
+ 'dirs|disown|echo|enable|eval|exec|'+
166
+ 'exit|fc|fg|getopts|hash|help|history|'+
167
+ 'jobs|kill|let|logout|popd|printf|pushd|'+
168
+ 'pwd|return|set|shift|shopt|source|'+
169
+ 'suspend|test|times|trap|type|ulimit|'+
170
+ 'umask|unalias|wait'
171
+ ).split('|')
172
+ );
173
+
174
+ var integer = "(?:(?:[1-9]\\d*)|(?:0))";
175
+ // var integer = "(?:" + decimalInteger + ")";
176
+
177
+ var fraction = "(?:\\.\\d+)";
178
+ var intPart = "(?:\\d+)";
179
+ var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
180
+ var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + ")";
181
+ var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
182
+ var fileDescriptor = "(?:&" + intPart + ")";
183
+
184
+ var variableName = "[a-zA-Z][a-zA-Z0-9_]*";
185
+ var variable = "(?:(?:\\$" + variableName + ")|(?:" + variableName + "=))";
186
+
187
+ var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))";
188
+
189
+ var func = "(?:" + variableName + "\\s*\\(\\))";
190
+
191
+ this.$rules = {
192
+ "start" : [ {
193
+ token : "comment",
194
+ regex : "#.*$"
195
+ }, {
196
+ token : "string", // " string
197
+ regex : '"(?:[^\\\\]|\\\\.)*?"'
198
+ }, {
199
+ token : "variable.language",
200
+ regex : builtinVariable
201
+ }, {
202
+ token : "variable",
203
+ regex : variable
204
+ }, {
205
+ token : "support.function",
206
+ regex : func,
207
+ }, {
208
+ token : "support.function",
209
+ regex : fileDescriptor
210
+ }, {
211
+ token : "string", // ' string
212
+ regex : "'(?:[^\\\\]|\\\\.)*?'"
213
+ }, {
214
+ token : "constant.numeric", // float
215
+ regex : floatNumber
216
+ }, {
217
+ token : "constant.numeric", // integer
218
+ regex : integer + "\\b"
219
+ }, {
220
+ token : function(value) {
221
+ if (reservedKeywords.hasOwnProperty(value))
222
+ return "keyword";
223
+ else if (languageConstructs.hasOwnProperty(value))
224
+ return "constant.language";
225
+ else if (value == "debugger")
226
+ return "invalid.deprecated";
227
+ else
228
+ return "identifier";
229
+ },
230
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
231
+ }, {
232
+ token : "keyword.operator",
233
+ regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!="
234
+ }, {
235
+ token : "paren.lparen",
236
+ regex : "[\\[\\(\\{]"
237
+ }, {
238
+ token : "paren.rparen",
239
+ regex : "[\\]\\)\\}]"
240
+ }, {
241
+ token : "text",
242
+ regex : "\\s+"
243
+ } ]
244
+ };
245
+ };
246
+
247
+ oop.inherits(ShHighlightRules, TextHighlightRules);
248
+
249
+ exports.ShHighlightRules = ShHighlightRules;
250
+ });
@@ -1 +1,140 @@
1
- define("ace/mode/sql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/sql_highlight_rules","ace/range"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text").Mode,f=a("../tokenizer").Tokenizer,g=a("./sql_highlight_rules").SqlHighlightRules,h=a("../range").Range,i=function(){this.$tokenizer=new f((new g).getRules())};d.inherits(i,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)--/;for(var i=c;i<=d;i++)if(!g.test(b.getLine(i))){e=!1;break}if(e){var j=new h(0,0,0,0);for(var i=c;i<=d;i++){var k=b.getLine(i),l=k.match(g);j.start.row=i,j.end.row=i,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"--")}}.call(i.prototype),b.Mode=i}),define("ace/mode/sql_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("../lib/lang"),f=a("./text_highlight_rules").TextHighlightRules,g=function(){var a=e.arrayToMap("select|from|where|and|or|group|by|order|limit|offset|having|as|case|when|else|end|type|left|right|join|on|outer|desc|asc".split("|")),b=e.arrayToMap("true|false|null".split("|")),c=e.arrayToMap("count|min|max|avg|sum|rank|now|coalesce".split("|"));this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"string",regex:'".*"'},{token:"string",regex:"'.*'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:function(d){return d=d.toLowerCase(),a.hasOwnProperty(d)?"keyword":b.hasOwnProperty(d)?"constant.language":c.hasOwnProperty(d)?"support.function":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"lparen.paren",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]}};d.inherits(g,f),b.SqlHighlightRules=g})
1
+ /* ***** BEGIN LICENSE BLOCK *****
2
+ * The Original Code is Ajax.org Code Editor (ACE).
3
+ *
4
+ * Contributor(s):
5
+ * Jonathan Camile <jonathan.camile AT gmail DOT com>
6
+ *
7
+ * Alternatively, the contents of this file may be used under the terms of
8
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
9
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
10
+ * in which case the provisions of the GPL or the LGPL are applicable instead
11
+ * of those above. If you wish to allow use of your version of this file only
12
+ * under the terms of either the GPL or the LGPL, and not to allow others to
13
+ * use your version of this file under the terms of the MPL, indicate your
14
+ * decision by deleting the provisions above and replace them with the notice
15
+ * and other provisions required by the GPL or the LGPL. If you do not delete
16
+ * the provisions above, a recipient may use your version of this file under
17
+ * the terms of any one of the MPL, the GPL or the LGPL.
18
+ *
19
+ * ***** END LICENSE BLOCK ***** */
20
+
21
+ define('ace/mode/sql', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/sql_highlight_rules', 'ace/range'], function(require, exports, module) {
22
+
23
+
24
+ var oop = require("../lib/oop");
25
+ var TextMode = require("./text").Mode;
26
+ var Tokenizer = require("../tokenizer").Tokenizer;
27
+ var SqlHighlightRules = require("./sql_highlight_rules").SqlHighlightRules;
28
+ var Range = require("../range").Range;
29
+
30
+ var Mode = function() {
31
+ this.$tokenizer = new Tokenizer(new SqlHighlightRules().getRules());
32
+ };
33
+ oop.inherits(Mode, TextMode);
34
+
35
+ (function() {
36
+
37
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
38
+ var outdent = true;
39
+ var outentedRows = [];
40
+ var re = /^(\s*)--/;
41
+
42
+ for (var i=startRow; i<= endRow; i++) {
43
+ if (!re.test(doc.getLine(i))) {
44
+ outdent = false;
45
+ break;
46
+ }
47
+ }
48
+
49
+ if (outdent) {
50
+ var deleteRange = new Range(0, 0, 0, 0);
51
+ for (var i=startRow; i<= endRow; i++)
52
+ {
53
+ var line = doc.getLine(i);
54
+ var m = line.match(re);
55
+ deleteRange.start.row = i;
56
+ deleteRange.end.row = i;
57
+ deleteRange.end.column = m[0].length;
58
+ doc.replace(deleteRange, m[1]);
59
+ }
60
+ }
61
+ else {
62
+ doc.indentRows(startRow, endRow, "--");
63
+ }
64
+ };
65
+
66
+ }).call(Mode.prototype);
67
+
68
+ exports.Mode = Mode;
69
+
70
+ });
71
+
72
+ define('ace/mode/sql_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
73
+
74
+
75
+ var oop = require("../lib/oop");
76
+ var lang = require("../lib/lang");
77
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
78
+
79
+ var SqlHighlightRules = function() {
80
+
81
+ var keywords = lang.arrayToMap(
82
+ ("select|from|where|and|or|group|by|order|limit|offset|having|as|case|" +
83
+ "when|else|end|type|left|right|join|on|outer|desc|asc").split("|")
84
+ );
85
+
86
+ var builtinConstants = lang.arrayToMap(
87
+ ("true|false|null").split("|")
88
+ );
89
+
90
+ var builtinFunctions = lang.arrayToMap(
91
+ ("count|min|max|avg|sum|rank|now|coalesce").split("|")
92
+ );
93
+
94
+ this.$rules = {
95
+ "start" : [ {
96
+ token : "comment",
97
+ regex : "--.*$"
98
+ }, {
99
+ token : "string", // " string
100
+ regex : '".*"'
101
+ }, {
102
+ token : "string", // ' string
103
+ regex : "'.*'"
104
+ }, {
105
+ token : "constant.numeric", // float
106
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
107
+ }, {
108
+ token : function(value) {
109
+ value = value.toLowerCase();
110
+ if (keywords.hasOwnProperty(value))
111
+ return "keyword";
112
+ else if (builtinConstants.hasOwnProperty(value))
113
+ return "constant.language";
114
+ else if (builtinFunctions.hasOwnProperty(value))
115
+ return "support.function";
116
+ else
117
+ return "identifier";
118
+ },
119
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
120
+ }, {
121
+ token : "keyword.operator",
122
+ regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="
123
+ }, {
124
+ token : "paren.lparen",
125
+ regex : "[\\(]"
126
+ }, {
127
+ token : "paren.rparen",
128
+ regex : "[\\)]"
129
+ }, {
130
+ token : "text",
131
+ regex : "\\s+"
132
+ } ]
133
+ };
134
+ };
135
+
136
+ oop.inherits(SqlHighlightRules, TextHighlightRules);
137
+
138
+ exports.SqlHighlightRules = SqlHighlightRules;
139
+ });
140
+
@@ -1 +1,1681 @@
1
- define("ace/mode/svg",["require","exports","module","ace/lib/oop","ace/mode/xml","ace/mode/javascript","ace/tokenizer","ace/mode/svg_highlight_rules","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./xml").Mode,f=a("./javascript").Mode,g=a("../tokenizer").Tokenizer,h=a("./svg_highlight_rules").SvgHighlightRules,i=a("./folding/mixed").FoldMode,j=a("./folding/xml").FoldMode,k=a("./folding/cstyle").FoldMode,l=function(){e.call(this),this.highlighter=new h,this.$tokenizer=new g(this.highlighter.getRules()),this.$embeds=this.highlighter.getEmbeds(),this.createModeDelegates({"js-":f}),this.foldingRules=new i(new j({}),{"js-":new k})};d.inherits(l,e),function(){this.getNextLineIndent=function(a,b,c){return this.$getIndent(b)}}.call(l.prototype),b.Mode=l}),define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text").Mode,f=a("../tokenizer").Tokenizer,g=a("./xml_highlight_rules").XmlHighlightRules,h=a("./behaviour/xml").XmlBehaviour,i=a("./folding/xml").FoldMode,j=function(){this.$tokenizer=new f((new g).getRules()),this.$behaviour=new h,this.foldingRules=new i};d.inherits(j,e),function(){this.getNextLineIndent=function(a,b,c){return this.$getIndent(b)}}.call(j.prototype),b.Mode=j}),define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/xml_util","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./xml_util"),f=a("./text_highlight_rules").TextHighlightRules,g=function(){this.$rules={start:[{token:"text",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:"xml_pe",regex:"<\\?.*?\\?>"},{token:"comment",merge:!0,regex:"<\\!--",next:"comment"},{token:"xml_pe",regex:"<\\!.*?>"},{token:"meta.tag",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"constant.character.entity",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"},{token:"text",regex:"[^<]+"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",merge:!0,regex:".+"}]},e.tag(this.$rules,"tag","start")};d.inherits(g,f),b.XmlHighlightRules=g}),define("ace/mode/xml_util",["require","exports","module","ace/lib/lang"],function(a,b,c){function g(a){return[{token:"string",regex:'".*?"'},{token:"string",merge:!0,regex:'["].*',next:a+"_qqstring"},{token:"string",regex:"'.*?'"},{token:"string",merge:!0,regex:"['].*",next:a+"_qstring"}]}function h(a,b){return[{token:"string",merge:!0,regex:".*?"+a,next:b},{token:"string",merge:!0,regex:".+"}]}"use strict";var d=a("../lib/lang"),e=d.arrayToMap("button|form|input|label|select|textarea".split("|")),f=d.arrayToMap("table|tbody|td|tfoot|th|tr".split("|"));b.tag=function(a,b,c){a[b]=[{token:"text",regex:"\\s+"},{token:function(a){return a==="a"?"meta.tag.anchor":a==="img"?"meta.tag.image":a==="script"?"meta.tag.script":a==="style"?"meta.tag.style":e.hasOwnProperty(a.toLowerCase())?"meta.tag.form":f.hasOwnProperty(a.toLowerCase())?"meta.tag.table":"meta.tag"},merge:!0,regex:"[-_a-zA-Z0-9:]+",next:b+"_embed_attribute_list"},{token:"empty",regex:"",next:b+"_embed_attribute_list"}],a[b+"_qstring"]=h("'",b+"_embed_attribute_list"),a[b+"_qqstring"]=h('"',b+"_embed_attribute_list"),a[b+"_embed_attribute_list"]=[{token:"meta.tag",merge:!0,regex:"/?>",next:c},{token:"keyword.operator",regex:"="},{token:"entity.other.attribute-name",regex:"[-_a-zA-Z0-9:]+"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"text",regex:"\\s+"}].concat(g(b))}}),define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../behaviour").Behaviour,f=a("./cstyle").CstyleBehaviour,g=function(){this.inherit(f,["string_dquotes"]),this.add("brackets","insertion",function(a,b,c,d,e){if(e=="<"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?!1:{text:"<>",selection:[1,1]}}if(e==">"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==">")return{text:"",selection:[1,1]}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),k=i.substring(h.column,h.column+2);if(k=="</"){var l=this.$getIndent(d.doc.getLine(h.row))+d.getTabString(),m=this.$getIndent(d.doc.getLine(h.row));return{text:"\n"+l+"\n"+m,selection:[1,l.length,1,l.length]}}}})};d.inherits(g,e),b.XmlBehaviour=g}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../behaviour").Behaviour,f=function(){this.add("braces","insertion",function(a,b,c,d,e){if(e=="{"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"{"+g+"}",selection:!1}:{text:"{}",selection:[1,1]}}if(e=="}"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var k=d.$findOpeningBracket("}",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var l=d.findMatchingBracket({row:h.row,column:h.column+1});if(!l)return null;var m=this.getNextLineIndent(a,i.substring(0,i.length-1),d.getTabString()),n=this.$getIndent(d.doc.getLine(l.row));return{text:"\n"+m+"\n"+n,selection:[1,m.length,1,m.length]}}}}),this.add("braces","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="{"){var g=d.doc.getLine(e.start.row),h=g.substring(e.end.column,e.end.column+1);if(h=="}")return e.end.column++,e}}),this.add("parens","insertion",function(a,b,c,d,e){if(e=="("){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"("+g+")",selection:!1}:{text:"()",selection:[1,1]}}if(e==")"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==")"){var k=d.$findOpeningBracket(")",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="("){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h==")")return e.end.column++,e}}),this.add("string_dquotes","insertion",function(a,b,c,d,e){if(e=='"'||e=="'"){var f=e,g=c.getSelectionRange(),h=d.doc.getTextRange(g);if(h!=="")return{text:f+h+f,selection:!1};var i=c.getCursorPosition(),j=d.doc.getLine(i.row),k=j.substring(i.column-1,i.column);if(k=="\\")return null;var l=d.getTokens(g.start.row,g.start.row)[0].tokens,m=0,n,o=-1;for(var p=0;p<l.length;p++){n=l[p],n.type=="string"?o=-1:o<0&&(o=n.value.indexOf(f));if(n.value.length+m>g.start.column)break;m+=l[p].value.length}if(!n||o<0&&n.type!=="comment"&&(n.type!=="string"||g.start.column!==n.value.length+m-1&&n.value.lastIndexOf(f)===n.value.length-1))return{text:f+f,selection:[1,1]};if(n&&n.type==="string"){var q=j.substring(i.column,i.column+1);if(q==f)return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&(f=='"'||f=="'")){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return e.end.column++,e}})};d.inherits(f,e),b.CstyleBehaviour=f}),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(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../../lib/lang"),f=a("../../range").Range,g=a("./fold_mode").FoldMode,h=a("../../token_iterator").TokenIterator,i=b.FoldMode=function(a){g.call(this),this.voidElements=a||{}};d.inherits(i,g),function(){this.getFoldWidget=function(a,b,c){var d=this._getFirstTagInLine(a,c);return d.closing?b=="markbeginend"?"end":"":!d.tagName||this.voidElements[d.tagName.toLowerCase()]?"":d.selfClosing?"":d.value.indexOf("/"+d.tagName)!==-1?"":"start"},this._getFirstTagInLine=function(a,b){var c=a.getTokens(b,b)[0].tokens,d="";for(var f=0;f<c.length;f++){var g=c[f];g.type.indexOf("meta.tag")===0?d+=g.value:d+=e.stringRepeat(" ",g.value.length)}return this._parseTag(d)},this.tagRe=/^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/,this._parseTag=function(a){var b=this.tagRe.exec(a),c=this.tagRe.lastIndex||0;return this.tagRe.lastIndex=0,{value:a,match:b?b[2]:"",closing:b?!!b[3]:!1,selfClosing:b?!!b[5]||b[2]=="/>":!1,tagName:b?b[4]:"",column:b[1]?c+b[1].length:c}},this._readTagForward=function(a){var b=a.getCurrentToken();if(!b)return null;var c="",d;do if(b.type.indexOf("meta.tag")===0){if(!d)var d={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()};c+=b.value;if(c.indexOf(">")!==-1){var e=this._parseTag(c);return e.start=d,e.end={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()+b.value.length},a.stepForward(),e}}while(b=a.stepForward());return null},this._readTagBackward=function(a){var b=a.getCurrentToken();if(!b)return null;var c="",d;do if(b.type.indexOf("meta.tag")===0){d||(d={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()+b.value.length}),c=b.value+c;if(c.indexOf("<")!==-1){var e=this._parseTag(c);return e.end=d,e.start={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()},a.stepBackward(),e}}while(b=a.stepBackward());return null},this._pop=function(a,b){while(a.length){var c=a[a.length-1];if(!b||c.tagName==b.tagName)return a.pop();if(this.voidElements[b.tagName])return;if(this.voidElements[c.tagName]){a.pop();continue}return null}},this.getFoldWidgetRange=function(a,b,c){var d=this._getFirstTagInLine(a,c);if(!d.match)return null;var e=d.closing||d.selfClosing,g=[],i;if(!e){var j=new h(a,c,d.column),k={row:c,column:d.column+d.tagName.length+2};while(i=this._readTagForward(j)){if(i.selfClosing){if(!g.length)return i.start.column+=i.tagName.length+2,i.end.column-=2,f.fromPoints(i.start,i.end);continue}if(i.closing){this._pop(g,i);if(g.length==0)return f.fromPoints(k,i.start)}else g.push(i)}}else{var j=new h(a,c,d.column+d.match.length),l={row:c,column:d.column};while(i=this._readTagBackward(j)){if(i.selfClosing){if(!g.length)return i.start.column+=i.tagName.length+2,i.end.column-=2,f.fromPoints(i.start,i.end);continue}if(!i.closing){this._pop(g,i);if(g.length==0)return i.start.column+=i.tagName.length+2,f.fromPoints(i.start,l)}else g.push(i)}}}}.call(i.prototype)}),define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(a,b,c){"use strict";var d=a("../../range").Range,e=b.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(a,b,c){var d=a.getLine(c);return this.foldingStartMarker.test(d)?"start":b=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(d)?"end":""},this.getFoldWidgetRange=function(a,b,c){return null},this.indentationBlock=function(a,b,c){var e=/^\s*/,f=b,g=b,h=a.getLine(b),i=c||h.length,j=h.match(e)[0].length,k=a.getLength();while(++b<k){h=a.getLine(b);var l=h.match(e)[0].length;if(l==h.length)continue;if(l<=j)break;g=b}if(g>f){var m=a.getLine(g).length;return new d(f,i,g,m)}},this.openingBracketBlock=function(a,b,c,e){var f={row:c,column:e+1},g=a.$findClosingBracket(b,f);if(!g)return;var h=a.foldWidgets[g.row];return h==null&&(h=this.getFoldWidget(a,g.row)),h=="start"&&(g.row--,g.column=a.getLine(g.row).length),d.fromPoints(f,g)}}).call(e.prototype)}),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(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text").Mode,f=a("../tokenizer").Tokenizer,g=a("./javascript_highlight_rules").JavaScriptHighlightRules,h=a("./matching_brace_outdent").MatchingBraceOutdent,i=a("../range").Range,j=a("../worker/worker_client").WorkerClient,k=a("./behaviour/cstyle").CstyleBehaviour,l=a("./folding/cstyle").FoldMode,m=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h,this.$behaviour=new k,this.foldingRules=new l};d.inherits(m,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=/^(\s*)\/\//;for(var g=c;g<=d;g++)if(!f.test(b.getLine(g))){e=!1;break}if(e){var h=new i(0,0,0,0);for(var g=c;g<=d;g++){var j=b.getLine(g),k=j.match(f);h.start.row=g,h.end.row=g,h.end.column=k[0].length,b.replace(h,k[1])}}else b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"||a=="regex_allowed"){var h=b.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start"||a=="regex_allowed")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)},this.createWorker=function(a){var b=new j(["ace"],"worker-javascript.js","ace/mode/javascript_worker","JavaScriptWorker");return b.attachToDocument(a.getDocument()),b.on("jslint",function(b){var c=[];for(var d=0;d<b.data.length;d++){var e=b.data[d];e&&c.push({row:e.line-1,column:e.character-1,text:e.reason,type:"warning",lint:e})}a.setAnnotations(c)}),b.on("narcissus",function(b){a.setAnnotations([b.data])}),b.on("terminate",function(){a.clearAnnotations()}),b}}.call(m.prototype),b.Mode=m}),define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/unicode","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("../lib/lang"),f=a("../unicode"),g=a("./doc_comment_highlight_rules").DocCommentHighlightRules,h=a("./text_highlight_rules").TextHighlightRules,i=function(){var a=e.arrayToMap("Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document".split("|")),b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|const|yield|import|get|set".split("|")),c="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield",d=e.arrayToMap("__parent__|__count__|escape|unescape|with|__proto__".split("|")),h=e.arrayToMap("const|let|var|function".split("|")),i=e.arrayToMap("null|Infinity|NaN|undefined".split("|")),j=e.arrayToMap("class|enum|extends|super|export|implements|private|public|interface|package|protected|static".split("|")),k="["+f.packages.L+"\\$_]["+f.packages.L+f.packages.Mn+f.packages.Mc+f.packages.Nd+f.packages.Pc+"\\$_]*\\b",l="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)";this.$rules={start:[{token:"comment",regex:/\/\/.*$/},g.getStartRule("doc-start"),{token:"comment",merge:!0,regex:/\/\*/,next:"comment"},{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0[xX][0-9a-fA-F]+\b/},{token:"constant.numeric",regex:/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+k+")(\\.)(prototype)(\\.)("+k+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator","text"],regex:"("+k+")(\\.)(prototype)(\\.)("+k+")(\\s*)(=)(\\s*)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+k+")(\\.)("+k+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+k+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+k+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+k+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"constant.language.boolean",regex:/(?:true|false)\b/},{token:"keyword",regex:"(?:"+c+")\\b",next:"regex_allowed"},{token:["punctuation.operator","support.function"],regex:/(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:["punctuation.operator","support.function.dom"],regex:/(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:["punctuation.operator","support.constant"],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/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/},{token:function(c){return a.hasOwnProperty(c)?"variable.language":d.hasOwnProperty(c)?"invalid.deprecated":h.hasOwnProperty(c)?"storage.type":b.hasOwnProperty(c)?"keyword":i.hasOwnProperty(c)?"constant.language":j.hasOwnProperty(c)?"invalid.illegal":c=="debugger"?"invalid.deprecated":"identifier"},regex:k},{token:"keyword.operator",regex:/!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,next:"regex_allowed"},{token:"punctuation.operator",regex:/\?|\:|\,|\;|\./,next:"regex_allowed"},{token:"paren.lparen",regex:/[\[({]/,next:"regex_allowed"},{token:"paren.rparen",regex:/[\])}]/},{token:"keyword.operator",regex:/\/=?/,next:"regex_allowed"},{token:"comment",regex:/^#!.*$/},{token:"text",regex:/\s+/}],regex_allowed:[g.getStartRule("doc-start"),{token:"comment",merge:!0,regex:"\\/\\*",next:"comment_regex_allowed"},{token:"comment",regex:"\\/\\/.*$"},{token:"string.regexp",regex:"\\/",next:"regex",merge:!0},{token:"text",regex:"\\s+"},{token:"empty",regex:"",next:"start"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/\\w*",next:"start",merge:!0},{token:"string.regexp",regex:"[^\\\\/\\[]+",merge:!0},{token:"string.regexp.charachterclass",regex:"\\[",next:"regex_character_class",merge:!0},{token:"empty",regex:"",next:"start"}],regex_character_class:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp.charachterclass",regex:"]",next:"regex",merge:!0},{token:"string.regexp.charachterclass",regex:"[^\\\\\\]]+",merge:!0},{token:"empty",regex:"",next:"start"}],function_arguments:[{token:"variable.parameter",regex:k},{token:"punctuation.operator",regex:"[, ]+",merge:!0},{token:"punctuation.operator",regex:"$",merge:!0},{token:"empty",regex:"",next:"start"}],comment_regex_allowed:[{token:"comment",regex:".*?\\*\\/",merge:!0,next:"regex_allowed"},{token:"comment",merge:!0,regex:".+"}],comment:[{token:"comment",regex:".*?\\*\\/",merge:!0,next:"start"},{token:"comment",merge:!0,regex:".+"}],qqstring:[{token:"constant.language.escape",regex:l},{token:"string",regex:'[^"\\\\]+',merge:!0},{token:"string",regex:"\\\\$",next:"qqstring",merge:!0},{token:"string",regex:'"|$',next:"start",merge:!0}],qstring:[{token:"constant.language.escape",regex:l},{token:"string",regex:"[^'\\\\]+",merge:!0},{token:"string",regex:"\\\\$",next:"qstring",merge:!0},{token:"string",regex:"'|$",next:"start",merge:!0}]},this.embedRules(g,"doc-",[g.getEndRule("start")])};d.inherits(i,h),b.JavaScriptHighlightRules=i}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",merge:!0,regex:"\\s+"},{token:"comment.doc",merge:!0,regex:"TODO"},{token:"comment.doc",merge:!0,regex:"[^@\\*]+"},{token:"comment.doc",merge:!0,regex:"."}]}};d.inherits(f,e),f.getStartRule=function(a){return{token:"comment.doc",merge:!0,regex:"\\/\\*(?=\\*)",next:a}},f.getEndRule=function(a){return{token:"comment.doc",merge:!0,regex:"\\*\\/",next:a}},b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){"use strict";var d=a("../range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){return/^\s+$/.test(a)?/^\s*\}/.test(b):!1},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);return b?b[1]:""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../../range").Range,f=a("./fold_mode").FoldMode,g=b.FoldMode=function(){};d.inherits(g,f),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(a,b,c){var d=a.getLine(c),f=d.match(this.foldingStartMarker);if(f){var g=f.index;if(f[1])return this.openingBracketBlock(a,f[1],c,g);var h=a.getCommentFoldRange(c,g+f[0].length);return h.end.column-=2,h}if(b!=="markbeginend")return;var f=d.match(this.foldingStopMarker);if(f){var g=f.index+f[0].length;if(f[2]){var h=a.getCommentFoldRange(c,g);return h.end.column-=2,h}var i={row:c,column:g},j=a.$findOpeningBracket(f[1],i);if(!j)return;return j.column++,i.column--,e.fromPoints(j,i)}}}.call(g.prototype)}),define("ace/mode/svg_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules","ace/mode/xml_util"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./javascript_highlight_rules").JavaScriptHighlightRules,f=a("./xml_highlight_rules").XmlHighlightRules,g=a("./xml_util"),h=function(){f.call(this),this.$rules.start.splice(3,0,{token:"meta.tag",regex:"<(?=s*script)",next:"script"}),g.tag(this.$rules,"script","js-start"),this.embedRules(e,"js-",[{token:"comment",regex:"\\/\\/.*(?=<\\/script>)",next:"tag"},{token:"meta.tag",regex:"<\\/(?=script)",next:"tag"}])};d.inherits(h,f),b.SvgHighlightRules=h}),define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("./fold_mode").FoldMode,f=b.FoldMode=function(a,b){this.defaultMode=a,this.subModes=b};d.inherits(f,e),function(){this.$getMode=function(a){for(var b in this.subModes)if(a.indexOf(b)===0)return this.subModes[b];return null},this.$tryMode=function(a,b,c,d){var e=this.$getMode(a);return e?e.getFoldWidget(b,c,d):""},this.getFoldWidget=function(a,b,c){return this.$tryMode(a.getState(c-1),a,b,c)||this.$tryMode(a.getState(c),a,b,c)||this.defaultMode.getFoldWidget(a,b,c)},this.getFoldWidgetRange=function(a,b,c){var d=this.$getMode(a.getState(c-1));if(!d||!d.getFoldWidget(a,b,c))d=this.$getMode(a.getState(c));if(!d||!d.getFoldWidget(a,b,c))d=this.defaultMode;return d.getFoldWidgetRange(a,b,c)}}.call(f.prototype)})
1
+ /* ***** BEGIN LICENSE BLOCK *****
2
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3
+ *
4
+ * The contents of this file are subject to the Mozilla Public License Version
5
+ * 1.1 (the "License"); you may not use this file except in compliance with
6
+ * the License. You may obtain a copy of the License at
7
+ * http://www.mozilla.org/MPL/
8
+ *
9
+ * Software distributed under the License is distributed on an "AS IS" basis,
10
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
+ * for the specific language governing rights and limitations under the
12
+ * License.
13
+ *
14
+ * The Original Code is Ajax.org Code Editor (ACE).
15
+ *
16
+ * The Initial Developer of the Original Code is
17
+ * Ajax.org B.V.
18
+ * Portions created by the Initial Developer are Copyright (C) 2010
19
+ * the Initial Developer. All Rights Reserved.
20
+ *
21
+ * Contributor(s):
22
+ * Fabian Jakobs <fabian AT ajax DOT org>
23
+ *
24
+ * Alternatively, the contents of this file may be used under the terms of
25
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
26
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
+ * in which case the provisions of the GPL or the LGPL are applicable instead
28
+ * of those above. If you wish to allow use of your version of this file only
29
+ * under the terms of either the GPL or the LGPL, and not to allow others to
30
+ * use your version of this file under the terms of the MPL, indicate your
31
+ * decision by deleting the provisions above and replace them with the notice
32
+ * and other provisions required by the GPL or the LGPL. If you do not delete
33
+ * the provisions above, a recipient may use your version of this file under
34
+ * the terms of any one of the MPL, the GPL or the LGPL.
35
+ *
36
+ * ***** END LICENSE BLOCK ***** */
37
+
38
+ define('ace/mode/svg', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/svg_highlight_rules', 'ace/mode/folding/mixed', 'ace/mode/folding/xml', 'ace/mode/folding/cstyle'], function(require, exports, module) {
39
+
40
+
41
+ var oop = require("../lib/oop");
42
+ var XmlMode = require("./xml").Mode;
43
+ var JavaScriptMode = require("./javascript").Mode;
44
+ var Tokenizer = require("../tokenizer").Tokenizer;
45
+ var SvgHighlightRules = require("./svg_highlight_rules").SvgHighlightRules;
46
+ var MixedFoldMode = require("./folding/mixed").FoldMode;
47
+ var XmlFoldMode = require("./folding/xml").FoldMode;
48
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
49
+
50
+ var Mode = function() {
51
+ XmlMode.call(this);
52
+
53
+ this.highlighter = new SvgHighlightRules();
54
+ this.$tokenizer = new Tokenizer(this.highlighter.getRules());
55
+
56
+ this.$embeds = this.highlighter.getEmbeds();
57
+ this.createModeDelegates({
58
+ "js-": JavaScriptMode
59
+ });
60
+
61
+ this.foldingRules = new MixedFoldMode(new XmlFoldMode({}), {
62
+ "js-": new CStyleFoldMode()
63
+ });
64
+ };
65
+
66
+ oop.inherits(Mode, XmlMode);
67
+
68
+ (function() {
69
+
70
+ this.getNextLineIndent = function(state, line, tab) {
71
+ return this.$getIndent(line);
72
+ };
73
+
74
+
75
+ }).call(Mode.prototype);
76
+
77
+ exports.Mode = Mode;
78
+ });
79
+
80
+ define('ace/mode/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/xml_highlight_rules', 'ace/mode/behaviour/xml', 'ace/mode/folding/xml'], function(require, exports, module) {
81
+
82
+
83
+ var oop = require("../lib/oop");
84
+ var TextMode = require("./text").Mode;
85
+ var Tokenizer = require("../tokenizer").Tokenizer;
86
+ var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
87
+ var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
88
+ var XmlFoldMode = require("./folding/xml").FoldMode;
89
+
90
+ var Mode = function() {
91
+ this.$tokenizer = new Tokenizer(new XmlHighlightRules().getRules());
92
+ this.$behaviour = new XmlBehaviour();
93
+ this.foldingRules = new XmlFoldMode();
94
+ };
95
+
96
+ oop.inherits(Mode, TextMode);
97
+
98
+ (function() {
99
+
100
+ this.getNextLineIndent = function(state, line, tab) {
101
+ return this.$getIndent(line);
102
+ };
103
+
104
+ }).call(Mode.prototype);
105
+
106
+ exports.Mode = Mode;
107
+ });
108
+
109
+ 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) {
110
+
111
+
112
+ var oop = require("../lib/oop");
113
+ var xmlUtil = require("./xml_util");
114
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
115
+
116
+ var XmlHighlightRules = function() {
117
+
118
+ // regexp must not have capturing parentheses
119
+ // regexps are ordered -> the first match is used
120
+ this.$rules = {
121
+ start : [{
122
+ token : "text",
123
+ regex : "<\\!\\[CDATA\\[",
124
+ next : "cdata"
125
+ }, {
126
+ token : "xml_pe",
127
+ regex : "<\\?.*?\\?>"
128
+ }, {
129
+ token : "comment",
130
+ merge : true,
131
+ regex : "<\\!--",
132
+ next : "comment"
133
+ }, {
134
+ token : "xml_pe",
135
+ regex : "<\\!.*?>"
136
+ }, {
137
+ token : "meta.tag", // opening tag
138
+ regex : "<\\/?",
139
+ next : "tag"
140
+ }, {
141
+ token : "text",
142
+ regex : "\\s+"
143
+ }, {
144
+ token : "constant.character.entity",
145
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
146
+ }, {
147
+ token : "text",
148
+ regex : "[^<]+"
149
+ }],
150
+
151
+ cdata : [{
152
+ token : "text",
153
+ regex : "\\]\\]>",
154
+ next : "start"
155
+ }, {
156
+ token : "text",
157
+ regex : "\\s+"
158
+ }, {
159
+ token : "text",
160
+ regex : "(?:[^\\]]|\\](?!\\]>))+"
161
+ }],
162
+
163
+ comment : [{
164
+ token : "comment",
165
+ regex : ".*?-->",
166
+ next : "start"
167
+ }, {
168
+ token : "comment",
169
+ merge : true,
170
+ regex : ".+"
171
+ }]
172
+ };
173
+
174
+ xmlUtil.tag(this.$rules, "tag", "start");
175
+ };
176
+
177
+ oop.inherits(XmlHighlightRules, TextHighlightRules);
178
+
179
+ exports.XmlHighlightRules = XmlHighlightRules;
180
+ });
181
+
182
+ define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
183
+
184
+
185
+ function string(state) {
186
+ return [{
187
+ token : "string",
188
+ regex : '".*?"'
189
+ }, {
190
+ token : "string", // multi line string start
191
+ merge : true,
192
+ regex : '["].*',
193
+ next : state + "_qqstring"
194
+ }, {
195
+ token : "string",
196
+ regex : "'.*?'"
197
+ }, {
198
+ token : "string", // multi line string start
199
+ merge : true,
200
+ regex : "['].*",
201
+ next : state + "_qstring"
202
+ }];
203
+ }
204
+
205
+ function multiLineString(quote, state) {
206
+ return [{
207
+ token : "string",
208
+ merge : true,
209
+ regex : ".*?" + quote,
210
+ next : state
211
+ }, {
212
+ token : "string",
213
+ merge : true,
214
+ regex : '.+'
215
+ }];
216
+ }
217
+
218
+ exports.tag = function(states, name, nextState, tagMap) {
219
+ states[name] = [{
220
+ token : "text",
221
+ regex : "\\s+"
222
+ }, {
223
+ //token : "meta.tag",
224
+
225
+ token : !tagMap ? "meta.tag.tag-name" : function(value) {
226
+ if (tagMap[value])
227
+ return "meta.tag.tag-name." + tagMap[value];
228
+ else
229
+ return "meta.tag.tag-name";
230
+ },
231
+ merge : true,
232
+ regex : "[-_a-zA-Z0-9:]+",
233
+ next : name + "_embed_attribute_list"
234
+ }, {
235
+ token: "empty",
236
+ regex: "",
237
+ next : name + "_embed_attribute_list"
238
+ }];
239
+
240
+ states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
241
+ states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
242
+
243
+ states[name + "_embed_attribute_list"] = [{
244
+ token : "meta.tag",
245
+ merge : true,
246
+ regex : "\/?>",
247
+ next : nextState
248
+ }, {
249
+ token : "keyword.operator",
250
+ regex : "="
251
+ }, {
252
+ token : "entity.other.attribute-name",
253
+ regex : "[-_a-zA-Z0-9:]+"
254
+ }, {
255
+ token : "constant.numeric", // float
256
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
257
+ }, {
258
+ token : "text",
259
+ regex : "\\s+"
260
+ }].concat(string(name));
261
+ };
262
+
263
+ });
264
+
265
+ 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) {
266
+
267
+
268
+ var oop = require("../../lib/oop");
269
+ var Behaviour = require("../behaviour").Behaviour;
270
+ var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
271
+ var TokenIterator = require("../../token_iterator").TokenIterator;
272
+
273
+ function hasType(token, type) {
274
+ var hasType = true;
275
+ var typeList = token.type.split('.');
276
+ var needleList = type.split('.');
277
+ needleList.forEach(function(needle){
278
+ if (typeList.indexOf(needle) == -1) {
279
+ hasType = false;
280
+ return false;
281
+ }
282
+ });
283
+ return hasType;
284
+ }
285
+
286
+ var XmlBehaviour = function () {
287
+
288
+ this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
289
+
290
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
291
+ if (text == '>') {
292
+ var position = editor.getCursorPosition();
293
+ var iterator = new TokenIterator(session, position.row, position.column);
294
+ var token = iterator.getCurrentToken();
295
+ var atCursor = false;
296
+ if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
297
+ do {
298
+ token = iterator.stepBackward();
299
+ } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
300
+ } else {
301
+ atCursor = true;
302
+ }
303
+ if (!token || !hasType(token, 'meta.tag-name') || iterator.stepBackward().value.match('/')) {
304
+ return
305
+ }
306
+ var tag = token.value;
307
+ if (atCursor){
308
+ var tag = tag.substring(0, position.column - token.start);
309
+ }
310
+
311
+ return {
312
+ text: '>' + '</' + tag + '>',
313
+ selection: [1, 1]
314
+ }
315
+ }
316
+ });
317
+
318
+ this.add('autoindent', 'insertion', function (state, action, editor, session, text) {
319
+ if (text == "\n") {
320
+ var cursor = editor.getCursorPosition();
321
+ var line = session.doc.getLine(cursor.row);
322
+ var rightChars = line.substring(cursor.column, cursor.column + 2);
323
+ if (rightChars == '</') {
324
+ var indent = this.$getIndent(session.doc.getLine(cursor.row)) + session.getTabString();
325
+ var next_indent = this.$getIndent(session.doc.getLine(cursor.row));
326
+
327
+ return {
328
+ text: '\n' + indent + '\n' + next_indent,
329
+ selection: [1, indent.length, 1, indent.length]
330
+ }
331
+ }
332
+ }
333
+ });
334
+
335
+ }
336
+ oop.inherits(XmlBehaviour, Behaviour);
337
+
338
+ exports.XmlBehaviour = XmlBehaviour;
339
+ });
340
+
341
+ define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
342
+
343
+
344
+ var oop = require("../../lib/oop");
345
+ var Behaviour = require("../behaviour").Behaviour;
346
+
347
+ var CstyleBehaviour = function () {
348
+
349
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
350
+ if (text == '{') {
351
+ var selection = editor.getSelectionRange();
352
+ var selected = session.doc.getTextRange(selection);
353
+ if (selected !== "") {
354
+ return {
355
+ text: '{' + selected + '}',
356
+ selection: false
357
+ };
358
+ } else {
359
+ return {
360
+ text: '{}',
361
+ selection: [1, 1]
362
+ };
363
+ }
364
+ } else if (text == '}') {
365
+ var cursor = editor.getCursorPosition();
366
+ var line = session.doc.getLine(cursor.row);
367
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
368
+ if (rightChar == '}') {
369
+ var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
370
+ if (matching !== null) {
371
+ return {
372
+ text: '',
373
+ selection: [1, 1]
374
+ };
375
+ }
376
+ }
377
+ } else if (text == "\n") {
378
+ var cursor = editor.getCursorPosition();
379
+ var line = session.doc.getLine(cursor.row);
380
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
381
+ if (rightChar == '}') {
382
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
383
+ if (!openBracePos)
384
+ return null;
385
+
386
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
387
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
388
+
389
+ return {
390
+ text: '\n' + indent + '\n' + next_indent,
391
+ selection: [1, indent.length, 1, indent.length]
392
+ };
393
+ }
394
+ }
395
+ });
396
+
397
+ this.add("braces", "deletion", function (state, action, editor, session, range) {
398
+ var selected = session.doc.getTextRange(range);
399
+ if (!range.isMultiLine() && selected == '{') {
400
+ var line = session.doc.getLine(range.start.row);
401
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
402
+ if (rightChar == '}') {
403
+ range.end.column++;
404
+ return range;
405
+ }
406
+ }
407
+ });
408
+
409
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
410
+ if (text == '(') {
411
+ var selection = editor.getSelectionRange();
412
+ var selected = session.doc.getTextRange(selection);
413
+ if (selected !== "") {
414
+ return {
415
+ text: '(' + selected + ')',
416
+ selection: false
417
+ };
418
+ } else {
419
+ return {
420
+ text: '()',
421
+ selection: [1, 1]
422
+ };
423
+ }
424
+ } else if (text == ')') {
425
+ var cursor = editor.getCursorPosition();
426
+ var line = session.doc.getLine(cursor.row);
427
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
428
+ if (rightChar == ')') {
429
+ var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
430
+ if (matching !== null) {
431
+ return {
432
+ text: '',
433
+ selection: [1, 1]
434
+ };
435
+ }
436
+ }
437
+ }
438
+ });
439
+
440
+ this.add("parens", "deletion", function (state, action, editor, session, range) {
441
+ var selected = session.doc.getTextRange(range);
442
+ if (!range.isMultiLine() && selected == '(') {
443
+ var line = session.doc.getLine(range.start.row);
444
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
445
+ if (rightChar == ')') {
446
+ range.end.column++;
447
+ return range;
448
+ }
449
+ }
450
+ });
451
+
452
+ this.add("brackets", "insertion", function (state, action, editor, session, text) {
453
+ if (text == '[') {
454
+ var selection = editor.getSelectionRange();
455
+ var selected = session.doc.getTextRange(selection);
456
+ if (selected !== "") {
457
+ return {
458
+ text: '[' + selected + ']',
459
+ selection: false
460
+ };
461
+ } else {
462
+ return {
463
+ text: '[]',
464
+ selection: [1, 1]
465
+ };
466
+ }
467
+ } else if (text == ']') {
468
+ var cursor = editor.getCursorPosition();
469
+ var line = session.doc.getLine(cursor.row);
470
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
471
+ if (rightChar == ']') {
472
+ var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
473
+ if (matching !== null) {
474
+ return {
475
+ text: '',
476
+ selection: [1, 1]
477
+ };
478
+ }
479
+ }
480
+ }
481
+ });
482
+
483
+ this.add("brackets", "deletion", function (state, action, editor, session, range) {
484
+ var selected = session.doc.getTextRange(range);
485
+ if (!range.isMultiLine() && selected == '[') {
486
+ var line = session.doc.getLine(range.start.row);
487
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
488
+ if (rightChar == ']') {
489
+ range.end.column++;
490
+ return range;
491
+ }
492
+ }
493
+ });
494
+
495
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
496
+ if (text == '"' || text == "'") {
497
+ var quote = text;
498
+ var selection = editor.getSelectionRange();
499
+ var selected = session.doc.getTextRange(selection);
500
+ if (selected !== "") {
501
+ return {
502
+ text: quote + selected + quote,
503
+ selection: false
504
+ };
505
+ } else {
506
+ var cursor = editor.getCursorPosition();
507
+ var line = session.doc.getLine(cursor.row);
508
+ var leftChar = line.substring(cursor.column-1, cursor.column);
509
+
510
+ // We're escaped.
511
+ if (leftChar == '\\') {
512
+ return null;
513
+ }
514
+
515
+ // Find what token we're inside.
516
+ var tokens = session.getTokens(selection.start.row);
517
+ var col = 0, token;
518
+ var quotepos = -1; // Track whether we're inside an open quote.
519
+
520
+ for (var x = 0; x < tokens.length; x++) {
521
+ token = tokens[x];
522
+ if (token.type == "string") {
523
+ quotepos = -1;
524
+ } else if (quotepos < 0) {
525
+ quotepos = token.value.indexOf(quote);
526
+ }
527
+ if ((token.value.length + col) > selection.start.column) {
528
+ break;
529
+ }
530
+ col += tokens[x].value.length;
531
+ }
532
+
533
+ // Try and be smart about when we auto insert.
534
+ if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
535
+ return {
536
+ text: quote + quote,
537
+ selection: [1,1]
538
+ };
539
+ } else if (token && token.type === "string") {
540
+ // Ignore input and move right one if we're typing over the closing quote.
541
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
542
+ if (rightChar == quote) {
543
+ return {
544
+ text: '',
545
+ selection: [1, 1]
546
+ };
547
+ }
548
+ }
549
+ }
550
+ }
551
+ });
552
+
553
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
554
+ var selected = session.doc.getTextRange(range);
555
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
556
+ var line = session.doc.getLine(range.start.row);
557
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
558
+ if (rightChar == '"') {
559
+ range.end.column++;
560
+ return range;
561
+ }
562
+ }
563
+ });
564
+
565
+ };
566
+
567
+ oop.inherits(CstyleBehaviour, Behaviour);
568
+
569
+ exports.CstyleBehaviour = CstyleBehaviour;
570
+ });
571
+
572
+ 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) {
573
+
574
+
575
+ var oop = require("../../lib/oop");
576
+ var lang = require("../../lib/lang");
577
+ var Range = require("../../range").Range;
578
+ var BaseFoldMode = require("./fold_mode").FoldMode;
579
+ var TokenIterator = require("../../token_iterator").TokenIterator;
580
+
581
+ var FoldMode = exports.FoldMode = function(voidElements) {
582
+ BaseFoldMode.call(this);
583
+ this.voidElements = voidElements || {};
584
+ };
585
+ oop.inherits(FoldMode, BaseFoldMode);
586
+
587
+ (function() {
588
+
589
+ this.getFoldWidget = function(session, foldStyle, row) {
590
+ var tag = this._getFirstTagInLine(session, row);
591
+
592
+ if (tag.closing)
593
+ return foldStyle == "markbeginend" ? "end" : "";
594
+
595
+ if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()])
596
+ return "";
597
+
598
+ if (tag.selfClosing)
599
+ return "";
600
+
601
+ if (tag.value.indexOf("/" + tag.tagName) !== -1)
602
+ return "";
603
+
604
+ return "start";
605
+ };
606
+
607
+ this._getFirstTagInLine = function(session, row) {
608
+ var tokens = session.getTokens(row);
609
+ var value = "";
610
+ for (var i = 0; i < tokens.length; i++) {
611
+ var token = tokens[i];
612
+ if (token.type.indexOf("meta.tag") === 0)
613
+ value += token.value;
614
+ else
615
+ value += lang.stringRepeat(" ", token.value.length);
616
+ }
617
+
618
+ return this._parseTag(value);
619
+ };
620
+
621
+ this.tagRe = /^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;
622
+ this._parseTag = function(tag) {
623
+
624
+ var match = this.tagRe.exec(tag);
625
+ var column = this.tagRe.lastIndex || 0;
626
+ this.tagRe.lastIndex = 0;
627
+
628
+ return {
629
+ value: tag,
630
+ match: match ? match[2] : "",
631
+ closing: match ? !!match[3] : false,
632
+ selfClosing: match ? !!match[5] || match[2] == "/>" : false,
633
+ tagName: match ? match[4] : "",
634
+ column: match[1] ? column + match[1].length : column
635
+ };
636
+ };
637
+ this._readTagForward = function(iterator) {
638
+ var token = iterator.getCurrentToken();
639
+ if (!token)
640
+ return null;
641
+
642
+ var value = "";
643
+ var start;
644
+
645
+ do {
646
+ if (token.type.indexOf("meta.tag") === 0) {
647
+ if (!start) {
648
+ var start = {
649
+ row: iterator.getCurrentTokenRow(),
650
+ column: iterator.getCurrentTokenColumn()
651
+ };
652
+ }
653
+ value += token.value;
654
+ if (value.indexOf(">") !== -1) {
655
+ var tag = this._parseTag(value);
656
+ tag.start = start;
657
+ tag.end = {
658
+ row: iterator.getCurrentTokenRow(),
659
+ column: iterator.getCurrentTokenColumn() + token.value.length
660
+ };
661
+ iterator.stepForward();
662
+ return tag;
663
+ }
664
+ }
665
+ } while(token = iterator.stepForward());
666
+
667
+ return null;
668
+ };
669
+
670
+ this._readTagBackward = function(iterator) {
671
+ var token = iterator.getCurrentToken();
672
+ if (!token)
673
+ return null;
674
+
675
+ var value = "";
676
+ var end;
677
+
678
+ do {
679
+ if (token.type.indexOf("meta.tag") === 0) {
680
+ if (!end) {
681
+ end = {
682
+ row: iterator.getCurrentTokenRow(),
683
+ column: iterator.getCurrentTokenColumn() + token.value.length
684
+ };
685
+ }
686
+ value = token.value + value;
687
+ if (value.indexOf("<") !== -1) {
688
+ var tag = this._parseTag(value);
689
+ tag.end = end;
690
+ tag.start = {
691
+ row: iterator.getCurrentTokenRow(),
692
+ column: iterator.getCurrentTokenColumn()
693
+ };
694
+ iterator.stepBackward();
695
+ return tag;
696
+ }
697
+ }
698
+ } while(token = iterator.stepBackward());
699
+
700
+ return null;
701
+ };
702
+
703
+ this._pop = function(stack, tag) {
704
+ while (stack.length) {
705
+
706
+ var top = stack[stack.length-1];
707
+ if (!tag || top.tagName == tag.tagName) {
708
+ return stack.pop();
709
+ }
710
+ else if (this.voidElements[tag.tagName]) {
711
+ return;
712
+ }
713
+ else if (this.voidElements[top.tagName]) {
714
+ stack.pop();
715
+ continue;
716
+ } else {
717
+ return null;
718
+ }
719
+ }
720
+ };
721
+
722
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
723
+ var firstTag = this._getFirstTagInLine(session, row);
724
+
725
+ if (!firstTag.match)
726
+ return null;
727
+
728
+ var isBackward = firstTag.closing || firstTag.selfClosing;
729
+ var stack = [];
730
+ var tag;
731
+
732
+ if (!isBackward) {
733
+ var iterator = new TokenIterator(session, row, firstTag.column);
734
+ var start = {
735
+ row: row,
736
+ column: firstTag.column + firstTag.tagName.length + 2
737
+ };
738
+ while (tag = this._readTagForward(iterator)) {
739
+ if (tag.selfClosing) {
740
+ if (!stack.length) {
741
+ tag.start.column += tag.tagName.length + 2;
742
+ tag.end.column -= 2;
743
+ return Range.fromPoints(tag.start, tag.end);
744
+ } else
745
+ continue;
746
+ }
747
+
748
+ if (tag.closing) {
749
+ this._pop(stack, tag);
750
+ if (stack.length == 0)
751
+ return Range.fromPoints(start, tag.start);
752
+ }
753
+ else {
754
+ stack.push(tag)
755
+ }
756
+ }
757
+ }
758
+ else {
759
+ var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
760
+ var end = {
761
+ row: row,
762
+ column: firstTag.column
763
+ };
764
+
765
+ while (tag = this._readTagBackward(iterator)) {
766
+ if (tag.selfClosing) {
767
+ if (!stack.length) {
768
+ tag.start.column += tag.tagName.length + 2;
769
+ tag.end.column -= 2;
770
+ return Range.fromPoints(tag.start, tag.end);
771
+ } else
772
+ continue;
773
+ }
774
+
775
+ if (!tag.closing) {
776
+ this._pop(stack, tag);
777
+ if (stack.length == 0) {
778
+ tag.start.column += tag.tagName.length + 2;
779
+ return Range.fromPoints(tag.start, end);
780
+ }
781
+ }
782
+ else {
783
+ stack.push(tag)
784
+ }
785
+ }
786
+ }
787
+
788
+ };
789
+
790
+ }).call(FoldMode.prototype);
791
+
792
+ });
793
+
794
+ define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
795
+
796
+
797
+ var Range = require("../../range").Range;
798
+
799
+ var FoldMode = exports.FoldMode = function() {};
800
+
801
+ (function() {
802
+
803
+ this.foldingStartMarker = null;
804
+ this.foldingStopMarker = null;
805
+
806
+ // must return "" if there's no fold, to enable caching
807
+ this.getFoldWidget = function(session, foldStyle, row) {
808
+ var line = session.getLine(row);
809
+ if (this.foldingStartMarker.test(line))
810
+ return "start";
811
+ if (foldStyle == "markbeginend"
812
+ && this.foldingStopMarker
813
+ && this.foldingStopMarker.test(line))
814
+ return "end";
815
+ return "";
816
+ };
817
+
818
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
819
+ return null;
820
+ };
821
+
822
+ this.indentationBlock = function(session, row, column) {
823
+ var re = /\S/;
824
+ var line = session.getLine(row);
825
+ var startLevel = line.search(re);
826
+ if (startLevel == -1)
827
+ return;
828
+
829
+ var startColumn = column || line.length;
830
+ var maxRow = session.getLength();
831
+ var startRow = row;
832
+ var endRow = row;
833
+
834
+ while (++row < maxRow) {
835
+ var level = session.getLine(row).search(re);
836
+
837
+ if (level == -1)
838
+ continue;
839
+
840
+ if (level <= startLevel)
841
+ break;
842
+
843
+ endRow = row;
844
+ }
845
+
846
+ if (endRow > startRow) {
847
+ var endColumn = session.getLine(endRow).length;
848
+ return new Range(startRow, startColumn, endRow, endColumn);
849
+ }
850
+ };
851
+
852
+ this.openingBracketBlock = function(session, bracket, row, column, typeRe) {
853
+ var start = {row: row, column: column + 1};
854
+ var end = session.$findClosingBracket(bracket, start, typeRe);
855
+ if (!end)
856
+ return;
857
+
858
+ var fw = session.foldWidgets[end.row];
859
+ if (fw == null)
860
+ fw = this.getFoldWidget(session, end.row);
861
+
862
+ if (fw == "start" && end.row > start.row) {
863
+ end.row --;
864
+ end.column = session.getLine(end.row).length;
865
+ }
866
+ return Range.fromPoints(start, end);
867
+ };
868
+
869
+ }).call(FoldMode.prototype);
870
+
871
+ });
872
+
873
+ 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) {
874
+
875
+
876
+ var oop = require("../lib/oop");
877
+ var TextMode = require("./text").Mode;
878
+ var Tokenizer = require("../tokenizer").Tokenizer;
879
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
880
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
881
+ var Range = require("../range").Range;
882
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
883
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
884
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
885
+
886
+ var Mode = function() {
887
+ this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
888
+ this.$outdent = new MatchingBraceOutdent();
889
+ this.$behaviour = new CstyleBehaviour();
890
+ this.foldingRules = new CStyleFoldMode();
891
+ };
892
+ oop.inherits(Mode, TextMode);
893
+
894
+ (function() {
895
+
896
+
897
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
898
+ var outdent = true;
899
+ var re = /^(\s*)\/\//;
900
+
901
+ for (var i=startRow; i<= endRow; i++) {
902
+ if (!re.test(doc.getLine(i))) {
903
+ outdent = false;
904
+ break;
905
+ }
906
+ }
907
+
908
+ if (outdent) {
909
+ var deleteRange = new Range(0, 0, 0, 0);
910
+ for (var i=startRow; i<= endRow; i++)
911
+ {
912
+ var line = doc.getLine(i);
913
+ var m = line.match(re);
914
+ deleteRange.start.row = i;
915
+ deleteRange.end.row = i;
916
+ deleteRange.end.column = m[0].length;
917
+ doc.replace(deleteRange, m[1]);
918
+ }
919
+ }
920
+ else {
921
+ doc.indentRows(startRow, endRow, "//");
922
+ }
923
+ };
924
+
925
+ this.getNextLineIndent = function(state, line, tab) {
926
+ var indent = this.$getIndent(line);
927
+
928
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
929
+ var tokens = tokenizedLine.tokens;
930
+ var endState = tokenizedLine.state;
931
+
932
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
933
+ return indent;
934
+ }
935
+
936
+ if (state == "start" || state == "regex_allowed") {
937
+ var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
938
+ if (match) {
939
+ indent += tab;
940
+ }
941
+ } else if (state == "doc-start") {
942
+ if (endState == "start" || state == "regex_allowed") {
943
+ return "";
944
+ }
945
+ var match = line.match(/^\s*(\/?)\*/);
946
+ if (match) {
947
+ if (match[1]) {
948
+ indent += " ";
949
+ }
950
+ indent += "* ";
951
+ }
952
+ }
953
+
954
+ return indent;
955
+ };
956
+
957
+ this.checkOutdent = function(state, line, input) {
958
+ return this.$outdent.checkOutdent(line, input);
959
+ };
960
+
961
+ this.autoOutdent = function(state, doc, row) {
962
+ this.$outdent.autoOutdent(doc, row);
963
+ };
964
+
965
+ this.createWorker = function(session) {
966
+ var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
967
+ worker.attachToDocument(session.getDocument());
968
+
969
+ worker.on("jslint", function(results) {
970
+ var errors = [];
971
+ for (var i=0; i<results.data.length; i++) {
972
+ var error = results.data[i];
973
+ if (error)
974
+ errors.push({
975
+ row: error.line-1,
976
+ column: error.character-1,
977
+ text: error.reason,
978
+ type: "warning",
979
+ lint: error
980
+ });
981
+ }
982
+ session.setAnnotations(errors);
983
+ });
984
+
985
+ worker.on("narcissus", function(e) {
986
+ session.setAnnotations([e.data]);
987
+ });
988
+
989
+ worker.on("terminate", function() {
990
+ session.clearAnnotations();
991
+ });
992
+
993
+ return worker;
994
+ };
995
+
996
+ }).call(Mode.prototype);
997
+
998
+ exports.Mode = Mode;
999
+ });
1000
+
1001
+ define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
1002
+
1003
+
1004
+ var oop = require("../lib/oop");
1005
+ var lang = require("../lib/lang");
1006
+ var unicode = require("../unicode");
1007
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
1008
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1009
+
1010
+ var JavaScriptHighlightRules = function() {
1011
+
1012
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
1013
+ var globals = lang.arrayToMap(
1014
+ // Constructors
1015
+ ("Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" +
1016
+ // E4X
1017
+ "Namespace|QName|XML|XMLList|" +
1018
+ "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
1019
+ "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
1020
+ // Errors
1021
+ "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
1022
+ "SyntaxError|TypeError|URIError|" +
1023
+ // Non-constructor functions
1024
+ "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" +
1025
+ "isNaN|parseFloat|parseInt|" +
1026
+ // Other
1027
+ "JSON|Math|" +
1028
+ // Pseudo
1029
+ "this|arguments|prototype|window|document"
1030
+ ).split("|")
1031
+ );
1032
+
1033
+ var keywords = lang.arrayToMap(
1034
+ ("break|case|catch|continue|default|delete|do|else|finally|for|function|" +
1035
+ "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|" +
1036
+ "const|yield|import|get|set").split("|")
1037
+ );
1038
+
1039
+ // keywords which can be followed by regular expressions
1040
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
1041
+
1042
+ var deprecated = lang.arrayToMap(
1043
+ ("__parent__|__count__|escape|unescape|with|__proto__").split("|")
1044
+ );
1045
+
1046
+ var definitions = lang.arrayToMap(("const|let|var|function").split("|"));
1047
+
1048
+ var buildinConstants = lang.arrayToMap(
1049
+ ("null|Infinity|NaN|undefined").split("|")
1050
+ );
1051
+
1052
+ var futureReserved = lang.arrayToMap(
1053
+ ("class|enum|extends|super|export|implements|private|" +
1054
+ "public|interface|package|protected|static").split("|")
1055
+ );
1056
+
1057
+ // TODO: Unicode escape sequences
1058
+ var identifierRe = "[" + unicode.packages.L + "\\$_]["
1059
+ + unicode.packages.L
1060
+ + unicode.packages.Mn + unicode.packages.Mc
1061
+ + unicode.packages.Nd
1062
+ + unicode.packages.Pc + "\\$_]*\\b";
1063
+
1064
+ var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
1065
+ "u[0-9a-fA-F]{4}|" + // unicode
1066
+ "[0-2][0-7]{0,2}|" + // oct
1067
+ "3[0-6][0-7]?|" + // oct
1068
+ "37[0-7]?|" + // oct
1069
+ "[4-7][0-7]?|" + //oct
1070
+ ".)";
1071
+
1072
+ // regexp must not have capturing parentheses. Use (?:) instead.
1073
+ // regexps are ordered -> the first match is used
1074
+
1075
+ this.$rules = {
1076
+ "start" : [
1077
+ {
1078
+ token : "comment",
1079
+ regex : /\/\/.*$/
1080
+ },
1081
+ DocCommentHighlightRules.getStartRule("doc-start"),
1082
+ {
1083
+ token : "comment", // multi line comment
1084
+ merge : true,
1085
+ regex : /\/\*/,
1086
+ next : "comment"
1087
+ }, {
1088
+ token : "string",
1089
+ regex : "'(?=.)",
1090
+ next : "qstring"
1091
+ }, {
1092
+ token : "string",
1093
+ regex : '"(?=.)',
1094
+ next : "qqstring"
1095
+ }, {
1096
+ token : "constant.numeric", // hex
1097
+ regex : /0[xX][0-9a-fA-F]+\b/
1098
+ }, {
1099
+ token : "constant.numeric", // float
1100
+ regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
1101
+ }, { // match stuff like: Sound.prototype.play = function() { }
1102
+ token : [
1103
+ "storage.type",
1104
+ "punctuation.operator",
1105
+ "support.function",
1106
+ "punctuation.operator",
1107
+ "entity.name.function",
1108
+ "text",
1109
+ "keyword.operator",
1110
+ "text",
1111
+ "storage.type",
1112
+ "text",
1113
+ "paren.lparen"
1114
+ ],
1115
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
1116
+ next: "function_arguments"
1117
+ }, { // match stuff like: Sound.prototype.play = myfunc
1118
+ token : [
1119
+ "storage.type",
1120
+ "punctuation.operator",
1121
+ "support.function",
1122
+ "punctuation.operator",
1123
+ "entity.name.function",
1124
+ "text",
1125
+ "keyword.operator",
1126
+ "text"
1127
+ ],
1128
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
1129
+ next: "function_arguments"
1130
+ }, { // match stuff like: Sound.play = function() { }
1131
+ token : [
1132
+ "storage.type",
1133
+ "punctuation.operator",
1134
+ "entity.name.function",
1135
+ "text",
1136
+ "keyword.operator",
1137
+ "text",
1138
+ "storage.type",
1139
+ "text",
1140
+ "paren.lparen"
1141
+ ],
1142
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
1143
+ next: "function_arguments"
1144
+ }, { // match stuff like: play = function() { }
1145
+ token : [
1146
+ "entity.name.function",
1147
+ "text",
1148
+ "keyword.operator",
1149
+ "text",
1150
+ "storage.type",
1151
+ "text",
1152
+ "paren.lparen"
1153
+ ],
1154
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
1155
+ next: "function_arguments"
1156
+ }, { // match stuff like: Sound.play = function play() { }
1157
+ token : [
1158
+ "storage.type",
1159
+ "punctuation.operator",
1160
+ "entity.name.function",
1161
+ "text",
1162
+ "keyword.operator",
1163
+ "text",
1164
+ "storage.type",
1165
+ "text",
1166
+ "entity.name.function",
1167
+ "text",
1168
+ "paren.lparen"
1169
+ ],
1170
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
1171
+ next: "function_arguments"
1172
+ }, { // match regular function like: function myFunc(arg) { }
1173
+ token : [
1174
+ "storage.type",
1175
+ "text",
1176
+ "entity.name.function",
1177
+ "text",
1178
+ "paren.lparen"
1179
+ ],
1180
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
1181
+ next: "function_arguments"
1182
+ }, { // match stuff like: foobar: function() { }
1183
+ token : [
1184
+ "entity.name.function",
1185
+ "text",
1186
+ "punctuation.operator",
1187
+ "text",
1188
+ "storage.type",
1189
+ "text",
1190
+ "paren.lparen"
1191
+ ],
1192
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
1193
+ next: "function_arguments"
1194
+ }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
1195
+ token : [
1196
+ "text",
1197
+ "text",
1198
+ "storage.type",
1199
+ "text",
1200
+ "paren.lparen"
1201
+ ],
1202
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
1203
+ next: "function_arguments"
1204
+ }, {
1205
+ token : "constant.language.boolean",
1206
+ regex : /(?:true|false)\b/
1207
+ }, {
1208
+ token : "keyword",
1209
+ regex : "(?:" + kwBeforeRe + ")\\b",
1210
+ next : "regex_allowed"
1211
+ }, {
1212
+ token : ["punctuation.operator", "support.function"],
1213
+ regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
1214
+ }, {
1215
+ token : ["punctuation.operator", "support.function.dom"],
1216
+ regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
1217
+ }, {
1218
+ token : ["punctuation.operator", "support.constant"],
1219
+ 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/
1220
+ }, {
1221
+ token : ["storage.type", "punctuation.operator", "support.function.firebug"],
1222
+ regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
1223
+ }, {
1224
+ token : function(value) {
1225
+ if (globals.hasOwnProperty(value))
1226
+ return "variable.language";
1227
+ else if (deprecated.hasOwnProperty(value))
1228
+ return "invalid.deprecated";
1229
+ else if (definitions.hasOwnProperty(value))
1230
+ return "storage.type";
1231
+ else if (keywords.hasOwnProperty(value))
1232
+ return "keyword";
1233
+ else if (buildinConstants.hasOwnProperty(value))
1234
+ return "constant.language";
1235
+ else if (futureReserved.hasOwnProperty(value))
1236
+ return "invalid.illegal";
1237
+ else if (value == "debugger")
1238
+ return "invalid.deprecated";
1239
+ else
1240
+ return "identifier";
1241
+ },
1242
+ regex : identifierRe
1243
+ }, {
1244
+ token : "keyword.operator",
1245
+ regex : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
1246
+ next : "regex_allowed"
1247
+ }, {
1248
+ token : "punctuation.operator",
1249
+ regex : /\?|\:|\,|\;|\./,
1250
+ next : "regex_allowed"
1251
+ }, {
1252
+ token : "paren.lparen",
1253
+ regex : /[\[({]/,
1254
+ next : "regex_allowed"
1255
+ }, {
1256
+ token : "paren.rparen",
1257
+ regex : /[\])}]/
1258
+ }, {
1259
+ token : "keyword.operator",
1260
+ regex : /\/=?/,
1261
+ next : "regex_allowed"
1262
+ }, {
1263
+ token: "comment",
1264
+ regex: /^#!.*$/
1265
+ }, {
1266
+ token : "text",
1267
+ regex : /\s+/
1268
+ }
1269
+ ],
1270
+ // regular expressions are only allowed after certain tokens. This
1271
+ // makes sure we don't mix up regexps with the divison operator
1272
+ "regex_allowed": [
1273
+ DocCommentHighlightRules.getStartRule("doc-start"),
1274
+ {
1275
+ token : "comment", // multi line comment
1276
+ merge : true,
1277
+ regex : "\\/\\*",
1278
+ next : "comment_regex_allowed"
1279
+ }, {
1280
+ token : "comment",
1281
+ regex : "\\/\\/.*$"
1282
+ }, {
1283
+ token: "string.regexp",
1284
+ regex: "\\/",
1285
+ next: "regex",
1286
+ merge: true
1287
+ }, {
1288
+ token : "text",
1289
+ regex : "\\s+"
1290
+ }, {
1291
+ // immediately return to the start mode without matching
1292
+ // anything
1293
+ token: "empty",
1294
+ regex: "",
1295
+ next: "start"
1296
+ }
1297
+ ],
1298
+ "regex": [
1299
+ {
1300
+ token: "regexp.keyword.operator",
1301
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
1302
+ }, {
1303
+ // flag
1304
+ token: "string.regexp",
1305
+ regex: "/\\w*",
1306
+ next: "start",
1307
+ merge: true
1308
+ }, {
1309
+ token: "string.regexp",
1310
+ regex: "[^\\\\/\\[]+",
1311
+ merge: true
1312
+ }, {
1313
+ token: "string.regexp.charachterclass",
1314
+ regex: "\\[",
1315
+ next: "regex_character_class",
1316
+ merge: true
1317
+ }, {
1318
+ token: "empty",
1319
+ regex: "",
1320
+ next: "start"
1321
+ }
1322
+ ],
1323
+ "regex_character_class": [
1324
+ {
1325
+ token: "regexp.keyword.operator",
1326
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
1327
+ }, {
1328
+ token: "string.regexp.charachterclass",
1329
+ regex: "]",
1330
+ next: "regex",
1331
+ merge: true
1332
+ }, {
1333
+ token: "string.regexp.charachterclass",
1334
+ regex: "[^\\\\\\]]+",
1335
+ merge: true
1336
+ }, {
1337
+ token: "empty",
1338
+ regex: "",
1339
+ next: "start"
1340
+ }
1341
+ ],
1342
+ "function_arguments": [
1343
+ {
1344
+ token: "variable.parameter",
1345
+ regex: identifierRe
1346
+ }, {
1347
+ token: "punctuation.operator",
1348
+ regex: "[, ]+",
1349
+ merge: true
1350
+ }, {
1351
+ token: "punctuation.operator",
1352
+ regex: "$",
1353
+ merge: true
1354
+ }, {
1355
+ token: "empty",
1356
+ regex: "",
1357
+ next: "start"
1358
+ }
1359
+ ],
1360
+ "comment_regex_allowed" : [
1361
+ {
1362
+ token : "comment", // closing comment
1363
+ regex : ".*?\\*\\/",
1364
+ merge : true,
1365
+ next : "regex_allowed"
1366
+ }, {
1367
+ token : "comment", // comment spanning whole line
1368
+ merge : true,
1369
+ regex : ".+"
1370
+ }
1371
+ ],
1372
+ "comment" : [
1373
+ {
1374
+ token : "comment", // closing comment
1375
+ regex : ".*?\\*\\/",
1376
+ merge : true,
1377
+ next : "start"
1378
+ }, {
1379
+ token : "comment", // comment spanning whole line
1380
+ merge : true,
1381
+ regex : ".+"
1382
+ }
1383
+ ],
1384
+ "qqstring" : [
1385
+ {
1386
+ token : "constant.language.escape",
1387
+ regex : escapedRe
1388
+ }, {
1389
+ token : "string",
1390
+ regex : '[^"\\\\]+',
1391
+ merge : true
1392
+ }, {
1393
+ token : "string",
1394
+ regex : "\\\\$",
1395
+ next : "qqstring",
1396
+ merge : true
1397
+ }, {
1398
+ token : "string",
1399
+ regex : '"|$',
1400
+ next : "start",
1401
+ merge : true
1402
+ }
1403
+ ],
1404
+ "qstring" : [
1405
+ {
1406
+ token : "constant.language.escape",
1407
+ regex : escapedRe
1408
+ }, {
1409
+ token : "string",
1410
+ regex : "[^'\\\\]+",
1411
+ merge : true
1412
+ }, {
1413
+ token : "string",
1414
+ regex : "\\\\$",
1415
+ next : "qstring",
1416
+ merge : true
1417
+ }, {
1418
+ token : "string",
1419
+ regex : "'|$",
1420
+ next : "start",
1421
+ merge : true
1422
+ }
1423
+ ]
1424
+ };
1425
+
1426
+ this.embedRules(DocCommentHighlightRules, "doc-",
1427
+ [ DocCommentHighlightRules.getEndRule("start") ]);
1428
+ };
1429
+
1430
+ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
1431
+
1432
+ exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
1433
+ });
1434
+
1435
+ define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
1436
+
1437
+
1438
+ var oop = require("../lib/oop");
1439
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1440
+
1441
+ var DocCommentHighlightRules = function() {
1442
+
1443
+ this.$rules = {
1444
+ "start" : [ {
1445
+ token : "comment.doc.tag",
1446
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
1447
+ }, {
1448
+ token : "comment.doc",
1449
+ merge : true,
1450
+ regex : "\\s+"
1451
+ }, {
1452
+ token : "comment.doc",
1453
+ merge : true,
1454
+ regex : "TODO"
1455
+ }, {
1456
+ token : "comment.doc",
1457
+ merge : true,
1458
+ regex : "[^@\\*]+"
1459
+ }, {
1460
+ token : "comment.doc",
1461
+ merge : true,
1462
+ regex : "."
1463
+ }]
1464
+ };
1465
+ };
1466
+
1467
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
1468
+
1469
+ DocCommentHighlightRules.getStartRule = function(start) {
1470
+ return {
1471
+ token : "comment.doc", // doc comment
1472
+ merge : true,
1473
+ regex : "\\/\\*(?=\\*)",
1474
+ next : start
1475
+ };
1476
+ };
1477
+
1478
+ DocCommentHighlightRules.getEndRule = function (start) {
1479
+ return {
1480
+ token : "comment.doc", // closing comment
1481
+ merge : true,
1482
+ regex : "\\*\\/",
1483
+ next : start
1484
+ };
1485
+ };
1486
+
1487
+
1488
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
1489
+
1490
+ });
1491
+
1492
+ define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
1493
+
1494
+
1495
+ var Range = require("../range").Range;
1496
+
1497
+ var MatchingBraceOutdent = function() {};
1498
+
1499
+ (function() {
1500
+
1501
+ this.checkOutdent = function(line, input) {
1502
+ if (! /^\s+$/.test(line))
1503
+ return false;
1504
+
1505
+ return /^\s*\}/.test(input);
1506
+ };
1507
+
1508
+ this.autoOutdent = function(doc, row) {
1509
+ var line = doc.getLine(row);
1510
+ var match = line.match(/^(\s*\})/);
1511
+
1512
+ if (!match) return 0;
1513
+
1514
+ var column = match[1].length;
1515
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
1516
+
1517
+ if (!openBracePos || openBracePos.row == row) return 0;
1518
+
1519
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
1520
+ doc.replace(new Range(row, 0, row, column-1), indent);
1521
+ };
1522
+
1523
+ this.$getIndent = function(line) {
1524
+ var match = line.match(/^(\s+)/);
1525
+ if (match) {
1526
+ return match[1];
1527
+ }
1528
+
1529
+ return "";
1530
+ };
1531
+
1532
+ }).call(MatchingBraceOutdent.prototype);
1533
+
1534
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
1535
+ });
1536
+
1537
+ define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
1538
+
1539
+
1540
+ var oop = require("../../lib/oop");
1541
+ var Range = require("../../range").Range;
1542
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1543
+
1544
+ var FoldMode = exports.FoldMode = function() {};
1545
+ oop.inherits(FoldMode, BaseFoldMode);
1546
+
1547
+ (function() {
1548
+
1549
+ this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
1550
+ this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
1551
+
1552
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1553
+ var line = session.getLine(row);
1554
+ var match = line.match(this.foldingStartMarker);
1555
+ if (match) {
1556
+ var i = match.index;
1557
+
1558
+ if (match[1])
1559
+ return this.openingBracketBlock(session, match[1], row, i);
1560
+
1561
+ var range = session.getCommentFoldRange(row, i + match[0].length);
1562
+ range.end.column -= 2;
1563
+ return range;
1564
+ }
1565
+
1566
+ if (foldStyle !== "markbeginend")
1567
+ return;
1568
+
1569
+ var match = line.match(this.foldingStopMarker);
1570
+ if (match) {
1571
+ var i = match.index + match[0].length;
1572
+
1573
+ if (match[2]) {
1574
+ var range = session.getCommentFoldRange(row, i);
1575
+ range.end.column -= 2;
1576
+ return range;
1577
+ }
1578
+
1579
+ var end = {row: row, column: i};
1580
+ var start = session.$findOpeningBracket(match[1], end);
1581
+
1582
+ if (!start)
1583
+ return;
1584
+
1585
+ start.column++;
1586
+ end.column--;
1587
+
1588
+ return Range.fromPoints(start, end);
1589
+ }
1590
+ };
1591
+
1592
+ }).call(FoldMode.prototype);
1593
+
1594
+ });
1595
+
1596
+ define('ace/mode/svg_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules', 'ace/mode/xml_util'], function(require, exports, module) {
1597
+
1598
+
1599
+ var oop = require("../lib/oop");
1600
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1601
+ var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
1602
+ var xmlUtil = require("./xml_util");
1603
+
1604
+ var SvgHighlightRules = function() {
1605
+ XmlHighlightRules.call(this);
1606
+
1607
+ this.$rules.start.splice(3, 0, {
1608
+ token : "meta.tag",
1609
+ regex : "<(?=\s*script)",
1610
+ next : "script"
1611
+ });
1612
+
1613
+ xmlUtil.tag(this.$rules, "script", "js-start");
1614
+
1615
+ this.embedRules(JavaScriptHighlightRules, "js-", [{
1616
+ token: "comment",
1617
+ regex: "\\/\\/.*(?=<\\/script>)",
1618
+ next: "tag"
1619
+ }, {
1620
+ token: "meta.tag",
1621
+ regex: "<\\/(?=script)",
1622
+ next: "tag"
1623
+ }]);
1624
+ };
1625
+
1626
+ oop.inherits(SvgHighlightRules, XmlHighlightRules);
1627
+
1628
+ exports.SvgHighlightRules = SvgHighlightRules;
1629
+ });
1630
+
1631
+ define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
1632
+
1633
+
1634
+ var oop = require("../../lib/oop");
1635
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1636
+
1637
+ var FoldMode = exports.FoldMode = function(defaultMode, subModes) {
1638
+ this.defaultMode = defaultMode;
1639
+ this.subModes = subModes;
1640
+ };
1641
+ oop.inherits(FoldMode, BaseFoldMode);
1642
+
1643
+ (function() {
1644
+
1645
+
1646
+ this.$getMode = function(state) {
1647
+ for (var key in this.subModes) {
1648
+ if (state.indexOf(key) === 0)
1649
+ return this.subModes[key];
1650
+ }
1651
+ return null;
1652
+ };
1653
+
1654
+ this.$tryMode = function(state, session, foldStyle, row) {
1655
+ var mode = this.$getMode(state);
1656
+ return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
1657
+ };
1658
+
1659
+ this.getFoldWidget = function(session, foldStyle, row) {
1660
+ return (
1661
+ this.$tryMode(session.getState(row-1), session, foldStyle, row) ||
1662
+ this.$tryMode(session.getState(row), session, foldStyle, row) ||
1663
+ this.defaultMode.getFoldWidget(session, foldStyle, row)
1664
+ );
1665
+ };
1666
+
1667
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1668
+ var mode = this.$getMode(session.getState(row-1));
1669
+
1670
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
1671
+ mode = this.$getMode(session.getState(row));
1672
+
1673
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
1674
+ mode = this.defaultMode;
1675
+
1676
+ return mode.getFoldWidgetRange(session, foldStyle, row);
1677
+ };
1678
+
1679
+ }).call(FoldMode.prototype);
1680
+
1681
+ });