aced_rails 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. data/.gitignore +17 -0
  2. data/CHANGELOG.md +4 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE +22 -0
  5. data/README.md +49 -0
  6. data/Rakefile +2 -0
  7. data/aced_rails.gemspec +19 -0
  8. data/lib/aced_rails.rb +7 -0
  9. data/lib/aced_rails/engine.rb +4 -0
  10. data/lib/aced_rails/version.rb +3 -0
  11. data/vendor/assets/javascripts/ace/ace-compat-noconflict.js +1 -0
  12. data/vendor/assets/javascripts/ace/ace-compat-uncompressed-noconflict.js +480 -0
  13. data/vendor/assets/javascripts/ace/ace-compat-uncompressed.js +480 -0
  14. data/vendor/assets/javascripts/ace/ace-compat.js +1 -0
  15. data/vendor/assets/javascripts/ace/ace-noconflict.js +10 -0
  16. data/vendor/assets/javascripts/ace/ace-uncompressed-noconflict.js +14649 -0
  17. data/vendor/assets/javascripts/ace/ace-uncompressed.js +14649 -0
  18. data/vendor/assets/javascripts/ace/ace.js +10 -0
  19. data/vendor/assets/javascripts/ace/keybinding-emacs-noconflict.js +1 -0
  20. data/vendor/assets/javascripts/ace/keybinding-emacs-uncompressed-noconflict.js +405 -0
  21. data/vendor/assets/javascripts/ace/keybinding-emacs-uncompressed.js +405 -0
  22. data/vendor/assets/javascripts/ace/keybinding-emacs.js +1 -0
  23. data/vendor/assets/javascripts/ace/keybinding-vim-noconflict.js +1 -0
  24. data/vendor/assets/javascripts/ace/keybinding-vim-uncompressed-noconflict.js +393 -0
  25. data/vendor/assets/javascripts/ace/keybinding-vim-uncompressed.js +393 -0
  26. data/vendor/assets/javascripts/ace/keybinding-vim.js +1 -0
  27. data/vendor/assets/javascripts/ace/mode-c_cpp-noconflict.js +1 -0
  28. data/vendor/assets/javascripts/ace/mode-c_cpp-uncompressed-noconflict.js +918 -0
  29. data/vendor/assets/javascripts/ace/mode-c_cpp-uncompressed.js +918 -0
  30. data/vendor/assets/javascripts/ace/mode-c_cpp.js +1 -0
  31. data/vendor/assets/javascripts/ace/mode-clojure-noconflict.js +1 -0
  32. data/vendor/assets/javascripts/ace/mode-clojure-uncompressed-noconflict.js +422 -0
  33. data/vendor/assets/javascripts/ace/mode-clojure-uncompressed.js +422 -0
  34. data/vendor/assets/javascripts/ace/mode-clojure.js +1 -0
  35. data/vendor/assets/javascripts/ace/mode-coffee-noconflict.js +1 -0
  36. data/vendor/assets/javascripts/ace/mode-coffee-uncompressed-noconflict.js +605 -0
  37. data/vendor/assets/javascripts/ace/mode-coffee-uncompressed.js +605 -0
  38. data/vendor/assets/javascripts/ace/mode-coffee.js +1 -0
  39. data/vendor/assets/javascripts/ace/mode-coldfusion-noconflict.js +1 -0
  40. data/vendor/assets/javascripts/ace/mode-coldfusion-uncompressed-noconflict.js +2361 -0
  41. data/vendor/assets/javascripts/ace/mode-coldfusion-uncompressed.js +2361 -0
  42. data/vendor/assets/javascripts/ace/mode-coldfusion.js +1 -0
  43. data/vendor/assets/javascripts/ace/mode-csharp-noconflict.js +1 -0
  44. data/vendor/assets/javascripts/ace/mode-csharp-uncompressed-noconflict.js +768 -0
  45. data/vendor/assets/javascripts/ace/mode-csharp-uncompressed.js +768 -0
  46. data/vendor/assets/javascripts/ace/mode-csharp.js +1 -0
  47. data/vendor/assets/javascripts/ace/mode-css-noconflict.js +1 -0
  48. data/vendor/assets/javascripts/ace/mode-css-uncompressed-noconflict.js +664 -0
  49. data/vendor/assets/javascripts/ace/mode-css-uncompressed.js +664 -0
  50. data/vendor/assets/javascripts/ace/mode-css.js +1 -0
  51. data/vendor/assets/javascripts/ace/mode-groovy-noconflict.js +1 -0
  52. data/vendor/assets/javascripts/ace/mode-groovy-uncompressed-noconflict.js +1280 -0
  53. data/vendor/assets/javascripts/ace/mode-groovy-uncompressed.js +1280 -0
  54. data/vendor/assets/javascripts/ace/mode-groovy.js +1 -0
  55. data/vendor/assets/javascripts/ace/mode-haxe-noconflict.js +1 -0
  56. data/vendor/assets/javascripts/ace/mode-haxe-uncompressed-noconflict.js +768 -0
  57. data/vendor/assets/javascripts/ace/mode-haxe-uncompressed.js +768 -0
  58. data/vendor/assets/javascripts/ace/mode-haxe.js +1 -0
  59. data/vendor/assets/javascripts/ace/mode-html-noconflict.js +1 -0
  60. data/vendor/assets/javascripts/ace/mode-html-uncompressed-noconflict.js +2377 -0
  61. data/vendor/assets/javascripts/ace/mode-html-uncompressed.js +2377 -0
  62. data/vendor/assets/javascripts/ace/mode-html.js +1 -0
  63. data/vendor/assets/javascripts/ace/mode-java-noconflict.js +1 -0
  64. data/vendor/assets/javascripts/ace/mode-java-uncompressed-noconflict.js +1282 -0
  65. data/vendor/assets/javascripts/ace/mode-java-uncompressed.js +1282 -0
  66. data/vendor/assets/javascripts/ace/mode-java.js +1 -0
  67. data/vendor/assets/javascripts/ace/mode-javascript-noconflict.js +1 -0
  68. data/vendor/assets/javascripts/ace/mode-javascript-uncompressed-noconflict.js +1113 -0
  69. data/vendor/assets/javascripts/ace/mode-javascript-uncompressed.js +1113 -0
  70. data/vendor/assets/javascripts/ace/mode-javascript.js +1 -0
  71. data/vendor/assets/javascripts/ace/mode-json-noconflict.js +1 -0
  72. data/vendor/assets/javascripts/ace/mode-json-uncompressed-noconflict.js +696 -0
  73. data/vendor/assets/javascripts/ace/mode-json-uncompressed.js +696 -0
  74. data/vendor/assets/javascripts/ace/mode-json.js +1 -0
  75. data/vendor/assets/javascripts/ace/mode-latex-noconflict.js +1 -0
  76. data/vendor/assets/javascripts/ace/mode-latex-uncompressed-noconflict.js +95 -0
  77. data/vendor/assets/javascripts/ace/mode-latex-uncompressed.js +95 -0
  78. data/vendor/assets/javascripts/ace/mode-latex.js +1 -0
  79. data/vendor/assets/javascripts/ace/mode-lua-noconflict.js +1 -0
  80. data/vendor/assets/javascripts/ace/mode-lua-uncompressed-noconflict.js +523 -0
  81. data/vendor/assets/javascripts/ace/mode-lua-uncompressed.js +523 -0
  82. data/vendor/assets/javascripts/ace/mode-lua.js +1 -0
  83. data/vendor/assets/javascripts/ace/mode-markdown-noconflict.js +1 -0
  84. data/vendor/assets/javascripts/ace/mode-markdown-uncompressed-noconflict.js +2819 -0
  85. data/vendor/assets/javascripts/ace/mode-markdown-uncompressed.js +2819 -0
  86. data/vendor/assets/javascripts/ace/mode-markdown.js +1 -0
  87. data/vendor/assets/javascripts/ace/mode-ocaml-noconflict.js +1 -0
  88. data/vendor/assets/javascripts/ace/mode-ocaml-uncompressed-noconflict.js +539 -0
  89. data/vendor/assets/javascripts/ace/mode-ocaml-uncompressed.js +539 -0
  90. data/vendor/assets/javascripts/ace/mode-ocaml.js +1 -0
  91. data/vendor/assets/javascripts/ace/mode-perl-noconflict.js +1 -0
  92. data/vendor/assets/javascripts/ace/mode-perl-uncompressed-noconflict.js +573 -0
  93. data/vendor/assets/javascripts/ace/mode-perl-uncompressed.js +573 -0
  94. data/vendor/assets/javascripts/ace/mode-perl.js +1 -0
  95. data/vendor/assets/javascripts/ace/mode-pgsql-noconflict.js +1 -0
  96. data/vendor/assets/javascripts/ace/mode-pgsql-uncompressed-noconflict.js +1107 -0
  97. data/vendor/assets/javascripts/ace/mode-pgsql-uncompressed.js +1107 -0
  98. data/vendor/assets/javascripts/ace/mode-pgsql.js +1 -0
  99. data/vendor/assets/javascripts/ace/mode-php-noconflict.js +1 -0
  100. data/vendor/assets/javascripts/ace/mode-php-uncompressed-noconflict.js +1884 -0
  101. data/vendor/assets/javascripts/ace/mode-php-uncompressed.js +1884 -0
  102. data/vendor/assets/javascripts/ace/mode-php.js +1 -0
  103. data/vendor/assets/javascripts/ace/mode-powershell-noconflict.js +1 -0
  104. data/vendor/assets/javascripts/ace/mode-powershell-uncompressed-noconflict.js +706 -0
  105. data/vendor/assets/javascripts/ace/mode-powershell-uncompressed.js +706 -0
  106. data/vendor/assets/javascripts/ace/mode-powershell.js +1 -0
  107. data/vendor/assets/javascripts/ace/mode-python-noconflict.js +1 -0
  108. data/vendor/assets/javascripts/ace/mode-python-uncompressed-noconflict.js +506 -0
  109. data/vendor/assets/javascripts/ace/mode-python-uncompressed.js +506 -0
  110. data/vendor/assets/javascripts/ace/mode-python.js +1 -0
  111. data/vendor/assets/javascripts/ace/mode-ruby-noconflict.js +1 -0
  112. data/vendor/assets/javascripts/ace/mode-ruby-uncompressed-noconflict.js +391 -0
  113. data/vendor/assets/javascripts/ace/mode-ruby-uncompressed.js +391 -0
  114. data/vendor/assets/javascripts/ace/mode-ruby.js +1 -0
  115. data/vendor/assets/javascripts/ace/mode-scad-noconflict.js +1 -0
  116. data/vendor/assets/javascripts/ace/mode-scad-uncompressed-noconflict.js +906 -0
  117. data/vendor/assets/javascripts/ace/mode-scad-uncompressed.js +906 -0
  118. data/vendor/assets/javascripts/ace/mode-scad.js +1 -0
  119. data/vendor/assets/javascripts/ace/mode-scala-noconflict.js +1 -0
  120. data/vendor/assets/javascripts/ace/mode-scala-uncompressed-noconflict.js +1282 -0
  121. data/vendor/assets/javascripts/ace/mode-scala-uncompressed.js +1282 -0
  122. data/vendor/assets/javascripts/ace/mode-scala.js +1 -0
  123. data/vendor/assets/javascripts/ace/mode-scss-noconflict.js +1 -0
  124. data/vendor/assets/javascripts/ace/mode-scss-uncompressed-noconflict.js +678 -0
  125. data/vendor/assets/javascripts/ace/mode-scss-uncompressed.js +678 -0
  126. data/vendor/assets/javascripts/ace/mode-scss.js +1 -0
  127. data/vendor/assets/javascripts/ace/mode-sh-noconflict.js +1 -0
  128. data/vendor/assets/javascripts/ace/mode-sh-uncompressed-noconflict.js +268 -0
  129. data/vendor/assets/javascripts/ace/mode-sh-uncompressed.js +268 -0
  130. data/vendor/assets/javascripts/ace/mode-sh.js +1 -0
  131. data/vendor/assets/javascripts/ace/mode-sql-noconflict.js +1 -0
  132. data/vendor/assets/javascripts/ace/mode-sql-uncompressed-noconflict.js +159 -0
  133. data/vendor/assets/javascripts/ace/mode-sql-uncompressed.js +159 -0
  134. data/vendor/assets/javascripts/ace/mode-sql.js +1 -0
  135. data/vendor/assets/javascripts/ace/mode-svg-noconflict.js +1 -0
  136. data/vendor/assets/javascripts/ace/mode-svg-uncompressed-noconflict.js +2016 -0
  137. data/vendor/assets/javascripts/ace/mode-svg-uncompressed.js +2016 -0
  138. data/vendor/assets/javascripts/ace/mode-svg.js +1 -0
  139. data/vendor/assets/javascripts/ace/mode-text-noconflict.js +0 -0
  140. data/vendor/assets/javascripts/ace/mode-text-uncompressed-noconflict.js +0 -0
  141. data/vendor/assets/javascripts/ace/mode-text-uncompressed.js +0 -0
  142. data/vendor/assets/javascripts/ace/mode-text.js +0 -0
  143. data/vendor/assets/javascripts/ace/mode-textile-noconflict.js +1 -0
  144. data/vendor/assets/javascripts/ace/mode-textile-uncompressed-noconflict.js +254 -0
  145. data/vendor/assets/javascripts/ace/mode-textile-uncompressed.js +254 -0
  146. data/vendor/assets/javascripts/ace/mode-textile.js +1 -0
  147. data/vendor/assets/javascripts/ace/mode-xml-noconflict.js +1 -0
  148. data/vendor/assets/javascripts/ace/mode-xml-uncompressed-noconflict.js +1001 -0
  149. data/vendor/assets/javascripts/ace/mode-xml-uncompressed.js +1001 -0
  150. data/vendor/assets/javascripts/ace/mode-xml.js +1 -0
  151. data/vendor/assets/javascripts/ace/theme-chrome-noconflict.js +1 -0
  152. data/vendor/assets/javascripts/ace/theme-chrome-uncompressed-noconflict.js +212 -0
  153. data/vendor/assets/javascripts/ace/theme-chrome-uncompressed.js +212 -0
  154. data/vendor/assets/javascripts/ace/theme-chrome.js +1 -0
  155. data/vendor/assets/javascripts/ace/theme-clouds-noconflict.js +1 -0
  156. data/vendor/assets/javascripts/ace/theme-clouds-uncompressed-noconflict.js +155 -0
  157. data/vendor/assets/javascripts/ace/theme-clouds-uncompressed.js +155 -0
  158. data/vendor/assets/javascripts/ace/theme-clouds.js +1 -0
  159. data/vendor/assets/javascripts/ace/theme-clouds_midnight-noconflict.js +1 -0
  160. data/vendor/assets/javascripts/ace/theme-clouds_midnight-uncompressed-noconflict.js +156 -0
  161. data/vendor/assets/javascripts/ace/theme-clouds_midnight-uncompressed.js +156 -0
  162. data/vendor/assets/javascripts/ace/theme-clouds_midnight.js +1 -0
  163. data/vendor/assets/javascripts/ace/theme-cobalt-noconflict.js +1 -0
  164. data/vendor/assets/javascripts/ace/theme-cobalt-uncompressed-noconflict.js +170 -0
  165. data/vendor/assets/javascripts/ace/theme-cobalt-uncompressed.js +170 -0
  166. data/vendor/assets/javascripts/ace/theme-cobalt.js +1 -0
  167. data/vendor/assets/javascripts/ace/theme-crimson_editor-noconflict.js +1 -0
  168. data/vendor/assets/javascripts/ace/theme-crimson_editor-uncompressed-noconflict.js +198 -0
  169. data/vendor/assets/javascripts/ace/theme-crimson_editor-uncompressed.js +198 -0
  170. data/vendor/assets/javascripts/ace/theme-crimson_editor.js +1 -0
  171. data/vendor/assets/javascripts/ace/theme-dawn-noconflict.js +1 -0
  172. data/vendor/assets/javascripts/ace/theme-dawn-uncompressed-noconflict.js +174 -0
  173. data/vendor/assets/javascripts/ace/theme-dawn-uncompressed.js +174 -0
  174. data/vendor/assets/javascripts/ace/theme-dawn.js +1 -0
  175. data/vendor/assets/javascripts/ace/theme-dreamweaver-noconflict.js +1 -0
  176. data/vendor/assets/javascripts/ace/theme-dreamweaver-uncompressed-noconflict.js +227 -0
  177. data/vendor/assets/javascripts/ace/theme-dreamweaver-uncompressed.js +227 -0
  178. data/vendor/assets/javascripts/ace/theme-dreamweaver.js +1 -0
  179. data/vendor/assets/javascripts/ace/theme-eclipse-noconflict.js +1 -0
  180. data/vendor/assets/javascripts/ace/theme-eclipse-uncompressed-noconflict.js +147 -0
  181. data/vendor/assets/javascripts/ace/theme-eclipse-uncompressed.js +147 -0
  182. data/vendor/assets/javascripts/ace/theme-eclipse.js +1 -0
  183. data/vendor/assets/javascripts/ace/theme-idle_fingers-noconflict.js +1 -0
  184. data/vendor/assets/javascripts/ace/theme-idle_fingers-uncompressed-noconflict.js +162 -0
  185. data/vendor/assets/javascripts/ace/theme-idle_fingers-uncompressed.js +162 -0
  186. data/vendor/assets/javascripts/ace/theme-idle_fingers.js +1 -0
  187. data/vendor/assets/javascripts/ace/theme-kr_theme-noconflict.js +1 -0
  188. data/vendor/assets/javascripts/ace/theme-kr_theme-uncompressed-noconflict.js +165 -0
  189. data/vendor/assets/javascripts/ace/theme-kr_theme-uncompressed.js +165 -0
  190. data/vendor/assets/javascripts/ace/theme-kr_theme.js +1 -0
  191. data/vendor/assets/javascripts/ace/theme-merbivore-noconflict.js +1 -0
  192. data/vendor/assets/javascripts/ace/theme-merbivore-uncompressed-noconflict.js +165 -0
  193. data/vendor/assets/javascripts/ace/theme-merbivore-uncompressed.js +165 -0
  194. data/vendor/assets/javascripts/ace/theme-merbivore.js +1 -0
  195. data/vendor/assets/javascripts/ace/theme-merbivore_soft-noconflict.js +1 -0
  196. data/vendor/assets/javascripts/ace/theme-merbivore_soft-uncompressed-noconflict.js +171 -0
  197. data/vendor/assets/javascripts/ace/theme-merbivore_soft-uncompressed.js +171 -0
  198. data/vendor/assets/javascripts/ace/theme-merbivore_soft.js +1 -0
  199. data/vendor/assets/javascripts/ace/theme-mono_industrial-noconflict.js +1 -0
  200. data/vendor/assets/javascripts/ace/theme-mono_industrial-uncompressed-noconflict.js +169 -0
  201. data/vendor/assets/javascripts/ace/theme-mono_industrial-uncompressed.js +169 -0
  202. data/vendor/assets/javascripts/ace/theme-mono_industrial.js +1 -0
  203. data/vendor/assets/javascripts/ace/theme-monokai-noconflict.js +1 -0
  204. data/vendor/assets/javascripts/ace/theme-monokai-uncompressed-noconflict.js +171 -0
  205. data/vendor/assets/javascripts/ace/theme-monokai-uncompressed.js +171 -0
  206. data/vendor/assets/javascripts/ace/theme-monokai.js +1 -0
  207. data/vendor/assets/javascripts/ace/theme-pastel_on_dark-noconflict.js +1 -0
  208. data/vendor/assets/javascripts/ace/theme-pastel_on_dark-uncompressed-noconflict.js +179 -0
  209. data/vendor/assets/javascripts/ace/theme-pastel_on_dark-uncompressed.js +179 -0
  210. data/vendor/assets/javascripts/ace/theme-pastel_on_dark.js +1 -0
  211. data/vendor/assets/javascripts/ace/theme-solarized_dark-noconflict.js +1 -0
  212. data/vendor/assets/javascripts/ace/theme-solarized_dark-uncompressed-noconflict.js +160 -0
  213. data/vendor/assets/javascripts/ace/theme-solarized_dark-uncompressed.js +160 -0
  214. data/vendor/assets/javascripts/ace/theme-solarized_dark.js +1 -0
  215. data/vendor/assets/javascripts/ace/theme-solarized_light-noconflict.js +1 -0
  216. data/vendor/assets/javascripts/ace/theme-solarized_light-uncompressed-noconflict.js +159 -0
  217. data/vendor/assets/javascripts/ace/theme-solarized_light-uncompressed.js +159 -0
  218. data/vendor/assets/javascripts/ace/theme-solarized_light.js +1 -0
  219. data/vendor/assets/javascripts/ace/theme-textmate-noconflict.js +0 -0
  220. data/vendor/assets/javascripts/ace/theme-textmate-uncompressed-noconflict.js +0 -0
  221. data/vendor/assets/javascripts/ace/theme-textmate-uncompressed.js +0 -0
  222. data/vendor/assets/javascripts/ace/theme-textmate.js +0 -0
  223. data/vendor/assets/javascripts/ace/theme-tomorrow-noconflict.js +1 -0
  224. data/vendor/assets/javascripts/ace/theme-tomorrow-uncompressed-noconflict.js +189 -0
  225. data/vendor/assets/javascripts/ace/theme-tomorrow-uncompressed.js +189 -0
  226. data/vendor/assets/javascripts/ace/theme-tomorrow.js +1 -0
  227. data/vendor/assets/javascripts/ace/theme-tomorrow_night-noconflict.js +1 -0
  228. data/vendor/assets/javascripts/ace/theme-tomorrow_night-uncompressed-noconflict.js +189 -0
  229. data/vendor/assets/javascripts/ace/theme-tomorrow_night-uncompressed.js +189 -0
  230. data/vendor/assets/javascripts/ace/theme-tomorrow_night.js +1 -0
  231. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue-noconflict.js +1 -0
  232. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue-uncompressed-noconflict.js +189 -0
  233. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue-uncompressed.js +189 -0
  234. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue.js +1 -0
  235. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright-noconflict.js +1 -0
  236. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright-uncompressed-noconflict.js +189 -0
  237. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright-uncompressed.js +189 -0
  238. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright.js +1 -0
  239. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties-noconflict.js +1 -0
  240. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties-uncompressed-noconflict.js +185 -0
  241. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties-uncompressed.js +185 -0
  242. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties.js +1 -0
  243. data/vendor/assets/javascripts/ace/theme-twilight-noconflict.js +1 -0
  244. data/vendor/assets/javascripts/ace/theme-twilight-uncompressed-noconflict.js +183 -0
  245. data/vendor/assets/javascripts/ace/theme-twilight-uncompressed.js +183 -0
  246. data/vendor/assets/javascripts/ace/theme-twilight.js +1 -0
  247. data/vendor/assets/javascripts/ace/theme-vibrant_ink-noconflict.js +1 -0
  248. data/vendor/assets/javascripts/ace/theme-vibrant_ink-uncompressed-noconflict.js +166 -0
  249. data/vendor/assets/javascripts/ace/theme-vibrant_ink-uncompressed.js +166 -0
  250. data/vendor/assets/javascripts/ace/theme-vibrant_ink.js +1 -0
  251. data/vendor/assets/javascripts/ace/worker-coffee.js +7456 -0
  252. data/vendor/assets/javascripts/ace/worker-css.js +11693 -0
  253. data/vendor/assets/javascripts/ace/worker-javascript.js +10305 -0
  254. data/vendor/assets/javascripts/ace/worker-json.js +3062 -0
  255. metadata +310 -0
@@ -0,0 +1,1113 @@
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/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) {
39
+ "use strict";
40
+
41
+ var oop = require("../lib/oop");
42
+ var TextMode = require("./text").Mode;
43
+ var Tokenizer = require("../tokenizer").Tokenizer;
44
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
45
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
46
+ var Range = require("../range").Range;
47
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
48
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
49
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
50
+
51
+ var Mode = function() {
52
+ this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
53
+ this.$outdent = new MatchingBraceOutdent();
54
+ this.$behaviour = new CstyleBehaviour();
55
+ this.foldingRules = new CStyleFoldMode();
56
+ };
57
+ oop.inherits(Mode, TextMode);
58
+
59
+ (function() {
60
+
61
+
62
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
63
+ var outdent = true;
64
+ var re = /^(\s*)\/\//;
65
+
66
+ for (var i=startRow; i<= endRow; i++) {
67
+ if (!re.test(doc.getLine(i))) {
68
+ outdent = false;
69
+ break;
70
+ }
71
+ }
72
+
73
+ if (outdent) {
74
+ var deleteRange = new Range(0, 0, 0, 0);
75
+ for (var i=startRow; i<= endRow; i++)
76
+ {
77
+ var line = doc.getLine(i);
78
+ var m = line.match(re);
79
+ deleteRange.start.row = i;
80
+ deleteRange.end.row = i;
81
+ deleteRange.end.column = m[0].length;
82
+ doc.replace(deleteRange, m[1]);
83
+ }
84
+ }
85
+ else {
86
+ doc.indentRows(startRow, endRow, "//");
87
+ }
88
+ };
89
+
90
+ this.getNextLineIndent = function(state, line, tab) {
91
+ var indent = this.$getIndent(line);
92
+
93
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
94
+ var tokens = tokenizedLine.tokens;
95
+ var endState = tokenizedLine.state;
96
+
97
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
98
+ return indent;
99
+ }
100
+
101
+ if (state == "start" || state == "regex_allowed") {
102
+ var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
103
+ if (match) {
104
+ indent += tab;
105
+ }
106
+ } else if (state == "doc-start") {
107
+ if (endState == "start" || state == "regex_allowed") {
108
+ return "";
109
+ }
110
+ var match = line.match(/^\s*(\/?)\*/);
111
+ if (match) {
112
+ if (match[1]) {
113
+ indent += " ";
114
+ }
115
+ indent += "* ";
116
+ }
117
+ }
118
+
119
+ return indent;
120
+ };
121
+
122
+ this.checkOutdent = function(state, line, input) {
123
+ return this.$outdent.checkOutdent(line, input);
124
+ };
125
+
126
+ this.autoOutdent = function(state, doc, row) {
127
+ this.$outdent.autoOutdent(doc, row);
128
+ };
129
+
130
+ this.createWorker = function(session) {
131
+ var worker = new WorkerClient(["ace"], "worker-javascript.js", "ace/mode/javascript_worker", "JavaScriptWorker");
132
+ worker.attachToDocument(session.getDocument());
133
+
134
+ worker.on("jslint", function(results) {
135
+ var errors = [];
136
+ for (var i=0; i<results.data.length; i++) {
137
+ var error = results.data[i];
138
+ if (error)
139
+ errors.push({
140
+ row: error.line-1,
141
+ column: error.character-1,
142
+ text: error.reason,
143
+ type: "warning",
144
+ lint: error
145
+ });
146
+ }
147
+ session.setAnnotations(errors);
148
+ });
149
+
150
+ worker.on("narcissus", function(e) {
151
+ session.setAnnotations([e.data]);
152
+ });
153
+
154
+ worker.on("terminate", function() {
155
+ session.clearAnnotations();
156
+ });
157
+
158
+ return worker;
159
+ };
160
+
161
+ }).call(Mode.prototype);
162
+
163
+ exports.Mode = Mode;
164
+ });
165
+ /* ***** BEGIN LICENSE BLOCK *****
166
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
167
+ *
168
+ * The contents of this file are subject to the Mozilla Public License Version
169
+ * 1.1 (the "License"); you may not use this file except in compliance with
170
+ * the License. You may obtain a copy of the License at
171
+ * http://www.mozilla.org/MPL/
172
+ *
173
+ * Software distributed under the License is distributed on an "AS IS" basis,
174
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
175
+ * for the specific language governing rights and limitations under the
176
+ * License.
177
+ *
178
+ * The Original Code is Ajax.org Code Editor (ACE).
179
+ *
180
+ * The Initial Developer of the Original Code is
181
+ * Ajax.org B.V.
182
+ * Portions created by the Initial Developer are Copyright (C) 2010
183
+ * the Initial Developer. All Rights Reserved.
184
+ *
185
+ * Contributor(s):
186
+ * Fabian Jakobs <fabian AT ajax DOT org>
187
+ * Mihai Sucan <mihai DOT sucan AT gmail DOT com>
188
+ *
189
+ * Alternatively, the contents of this file may be used under the terms of
190
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
191
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
192
+ * in which case the provisions of the GPL or the LGPL are applicable instead
193
+ * of those above. If you wish to allow use of your version of this file only
194
+ * under the terms of either the GPL or the LGPL, and not to allow others to
195
+ * use your version of this file under the terms of the MPL, indicate your
196
+ * decision by deleting the provisions above and replace them with the notice
197
+ * and other provisions required by the GPL or the LGPL. If you do not delete
198
+ * the provisions above, a recipient may use your version of this file under
199
+ * the terms of any one of the MPL, the GPL or the LGPL.
200
+ *
201
+ * ***** END LICENSE BLOCK ***** */
202
+
203
+ 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) {
204
+ "use strict";
205
+
206
+ var oop = require("../lib/oop");
207
+ var lang = require("../lib/lang");
208
+ var unicode = require("../unicode");
209
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
210
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
211
+
212
+ var JavaScriptHighlightRules = function() {
213
+
214
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
215
+ var globals = lang.arrayToMap(
216
+ // Constructors
217
+ ("Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" +
218
+ // E4X
219
+ "Namespace|QName|XML|XMLList|" +
220
+ "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
221
+ "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
222
+ // Errors
223
+ "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
224
+ "SyntaxError|TypeError|URIError|" +
225
+ // Non-constructor functions
226
+ "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" +
227
+ "isNaN|parseFloat|parseInt|" +
228
+ // Other
229
+ "JSON|Math|" +
230
+ // Pseudo
231
+ "this|arguments|prototype|window|document"
232
+ ).split("|")
233
+ );
234
+
235
+ var keywords = lang.arrayToMap(
236
+ ("break|case|catch|continue|default|delete|do|else|finally|for|function|" +
237
+ "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|" +
238
+ "const|yield|import|get|set").split("|")
239
+ );
240
+
241
+ // keywords which can be followed by regular expressions
242
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
243
+
244
+ var deprecated = lang.arrayToMap(
245
+ ("__parent__|__count__|escape|unescape|with|__proto__").split("|")
246
+ );
247
+
248
+ var definitions = lang.arrayToMap(("const|let|var|function").split("|"));
249
+
250
+ var buildinConstants = lang.arrayToMap(
251
+ ("null|Infinity|NaN|undefined").split("|")
252
+ );
253
+
254
+ var futureReserved = lang.arrayToMap(
255
+ ("class|enum|extends|super|export|implements|private|" +
256
+ "public|interface|package|protected|static").split("|")
257
+ );
258
+
259
+ // TODO: Unicode escape sequences
260
+ var identifierRe = "[" + unicode.packages.L + "\\$_]["
261
+ + unicode.packages.L
262
+ + unicode.packages.Mn + unicode.packages.Mc
263
+ + unicode.packages.Nd
264
+ + unicode.packages.Pc + "\\$_]*\\b";
265
+
266
+ var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
267
+ "u[0-9a-fA-F]{4}|" + // unicode
268
+ "[0-2][0-7]{0,2}|" + // oct
269
+ "3[0-6][0-7]?|" + // oct
270
+ "37[0-7]?|" + // oct
271
+ "[4-7][0-7]?|" + //oct
272
+ ".)";
273
+
274
+ // regexp must not have capturing parentheses. Use (?:) instead.
275
+ // regexps are ordered -> the first match is used
276
+
277
+ this.$rules = {
278
+ "start" : [
279
+ {
280
+ token : "comment",
281
+ regex : "\\/\\/.*$"
282
+ },
283
+ new DocCommentHighlightRules().getStartRule("doc-start"),
284
+ {
285
+ token : "comment", // multi line comment
286
+ merge : true,
287
+ regex : "\\/\\*",
288
+ next : "comment"
289
+ }, {
290
+ token : "string",
291
+ regex : "'",
292
+ next : "qstring"
293
+ }, {
294
+ token : "string",
295
+ regex : '"',
296
+ next : "qqstring"
297
+ }, {
298
+ token : "constant.numeric", // hex
299
+ regex : "0[xX][0-9a-fA-F]+\\b"
300
+ }, {
301
+ token : "constant.numeric", // float
302
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
303
+ }, {
304
+ token : ["storage.type", "text", "entity.name.function", "text", "paren.lparen", "variable.parameter", "paren.rparen"],
305
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
306
+ }, {
307
+ token : "constant.language.boolean",
308
+ regex : "(?:true|false)\\b"
309
+ }, {
310
+ token : "keyword",
311
+ regex : "(?:" + kwBeforeRe + ")\\b",
312
+ next : "regex_allowed"
313
+ }, {
314
+ token : "support.function",
315
+ regex : "\\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|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(?=\\()"
316
+ }, {
317
+ token : "support.function.dom",
318
+ regex : "\\b(?: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(?=\\()"
319
+ }, {
320
+ token : "support.function.constant",
321
+ regex : "\\b(?: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"
322
+ }, {
323
+ token : ["punctuation.operator", "support.function.firebug"],
324
+ regex : "(\\.)(warn|info|log|error|time|timeEnd|assert)\\b"
325
+
326
+ }, {
327
+ token : function(value) {
328
+ if (globals.hasOwnProperty(value))
329
+ return "variable.language";
330
+ else if (deprecated.hasOwnProperty(value))
331
+ return "invalid.deprecated";
332
+ else if (definitions.hasOwnProperty(value))
333
+ return "storage.type";
334
+ else if (keywords.hasOwnProperty(value))
335
+ return "keyword";
336
+ else if (buildinConstants.hasOwnProperty(value))
337
+ return "constant.language";
338
+ else if (futureReserved.hasOwnProperty(value))
339
+ return "invalid.illegal";
340
+ else if (value == "debugger")
341
+ return "invalid.deprecated";
342
+ else
343
+ return "identifier";
344
+ },
345
+ regex : identifierRe
346
+ }, {
347
+ token : "keyword.operator",
348
+ regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)",
349
+ next : "regex_allowed"
350
+ }, {
351
+ token : "punctuation.operator",
352
+ regex : "\\?|\\:|\\,|\\;|\\.",
353
+ next : "regex_allowed"
354
+ }, {
355
+ token : "paren.lparen",
356
+ regex : "[[({]",
357
+ next : "regex_allowed"
358
+ }, {
359
+ token : "paren.rparen",
360
+ regex : "[\\])}]"
361
+ }, {
362
+ token : "keyword.operator",
363
+ regex : "\\/=?",
364
+ next : "regex_allowed"
365
+ }, {
366
+ token: "comment",
367
+ regex: "^#!.*$"
368
+ }, {
369
+ token : "text",
370
+ regex : "\\s+"
371
+ }
372
+ ],
373
+ // regular expressions are only allowed after certain tokens. This
374
+ // makes sure we don't mix up regexps with the divison operator
375
+ "regex_allowed": [
376
+ {
377
+ token : "comment", // multi line comment
378
+ merge : true,
379
+ regex : "\\/\\*",
380
+ next : "comment_regex_allowed"
381
+ }, {
382
+ token : "comment",
383
+ regex : "\\/\\/.*$"
384
+ }, {
385
+ token: "string.regexp",
386
+ regex: "\\/",
387
+ next: "regex",
388
+ merge: true
389
+ }, {
390
+ token : "text",
391
+ regex : "\\s+"
392
+ }, {
393
+ // immediately return to the start mode without matching
394
+ // anything
395
+ token: "empty",
396
+ regex: "",
397
+ next: "start"
398
+ }
399
+ ],
400
+ "regex": [
401
+ {
402
+ token: "regexp.keyword.operator",
403
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
404
+ next: "regex"
405
+ }, {
406
+ // flag
407
+ token: "string.regexp",
408
+ regex: "/\\w*",
409
+ next: "start",
410
+ merge: true
411
+ }, {
412
+ token: "string.regexp",
413
+ regex: "[^\\\\/\\[]+",
414
+ next: "regex",
415
+ merge: true
416
+ }, {
417
+ token: "string.regexp.charachterclass",
418
+ regex: "\\[",
419
+ next: "regex_character_class",
420
+ merge: true
421
+ }, {
422
+ token: "empty",
423
+ regex: "",
424
+ next: "start"
425
+ }
426
+ ],
427
+ "regex_character_class": [
428
+ {
429
+ token: "regexp.keyword.operator",
430
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
431
+ next: "regex_character_class"
432
+ }, {
433
+ token: "string.regexp.charachterclass",
434
+ regex: "]",
435
+ next: "regex",
436
+ merge: true
437
+ }, {
438
+ token: "string.regexp.charachterclass",
439
+ regex: "[^\\\\\\]]+",
440
+ next: "regex_character_class",
441
+ merge: true
442
+ }, {
443
+ token: "empty",
444
+ regex: "",
445
+ next: "start"
446
+ }
447
+ ],
448
+ "comment_regex_allowed" : [
449
+ {
450
+ token : "comment", // closing comment
451
+ regex : ".*?\\*\\/",
452
+ merge : true,
453
+ next : "regex_allowed"
454
+ }, {
455
+ token : "comment", // comment spanning whole line
456
+ merge : true,
457
+ regex : ".+"
458
+ }
459
+ ],
460
+ "comment" : [
461
+ {
462
+ token : "comment", // closing comment
463
+ regex : ".*?\\*\\/",
464
+ merge : true,
465
+ next : "start"
466
+ }, {
467
+ token : "comment", // comment spanning whole line
468
+ merge : true,
469
+ regex : ".+"
470
+ }
471
+ ],
472
+ "qqstring" : [
473
+ {
474
+ token : "constant.language.escape",
475
+ regex : escapedRe
476
+ }, {
477
+ token : "string",
478
+ regex : '[^"\\\\]+'
479
+ }, {
480
+ token : "string",
481
+ regex : '"',
482
+ next : "start"
483
+ }
484
+ ],
485
+ "qstring" : [
486
+ {
487
+ token : "constant.language.escape",
488
+ regex : escapedRe
489
+ }, {
490
+ token : "string",
491
+ regex : "[^'\\\\]+"
492
+ }, {
493
+ token : "string",
494
+ regex : "'",
495
+ next : "start"
496
+ }
497
+ ]
498
+ };
499
+
500
+ this.embedRules(DocCommentHighlightRules, "doc-",
501
+ [ new DocCommentHighlightRules().getEndRule("start") ]);
502
+ };
503
+
504
+ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
505
+
506
+ exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
507
+ });
508
+ /* ***** BEGIN LICENSE BLOCK *****
509
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
510
+ *
511
+ * The contents of this file are subject to the Mozilla Public License Version
512
+ * 1.1 (the "License"); you may not use this file except in compliance with
513
+ * the License. You may obtain a copy of the License at
514
+ * http://www.mozilla.org/MPL/
515
+ *
516
+ * Software distributed under the License is distributed on an "AS IS" basis,
517
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
518
+ * for the specific language governing rights and limitations under the
519
+ * License.
520
+ *
521
+ * The Original Code is Ajax.org Code Editor (ACE).
522
+ *
523
+ * The Initial Developer of the Original Code is
524
+ * Ajax.org B.V.
525
+ * Portions created by the Initial Developer are Copyright (C) 2010
526
+ * the Initial Developer. All Rights Reserved.
527
+ *
528
+ * Contributor(s):
529
+ * Fabian Jakobs <fabian AT ajax DOT org>
530
+ *
531
+ * Alternatively, the contents of this file may be used under the terms of
532
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
533
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
534
+ * in which case the provisions of the GPL or the LGPL are applicable instead
535
+ * of those above. If you wish to allow use of your version of this file only
536
+ * under the terms of either the GPL or the LGPL, and not to allow others to
537
+ * use your version of this file under the terms of the MPL, indicate your
538
+ * decision by deleting the provisions above and replace them with the notice
539
+ * and other provisions required by the GPL or the LGPL. If you do not delete
540
+ * the provisions above, a recipient may use your version of this file under
541
+ * the terms of any one of the MPL, the GPL or the LGPL.
542
+ *
543
+ * ***** END LICENSE BLOCK ***** */
544
+
545
+ define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
546
+ "use strict";
547
+
548
+ var oop = require("../lib/oop");
549
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
550
+
551
+ var DocCommentHighlightRules = function() {
552
+
553
+ this.$rules = {
554
+ "start" : [ {
555
+ token : "comment.doc.tag",
556
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
557
+ }, {
558
+ token : "comment.doc",
559
+ merge : true,
560
+ regex : "\\s+"
561
+ }, {
562
+ token : "comment.doc",
563
+ merge : true,
564
+ regex : "TODO"
565
+ }, {
566
+ token : "comment.doc",
567
+ merge : true,
568
+ regex : "[^@\\*]+"
569
+ }, {
570
+ token : "comment.doc",
571
+ merge : true,
572
+ regex : "."
573
+ }]
574
+ };
575
+ };
576
+
577
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
578
+
579
+ (function() {
580
+
581
+ this.getStartRule = function(start) {
582
+ return {
583
+ token : "comment.doc", // doc comment
584
+ merge : true,
585
+ regex : "\\/\\*(?=\\*)",
586
+ next : start
587
+ };
588
+ };
589
+
590
+ this.getEndRule = function (start) {
591
+ return {
592
+ token : "comment.doc", // closing comment
593
+ merge : true,
594
+ regex : "\\*\\/",
595
+ next : start
596
+ };
597
+ };
598
+
599
+ }).call(DocCommentHighlightRules.prototype);
600
+
601
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
602
+
603
+ });
604
+ /* ***** BEGIN LICENSE BLOCK *****
605
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
606
+ *
607
+ * The contents of this file are subject to the Mozilla Public License Version
608
+ * 1.1 (the "License"); you may not use this file except in compliance with
609
+ * the License. You may obtain a copy of the License at
610
+ * http://www.mozilla.org/MPL/
611
+ *
612
+ * Software distributed under the License is distributed on an "AS IS" basis,
613
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
614
+ * for the specific language governing rights and limitations under the
615
+ * License.
616
+ *
617
+ * The Original Code is Ajax.org Code Editor (ACE).
618
+ *
619
+ * The Initial Developer of the Original Code is
620
+ * Ajax.org B.V.
621
+ * Portions created by the Initial Developer are Copyright (C) 2010
622
+ * the Initial Developer. All Rights Reserved.
623
+ *
624
+ * Contributor(s):
625
+ * Fabian Jakobs <fabian AT ajax DOT org>
626
+ *
627
+ * Alternatively, the contents of this file may be used under the terms of
628
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
629
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
630
+ * in which case the provisions of the GPL or the LGPL are applicable instead
631
+ * of those above. If you wish to allow use of your version of this file only
632
+ * under the terms of either the GPL or the LGPL, and not to allow others to
633
+ * use your version of this file under the terms of the MPL, indicate your
634
+ * decision by deleting the provisions above and replace them with the notice
635
+ * and other provisions required by the GPL or the LGPL. If you do not delete
636
+ * the provisions above, a recipient may use your version of this file under
637
+ * the terms of any one of the MPL, the GPL or the LGPL.
638
+ *
639
+ * ***** END LICENSE BLOCK ***** */
640
+
641
+ define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
642
+ "use strict";
643
+
644
+ var Range = require("../range").Range;
645
+
646
+ var MatchingBraceOutdent = function() {};
647
+
648
+ (function() {
649
+
650
+ this.checkOutdent = function(line, input) {
651
+ if (! /^\s+$/.test(line))
652
+ return false;
653
+
654
+ return /^\s*\}/.test(input);
655
+ };
656
+
657
+ this.autoOutdent = function(doc, row) {
658
+ var line = doc.getLine(row);
659
+ var match = line.match(/^(\s*\})/);
660
+
661
+ if (!match) return 0;
662
+
663
+ var column = match[1].length;
664
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
665
+
666
+ if (!openBracePos || openBracePos.row == row) return 0;
667
+
668
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
669
+ doc.replace(new Range(row, 0, row, column-1), indent);
670
+ };
671
+
672
+ this.$getIndent = function(line) {
673
+ var match = line.match(/^(\s+)/);
674
+ if (match) {
675
+ return match[1];
676
+ }
677
+
678
+ return "";
679
+ };
680
+
681
+ }).call(MatchingBraceOutdent.prototype);
682
+
683
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
684
+ });
685
+ /* vim:ts=4:sts=4:sw=4:
686
+ * ***** BEGIN LICENSE BLOCK *****
687
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
688
+ *
689
+ * The contents of this file are subject to the Mozilla Public License Version
690
+ * 1.1 (the "License"); you may not use this file except in compliance with
691
+ * the License. You may obtain a copy of the License at
692
+ * http://www.mozilla.org/MPL/
693
+ *
694
+ * Software distributed under the License is distributed on an "AS IS" basis,
695
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
696
+ * for the specific language governing rights and limitations under the
697
+ * License.
698
+ *
699
+ * The Original Code is Ajax.org Code Editor (ACE).
700
+ *
701
+ * The Initial Developer of the Original Code is
702
+ * Ajax.org B.V.
703
+ * Portions created by the Initial Developer are Copyright (C) 2010
704
+ * the Initial Developer. All Rights Reserved.
705
+ *
706
+ * Contributor(s):
707
+ * Chris Spencer <chris.ag.spencer AT googlemail DOT com>
708
+ *
709
+ * Alternatively, the contents of this file may be used under the terms of
710
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
711
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
712
+ * in which case the provisions of the GPL or the LGPL are applicable instead
713
+ * of those above. If you wish to allow use of your version of this file only
714
+ * under the terms of either the GPL or the LGPL, and not to allow others to
715
+ * use your version of this file under the terms of the MPL, indicate your
716
+ * decision by deleting the provisions above and replace them with the notice
717
+ * and other provisions required by the GPL or the LGPL. If you do not delete
718
+ * the provisions above, a recipient may use your version of this file under
719
+ * the terms of any one of the MPL, the GPL or the LGPL.
720
+ *
721
+ * ***** END LICENSE BLOCK ***** */
722
+
723
+ define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
724
+ "use strict";
725
+
726
+ var oop = require("../../lib/oop");
727
+ var Behaviour = require('../behaviour').Behaviour;
728
+
729
+ var CstyleBehaviour = function () {
730
+
731
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
732
+ if (text == '{') {
733
+ var selection = editor.getSelectionRange();
734
+ var selected = session.doc.getTextRange(selection);
735
+ if (selected !== "") {
736
+ return {
737
+ text: '{' + selected + '}',
738
+ selection: false
739
+ }
740
+ } else {
741
+ return {
742
+ text: '{}',
743
+ selection: [1, 1]
744
+ }
745
+ }
746
+ } else if (text == '}') {
747
+ var cursor = editor.getCursorPosition();
748
+ var line = session.doc.getLine(cursor.row);
749
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
750
+ if (rightChar == '}') {
751
+ var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
752
+ if (matching !== null) {
753
+ return {
754
+ text: '',
755
+ selection: [1, 1]
756
+ }
757
+ }
758
+ }
759
+ } else if (text == "\n") {
760
+ var cursor = editor.getCursorPosition();
761
+ var line = session.doc.getLine(cursor.row);
762
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
763
+ if (rightChar == '}') {
764
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
765
+ if (!openBracePos)
766
+ return null;
767
+
768
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
769
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
770
+
771
+ return {
772
+ text: '\n' + indent + '\n' + next_indent,
773
+ selection: [1, indent.length, 1, indent.length]
774
+ }
775
+ }
776
+ }
777
+ });
778
+
779
+ this.add("braces", "deletion", function (state, action, editor, session, range) {
780
+ var selected = session.doc.getTextRange(range);
781
+ if (!range.isMultiLine() && selected == '{') {
782
+ var line = session.doc.getLine(range.start.row);
783
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
784
+ if (rightChar == '}') {
785
+ range.end.column++;
786
+ return range;
787
+ }
788
+ }
789
+ });
790
+
791
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
792
+ if (text == '(') {
793
+ var selection = editor.getSelectionRange();
794
+ var selected = session.doc.getTextRange(selection);
795
+ if (selected !== "") {
796
+ return {
797
+ text: '(' + selected + ')',
798
+ selection: false
799
+ }
800
+ } else {
801
+ return {
802
+ text: '()',
803
+ selection: [1, 1]
804
+ }
805
+ }
806
+ } else if (text == ')') {
807
+ var cursor = editor.getCursorPosition();
808
+ var line = session.doc.getLine(cursor.row);
809
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
810
+ if (rightChar == ')') {
811
+ var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
812
+ if (matching !== null) {
813
+ return {
814
+ text: '',
815
+ selection: [1, 1]
816
+ }
817
+ }
818
+ }
819
+ }
820
+ });
821
+
822
+ this.add("parens", "deletion", function (state, action, editor, session, range) {
823
+ var selected = session.doc.getTextRange(range);
824
+ if (!range.isMultiLine() && selected == '(') {
825
+ var line = session.doc.getLine(range.start.row);
826
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
827
+ if (rightChar == ')') {
828
+ range.end.column++;
829
+ return range;
830
+ }
831
+ }
832
+ });
833
+
834
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
835
+ if (text == '"') {
836
+ var selection = editor.getSelectionRange();
837
+ var selected = session.doc.getTextRange(selection);
838
+ if (selected !== "") {
839
+ return {
840
+ text: '"' + selected + '"',
841
+ selection: false
842
+ }
843
+ } else {
844
+ var cursor = editor.getCursorPosition();
845
+ var line = session.doc.getLine(cursor.row);
846
+ var leftChar = line.substring(cursor.column-1, cursor.column);
847
+
848
+ // We're escaped.
849
+ if (leftChar == '\\') {
850
+ return null;
851
+ }
852
+
853
+ // Find what token we're inside.
854
+ var tokens = session.getTokens(selection.start.row, selection.start.row)[0].tokens;
855
+ var col = 0, token;
856
+ var quotepos = -1; // Track whether we're inside an open quote.
857
+
858
+ for (var x = 0; x < tokens.length; x++) {
859
+ token = tokens[x];
860
+ if (token.type == "string") {
861
+ quotepos = -1;
862
+ } else if (quotepos < 0) {
863
+ quotepos = token.value.indexOf('"');
864
+ }
865
+ if ((token.value.length + col) > selection.start.column) {
866
+ break;
867
+ }
868
+ col += tokens[x].value.length;
869
+ }
870
+
871
+ // Try and be smart about when we auto insert.
872
+ if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf('"') === token.value.length-1)))) {
873
+ return {
874
+ text: '""',
875
+ selection: [1,1]
876
+ }
877
+ } else if (token && token.type === "string") {
878
+ // Ignore input and move right one if we're typing over the closing quote.
879
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
880
+ if (rightChar == '"') {
881
+ return {
882
+ text: '',
883
+ selection: [1, 1]
884
+ }
885
+ }
886
+ }
887
+ }
888
+ }
889
+ });
890
+
891
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
892
+ var selected = session.doc.getTextRange(range);
893
+ if (!range.isMultiLine() && selected == '"') {
894
+ var line = session.doc.getLine(range.start.row);
895
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
896
+ if (rightChar == '"') {
897
+ range.end.column++;
898
+ return range;
899
+ }
900
+ }
901
+ });
902
+
903
+ }
904
+ oop.inherits(CstyleBehaviour, Behaviour);
905
+
906
+ exports.CstyleBehaviour = CstyleBehaviour;
907
+ });/* ***** BEGIN LICENSE BLOCK *****
908
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
909
+ *
910
+ * The contents of this file are subject to the Mozilla Public License Version
911
+ * 1.1 (the "License"); you may not use this file except in compliance with
912
+ * the License. You may obtain a copy of the License at
913
+ * http://www.mozilla.org/MPL/
914
+ *
915
+ * Software distributed under the License is distributed on an "AS IS" basis,
916
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
917
+ * for the specific language governing rights and limitations under the
918
+ * License.
919
+ *
920
+ * The Original Code is Ajax.org Code Editor (ACE).
921
+ *
922
+ * The Initial Developer of the Original Code is
923
+ * Ajax.org B.V.
924
+ * Portions created by the Initial Developer are Copyright (C) 2010
925
+ * the Initial Developer. All Rights Reserved.
926
+ *
927
+ * Contributor(s):
928
+ * Fabian Jakobs <fabian AT ajax DOT org>
929
+ *
930
+ * Alternatively, the contents of this file may be used under the terms of
931
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
932
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
933
+ * in which case the provisions of the GPL or the LGPL are applicable instead
934
+ * of those above. If you wish to allow use of your version of this file only
935
+ * under the terms of either the GPL or the LGPL, and not to allow others to
936
+ * use your version of this file under the terms of the MPL, indicate your
937
+ * decision by deleting the provisions above and replace them with the notice
938
+ * and other provisions required by the GPL or the LGPL. If you do not delete
939
+ * the provisions above, a recipient may use your version of this file under
940
+ * the terms of any one of the MPL, the GPL or the LGPL.
941
+ *
942
+ * ***** END LICENSE BLOCK ***** */
943
+
944
+ define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
945
+ "use strict";
946
+
947
+ var oop = require("../../lib/oop");
948
+ var Range = require("../../range").Range;
949
+ var BaseFoldMode = require("./fold_mode").FoldMode;
950
+
951
+ var FoldMode = exports.FoldMode = function() {};
952
+ oop.inherits(FoldMode, BaseFoldMode);
953
+
954
+ (function() {
955
+
956
+ this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
957
+ this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
958
+
959
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
960
+ var line = session.getLine(row);
961
+ var match = line.match(this.foldingStartMarker);
962
+ if (match) {
963
+ var i = match.index;
964
+
965
+ if (match[1])
966
+ return this.openingBracketBlock(session, match[1], row, i);
967
+
968
+ var range = session.getCommentFoldRange(row, i + match[0].length);
969
+ range.end.column -= 2;
970
+ return range;
971
+ }
972
+
973
+ if (foldStyle !== "markbeginend")
974
+ return;
975
+
976
+ var match = line.match(this.foldingStopMarker);
977
+ if (match) {
978
+ var i = match.index + match[0].length;
979
+
980
+ if (match[2]) {
981
+ var range = session.getCommentFoldRange(row, i);
982
+ range.end.column -= 2;
983
+ return range;
984
+ }
985
+
986
+ var end = {row: row, column: i};
987
+ var start = session.$findOpeningBracket(match[1], end);
988
+
989
+ if (!start)
990
+ return;
991
+
992
+ start.column++;
993
+ end.column--;
994
+
995
+ return Range.fromPoints(start, end);
996
+ }
997
+ };
998
+
999
+ }).call(FoldMode.prototype);
1000
+
1001
+ });/* ***** BEGIN LICENSE BLOCK *****
1002
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1003
+ *
1004
+ * The contents of this file are subject to the Mozilla Public License Version
1005
+ * 1.1 (the "License"); you may not use this file except in compliance with
1006
+ * the License. You may obtain a copy of the License at
1007
+ * http://www.mozilla.org/MPL/
1008
+ *
1009
+ * Software distributed under the License is distributed on an "AS IS" basis,
1010
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1011
+ * for the specific language governing rights and limitations under the
1012
+ * License.
1013
+ *
1014
+ * The Original Code is Ajax.org Code Editor (ACE).
1015
+ *
1016
+ * The Initial Developer of the Original Code is
1017
+ * Ajax.org B.V.
1018
+ * Portions created by the Initial Developer are Copyright (C) 2010
1019
+ * the Initial Developer. All Rights Reserved.
1020
+ *
1021
+ * Contributor(s):
1022
+ * Fabian Jakobs <fabian AT ajax DOT org>
1023
+ *
1024
+ * Alternatively, the contents of this file may be used under the terms of
1025
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
1026
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1027
+ * in which case the provisions of the GPL or the LGPL are applicable instead
1028
+ * of those above. If you wish to allow use of your version of this file only
1029
+ * under the terms of either the GPL or the LGPL, and not to allow others to
1030
+ * use your version of this file under the terms of the MPL, indicate your
1031
+ * decision by deleting the provisions above and replace them with the notice
1032
+ * and other provisions required by the GPL or the LGPL. If you do not delete
1033
+ * the provisions above, a recipient may use your version of this file under
1034
+ * the terms of any one of the MPL, the GPL or the LGPL.
1035
+ *
1036
+ * ***** END LICENSE BLOCK ***** */
1037
+
1038
+ define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
1039
+ "use strict";
1040
+
1041
+ var Range = require("../../range").Range;
1042
+
1043
+ var FoldMode = exports.FoldMode = function() {};
1044
+
1045
+ (function() {
1046
+
1047
+ this.foldingStartMarker = null;
1048
+ this.foldingStopMarker = null;
1049
+
1050
+ // must return "" if there's no fold, to enable caching
1051
+ this.getFoldWidget = function(session, foldStyle, row) {
1052
+ var line = session.getLine(row);
1053
+ if (this.foldingStartMarker.test(line))
1054
+ return "start";
1055
+ if (foldStyle == "markbeginend"
1056
+ && this.foldingStopMarker
1057
+ && this.foldingStopMarker.test(line))
1058
+ return "end";
1059
+ return "";
1060
+ };
1061
+
1062
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1063
+ return null;
1064
+ };
1065
+
1066
+ this.indentationBlock = function(session, row, column) {
1067
+ var re = /^\s*/;
1068
+ var startRow = row;
1069
+ var endRow = row;
1070
+ var line = session.getLine(row);
1071
+ var startColumn = column || line.length;
1072
+ var startLevel = line.match(re)[0].length;
1073
+ var maxRow = session.getLength()
1074
+
1075
+ while (++row < maxRow) {
1076
+ line = session.getLine(row);
1077
+ var level = line.match(re)[0].length;
1078
+
1079
+ if (level == line.length)
1080
+ continue;
1081
+
1082
+ if (level <= startLevel)
1083
+ break;
1084
+
1085
+ endRow = row;
1086
+ }
1087
+
1088
+ if (endRow > startRow) {
1089
+ var endColumn = session.getLine(endRow).length;
1090
+ return new Range(startRow, startColumn, endRow, endColumn);
1091
+ }
1092
+ };
1093
+
1094
+ this.openingBracketBlock = function(session, bracket, row, column) {
1095
+ var start = {row: row, column: column + 1};
1096
+ var end = session.$findClosingBracket(bracket, start);
1097
+ if (!end)
1098
+ return;
1099
+
1100
+ var fw = session.foldWidgets[end.row];
1101
+ if (fw == null)
1102
+ fw = this.getFoldWidget(session, end.row);
1103
+
1104
+ if (fw == "start") {
1105
+ end.row --;
1106
+ end.column = session.getLine(end.row).length;
1107
+ }
1108
+ return Range.fromPoints(start, end);
1109
+ };
1110
+
1111
+ }).call(FoldMode.prototype);
1112
+
1113
+ });