aced_rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
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,768 @@
1
+ define('ace/mode/haxe', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/haxe_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
2
+ "use strict";
3
+
4
+ var oop = require("../lib/oop");
5
+ var TextMode = require("./text").Mode;
6
+ var Tokenizer = require("../tokenizer").Tokenizer;
7
+ var HaxeHighlightRules = require("./haxe_highlight_rules").HaxeHighlightRules;
8
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
9
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
10
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
11
+
12
+ var Mode = function() {
13
+ this.$tokenizer = new Tokenizer(new HaxeHighlightRules().getRules());
14
+ this.$outdent = new MatchingBraceOutdent();
15
+ this.$behaviour = new CstyleBehaviour();
16
+ this.foldingRules = new CStyleFoldMode();
17
+ };
18
+ oop.inherits(Mode, TextMode);
19
+
20
+ (function() {
21
+
22
+ this.getNextLineIndent = function(state, line, tab) {
23
+ var indent = this.$getIndent(line);
24
+
25
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
26
+ var tokens = tokenizedLine.tokens;
27
+
28
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
29
+ return indent;
30
+ }
31
+
32
+ if (state == "start") {
33
+ var match = line.match(/^.*[\{\(\[]\s*$/);
34
+ if (match) {
35
+ indent += tab;
36
+ }
37
+ }
38
+
39
+ return indent;
40
+ };
41
+
42
+ this.checkOutdent = function(state, line, input) {
43
+ return this.$outdent.checkOutdent(line, input);
44
+ };
45
+
46
+ this.autoOutdent = function(state, doc, row) {
47
+ this.$outdent.autoOutdent(doc, row);
48
+ };
49
+
50
+
51
+ this.createWorker = function(session) {
52
+ return null;
53
+ };
54
+
55
+ }).call(Mode.prototype);
56
+
57
+ exports.Mode = Mode;
58
+ });
59
+ define('ace/mode/haxe_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
60
+ "use strict";
61
+
62
+ var oop = require("../lib/oop");
63
+ var lang = require("../lib/lang");
64
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
65
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
66
+
67
+ var HaxeHighlightRules = function() {
68
+
69
+ var keywords = lang.arrayToMap(
70
+ ("break|case|cast|catch|class|continue|default|else|enum|extends|for|function|if|implements|import|in|inline|interface|new|override|package|private|public|return|static|super|switch|this|throw|trace|try|typedef|untyped|var|while|Array|Void|Bool|Int|UInt|Float|Dynamic|String|List|Hash|IntHash|Error|Unknown|Type|Std").split("|")
71
+ );
72
+
73
+ var buildinConstants = lang.arrayToMap(
74
+ ("null|true|false").split("|")
75
+ );
76
+
77
+
78
+ // regexp must not have capturing parentheses. Use (?:) instead.
79
+ // regexps are ordered -> the first match is used
80
+
81
+ this.$rules = {
82
+ "start" : [
83
+ {
84
+ token : "comment",
85
+ regex : "\\/\\/.*$"
86
+ },
87
+ new DocCommentHighlightRules().getStartRule("doc-start"),
88
+ {
89
+ token : "comment", // multi line comment
90
+ regex : "\\/\\*",
91
+ merge : true,
92
+ next : "comment"
93
+ }, {
94
+ token : "string.regexp",
95
+ regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
96
+ }, {
97
+ token : "string", // single line
98
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
99
+ }, {
100
+ token : "string", // single line
101
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
102
+ }, {
103
+ token : "constant.numeric", // hex
104
+ regex : "0[xX][0-9a-fA-F]+\\b"
105
+ }, {
106
+ token : "constant.numeric", // float
107
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
108
+ }, {
109
+ token : "constant.language.boolean",
110
+ regex : "(?:true|false)\\b"
111
+ }, {
112
+ token : function(value) {
113
+ if (value == "this")
114
+ return "variable.language";
115
+ else if (keywords.hasOwnProperty(value))
116
+ return "keyword";
117
+ else if (buildinConstants.hasOwnProperty(value))
118
+ return "constant.language";
119
+ else
120
+ return "identifier";
121
+ },
122
+ // TODO: Unicode escape sequences
123
+ // TODO: Unicode identifiers
124
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
125
+ }, {
126
+ token : "keyword.operator",
127
+ regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
128
+ }, {
129
+ token : "punctuation.operator",
130
+ regex : "\\?|\\:|\\,|\\;|\\."
131
+ }, {
132
+ token : "paren.lparen",
133
+ regex : "[[({<]"
134
+ }, {
135
+ token : "paren.rparen",
136
+ regex : "[\\])}>]"
137
+ }, {
138
+ token : "text",
139
+ regex : "\\s+"
140
+ }
141
+ ],
142
+ "comment" : [
143
+ {
144
+ token : "comment", // closing comment
145
+ regex : ".*?\\*\\/",
146
+ next : "start"
147
+ }, {
148
+ token : "comment", // comment spanning whole line
149
+ merge : true,
150
+ regex : ".+"
151
+ }
152
+ ]
153
+ };
154
+
155
+ this.embedRules(DocCommentHighlightRules, "doc-",
156
+ [ new DocCommentHighlightRules().getEndRule("start") ]);
157
+ };
158
+
159
+ oop.inherits(HaxeHighlightRules, TextHighlightRules);
160
+
161
+ exports.HaxeHighlightRules = HaxeHighlightRules;
162
+ });
163
+ /* ***** BEGIN LICENSE BLOCK *****
164
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
165
+ *
166
+ * The contents of this file are subject to the Mozilla Public License Version
167
+ * 1.1 (the "License"); you may not use this file except in compliance with
168
+ * the License. You may obtain a copy of the License at
169
+ * http://www.mozilla.org/MPL/
170
+ *
171
+ * Software distributed under the License is distributed on an "AS IS" basis,
172
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
173
+ * for the specific language governing rights and limitations under the
174
+ * License.
175
+ *
176
+ * The Original Code is Ajax.org Code Editor (ACE).
177
+ *
178
+ * The Initial Developer of the Original Code is
179
+ * Ajax.org B.V.
180
+ * Portions created by the Initial Developer are Copyright (C) 2010
181
+ * the Initial Developer. All Rights Reserved.
182
+ *
183
+ * Contributor(s):
184
+ * Fabian Jakobs <fabian AT ajax DOT org>
185
+ *
186
+ * Alternatively, the contents of this file may be used under the terms of
187
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
188
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
189
+ * in which case the provisions of the GPL or the LGPL are applicable instead
190
+ * of those above. If you wish to allow use of your version of this file only
191
+ * under the terms of either the GPL or the LGPL, and not to allow others to
192
+ * use your version of this file under the terms of the MPL, indicate your
193
+ * decision by deleting the provisions above and replace them with the notice
194
+ * and other provisions required by the GPL or the LGPL. If you do not delete
195
+ * the provisions above, a recipient may use your version of this file under
196
+ * the terms of any one of the MPL, the GPL or the LGPL.
197
+ *
198
+ * ***** END LICENSE BLOCK ***** */
199
+
200
+ define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
201
+ "use strict";
202
+
203
+ var oop = require("../lib/oop");
204
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
205
+
206
+ var DocCommentHighlightRules = function() {
207
+
208
+ this.$rules = {
209
+ "start" : [ {
210
+ token : "comment.doc.tag",
211
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
212
+ }, {
213
+ token : "comment.doc",
214
+ merge : true,
215
+ regex : "\\s+"
216
+ }, {
217
+ token : "comment.doc",
218
+ merge : true,
219
+ regex : "TODO"
220
+ }, {
221
+ token : "comment.doc",
222
+ merge : true,
223
+ regex : "[^@\\*]+"
224
+ }, {
225
+ token : "comment.doc",
226
+ merge : true,
227
+ regex : "."
228
+ }]
229
+ };
230
+ };
231
+
232
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
233
+
234
+ (function() {
235
+
236
+ this.getStartRule = function(start) {
237
+ return {
238
+ token : "comment.doc", // doc comment
239
+ merge : true,
240
+ regex : "\\/\\*(?=\\*)",
241
+ next : start
242
+ };
243
+ };
244
+
245
+ this.getEndRule = function (start) {
246
+ return {
247
+ token : "comment.doc", // closing comment
248
+ merge : true,
249
+ regex : "\\*\\/",
250
+ next : start
251
+ };
252
+ };
253
+
254
+ }).call(DocCommentHighlightRules.prototype);
255
+
256
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
257
+
258
+ });
259
+ /* ***** BEGIN LICENSE BLOCK *****
260
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
261
+ *
262
+ * The contents of this file are subject to the Mozilla Public License Version
263
+ * 1.1 (the "License"); you may not use this file except in compliance with
264
+ * the License. You may obtain a copy of the License at
265
+ * http://www.mozilla.org/MPL/
266
+ *
267
+ * Software distributed under the License is distributed on an "AS IS" basis,
268
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
269
+ * for the specific language governing rights and limitations under the
270
+ * License.
271
+ *
272
+ * The Original Code is Ajax.org Code Editor (ACE).
273
+ *
274
+ * The Initial Developer of the Original Code is
275
+ * Ajax.org B.V.
276
+ * Portions created by the Initial Developer are Copyright (C) 2010
277
+ * the Initial Developer. All Rights Reserved.
278
+ *
279
+ * Contributor(s):
280
+ * Fabian Jakobs <fabian AT ajax DOT org>
281
+ *
282
+ * Alternatively, the contents of this file may be used under the terms of
283
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
284
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
285
+ * in which case the provisions of the GPL or the LGPL are applicable instead
286
+ * of those above. If you wish to allow use of your version of this file only
287
+ * under the terms of either the GPL or the LGPL, and not to allow others to
288
+ * use your version of this file under the terms of the MPL, indicate your
289
+ * decision by deleting the provisions above and replace them with the notice
290
+ * and other provisions required by the GPL or the LGPL. If you do not delete
291
+ * the provisions above, a recipient may use your version of this file under
292
+ * the terms of any one of the MPL, the GPL or the LGPL.
293
+ *
294
+ * ***** END LICENSE BLOCK ***** */
295
+
296
+ define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
297
+ "use strict";
298
+
299
+ var Range = require("../range").Range;
300
+
301
+ var MatchingBraceOutdent = function() {};
302
+
303
+ (function() {
304
+
305
+ this.checkOutdent = function(line, input) {
306
+ if (! /^\s+$/.test(line))
307
+ return false;
308
+
309
+ return /^\s*\}/.test(input);
310
+ };
311
+
312
+ this.autoOutdent = function(doc, row) {
313
+ var line = doc.getLine(row);
314
+ var match = line.match(/^(\s*\})/);
315
+
316
+ if (!match) return 0;
317
+
318
+ var column = match[1].length;
319
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
320
+
321
+ if (!openBracePos || openBracePos.row == row) return 0;
322
+
323
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
324
+ doc.replace(new Range(row, 0, row, column-1), indent);
325
+ };
326
+
327
+ this.$getIndent = function(line) {
328
+ var match = line.match(/^(\s+)/);
329
+ if (match) {
330
+ return match[1];
331
+ }
332
+
333
+ return "";
334
+ };
335
+
336
+ }).call(MatchingBraceOutdent.prototype);
337
+
338
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
339
+ });
340
+ /* vim:ts=4:sts=4:sw=4:
341
+ * ***** BEGIN LICENSE BLOCK *****
342
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
343
+ *
344
+ * The contents of this file are subject to the Mozilla Public License Version
345
+ * 1.1 (the "License"); you may not use this file except in compliance with
346
+ * the License. You may obtain a copy of the License at
347
+ * http://www.mozilla.org/MPL/
348
+ *
349
+ * Software distributed under the License is distributed on an "AS IS" basis,
350
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
351
+ * for the specific language governing rights and limitations under the
352
+ * License.
353
+ *
354
+ * The Original Code is Ajax.org Code Editor (ACE).
355
+ *
356
+ * The Initial Developer of the Original Code is
357
+ * Ajax.org B.V.
358
+ * Portions created by the Initial Developer are Copyright (C) 2010
359
+ * the Initial Developer. All Rights Reserved.
360
+ *
361
+ * Contributor(s):
362
+ * Chris Spencer <chris.ag.spencer AT googlemail DOT com>
363
+ *
364
+ * Alternatively, the contents of this file may be used under the terms of
365
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
366
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
367
+ * in which case the provisions of the GPL or the LGPL are applicable instead
368
+ * of those above. If you wish to allow use of your version of this file only
369
+ * under the terms of either the GPL or the LGPL, and not to allow others to
370
+ * use your version of this file under the terms of the MPL, indicate your
371
+ * decision by deleting the provisions above and replace them with the notice
372
+ * and other provisions required by the GPL or the LGPL. If you do not delete
373
+ * the provisions above, a recipient may use your version of this file under
374
+ * the terms of any one of the MPL, the GPL or the LGPL.
375
+ *
376
+ * ***** END LICENSE BLOCK ***** */
377
+
378
+ define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
379
+ "use strict";
380
+
381
+ var oop = require("../../lib/oop");
382
+ var Behaviour = require('../behaviour').Behaviour;
383
+
384
+ var CstyleBehaviour = function () {
385
+
386
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
387
+ if (text == '{') {
388
+ var selection = editor.getSelectionRange();
389
+ var selected = session.doc.getTextRange(selection);
390
+ if (selected !== "") {
391
+ return {
392
+ text: '{' + selected + '}',
393
+ selection: false
394
+ }
395
+ } else {
396
+ return {
397
+ text: '{}',
398
+ selection: [1, 1]
399
+ }
400
+ }
401
+ } else if (text == '}') {
402
+ var cursor = editor.getCursorPosition();
403
+ var line = session.doc.getLine(cursor.row);
404
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
405
+ if (rightChar == '}') {
406
+ var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
407
+ if (matching !== null) {
408
+ return {
409
+ text: '',
410
+ selection: [1, 1]
411
+ }
412
+ }
413
+ }
414
+ } else if (text == "\n") {
415
+ var cursor = editor.getCursorPosition();
416
+ var line = session.doc.getLine(cursor.row);
417
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
418
+ if (rightChar == '}') {
419
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
420
+ if (!openBracePos)
421
+ return null;
422
+
423
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
424
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
425
+
426
+ return {
427
+ text: '\n' + indent + '\n' + next_indent,
428
+ selection: [1, indent.length, 1, indent.length]
429
+ }
430
+ }
431
+ }
432
+ });
433
+
434
+ this.add("braces", "deletion", function (state, action, editor, session, range) {
435
+ var selected = session.doc.getTextRange(range);
436
+ if (!range.isMultiLine() && selected == '{') {
437
+ var line = session.doc.getLine(range.start.row);
438
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
439
+ if (rightChar == '}') {
440
+ range.end.column++;
441
+ return range;
442
+ }
443
+ }
444
+ });
445
+
446
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
447
+ if (text == '(') {
448
+ var selection = editor.getSelectionRange();
449
+ var selected = session.doc.getTextRange(selection);
450
+ if (selected !== "") {
451
+ return {
452
+ text: '(' + selected + ')',
453
+ selection: false
454
+ }
455
+ } else {
456
+ return {
457
+ text: '()',
458
+ selection: [1, 1]
459
+ }
460
+ }
461
+ } else if (text == ')') {
462
+ var cursor = editor.getCursorPosition();
463
+ var line = session.doc.getLine(cursor.row);
464
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
465
+ if (rightChar == ')') {
466
+ var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
467
+ if (matching !== null) {
468
+ return {
469
+ text: '',
470
+ selection: [1, 1]
471
+ }
472
+ }
473
+ }
474
+ }
475
+ });
476
+
477
+ this.add("parens", "deletion", function (state, action, editor, session, range) {
478
+ var selected = session.doc.getTextRange(range);
479
+ if (!range.isMultiLine() && selected == '(') {
480
+ var line = session.doc.getLine(range.start.row);
481
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
482
+ if (rightChar == ')') {
483
+ range.end.column++;
484
+ return range;
485
+ }
486
+ }
487
+ });
488
+
489
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
490
+ if (text == '"') {
491
+ var selection = editor.getSelectionRange();
492
+ var selected = session.doc.getTextRange(selection);
493
+ if (selected !== "") {
494
+ return {
495
+ text: '"' + selected + '"',
496
+ selection: false
497
+ }
498
+ } else {
499
+ var cursor = editor.getCursorPosition();
500
+ var line = session.doc.getLine(cursor.row);
501
+ var leftChar = line.substring(cursor.column-1, cursor.column);
502
+
503
+ // We're escaped.
504
+ if (leftChar == '\\') {
505
+ return null;
506
+ }
507
+
508
+ // Find what token we're inside.
509
+ var tokens = session.getTokens(selection.start.row, selection.start.row)[0].tokens;
510
+ var col = 0, token;
511
+ var quotepos = -1; // Track whether we're inside an open quote.
512
+
513
+ for (var x = 0; x < tokens.length; x++) {
514
+ token = tokens[x];
515
+ if (token.type == "string") {
516
+ quotepos = -1;
517
+ } else if (quotepos < 0) {
518
+ quotepos = token.value.indexOf('"');
519
+ }
520
+ if ((token.value.length + col) > selection.start.column) {
521
+ break;
522
+ }
523
+ col += tokens[x].value.length;
524
+ }
525
+
526
+ // Try and be smart about when we auto insert.
527
+ 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)))) {
528
+ return {
529
+ text: '""',
530
+ selection: [1,1]
531
+ }
532
+ } else if (token && token.type === "string") {
533
+ // Ignore input and move right one if we're typing over the closing quote.
534
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
535
+ if (rightChar == '"') {
536
+ return {
537
+ text: '',
538
+ selection: [1, 1]
539
+ }
540
+ }
541
+ }
542
+ }
543
+ }
544
+ });
545
+
546
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
547
+ var selected = session.doc.getTextRange(range);
548
+ if (!range.isMultiLine() && selected == '"') {
549
+ var line = session.doc.getLine(range.start.row);
550
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
551
+ if (rightChar == '"') {
552
+ range.end.column++;
553
+ return range;
554
+ }
555
+ }
556
+ });
557
+
558
+ }
559
+ oop.inherits(CstyleBehaviour, Behaviour);
560
+
561
+ exports.CstyleBehaviour = CstyleBehaviour;
562
+ });/* ***** BEGIN LICENSE BLOCK *****
563
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
564
+ *
565
+ * The contents of this file are subject to the Mozilla Public License Version
566
+ * 1.1 (the "License"); you may not use this file except in compliance with
567
+ * the License. You may obtain a copy of the License at
568
+ * http://www.mozilla.org/MPL/
569
+ *
570
+ * Software distributed under the License is distributed on an "AS IS" basis,
571
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
572
+ * for the specific language governing rights and limitations under the
573
+ * License.
574
+ *
575
+ * The Original Code is Ajax.org Code Editor (ACE).
576
+ *
577
+ * The Initial Developer of the Original Code is
578
+ * Ajax.org B.V.
579
+ * Portions created by the Initial Developer are Copyright (C) 2010
580
+ * the Initial Developer. All Rights Reserved.
581
+ *
582
+ * Contributor(s):
583
+ * Fabian Jakobs <fabian AT ajax DOT org>
584
+ *
585
+ * Alternatively, the contents of this file may be used under the terms of
586
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
587
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
588
+ * in which case the provisions of the GPL or the LGPL are applicable instead
589
+ * of those above. If you wish to allow use of your version of this file only
590
+ * under the terms of either the GPL or the LGPL, and not to allow others to
591
+ * use your version of this file under the terms of the MPL, indicate your
592
+ * decision by deleting the provisions above and replace them with the notice
593
+ * and other provisions required by the GPL or the LGPL. If you do not delete
594
+ * the provisions above, a recipient may use your version of this file under
595
+ * the terms of any one of the MPL, the GPL or the LGPL.
596
+ *
597
+ * ***** END LICENSE BLOCK ***** */
598
+
599
+ define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
600
+ "use strict";
601
+
602
+ var oop = require("../../lib/oop");
603
+ var Range = require("../../range").Range;
604
+ var BaseFoldMode = require("./fold_mode").FoldMode;
605
+
606
+ var FoldMode = exports.FoldMode = function() {};
607
+ oop.inherits(FoldMode, BaseFoldMode);
608
+
609
+ (function() {
610
+
611
+ this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
612
+ this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
613
+
614
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
615
+ var line = session.getLine(row);
616
+ var match = line.match(this.foldingStartMarker);
617
+ if (match) {
618
+ var i = match.index;
619
+
620
+ if (match[1])
621
+ return this.openingBracketBlock(session, match[1], row, i);
622
+
623
+ var range = session.getCommentFoldRange(row, i + match[0].length);
624
+ range.end.column -= 2;
625
+ return range;
626
+ }
627
+
628
+ if (foldStyle !== "markbeginend")
629
+ return;
630
+
631
+ var match = line.match(this.foldingStopMarker);
632
+ if (match) {
633
+ var i = match.index + match[0].length;
634
+
635
+ if (match[2]) {
636
+ var range = session.getCommentFoldRange(row, i);
637
+ range.end.column -= 2;
638
+ return range;
639
+ }
640
+
641
+ var end = {row: row, column: i};
642
+ var start = session.$findOpeningBracket(match[1], end);
643
+
644
+ if (!start)
645
+ return;
646
+
647
+ start.column++;
648
+ end.column--;
649
+
650
+ return Range.fromPoints(start, end);
651
+ }
652
+ };
653
+
654
+ }).call(FoldMode.prototype);
655
+
656
+ });/* ***** BEGIN LICENSE BLOCK *****
657
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
658
+ *
659
+ * The contents of this file are subject to the Mozilla Public License Version
660
+ * 1.1 (the "License"); you may not use this file except in compliance with
661
+ * the License. You may obtain a copy of the License at
662
+ * http://www.mozilla.org/MPL/
663
+ *
664
+ * Software distributed under the License is distributed on an "AS IS" basis,
665
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
666
+ * for the specific language governing rights and limitations under the
667
+ * License.
668
+ *
669
+ * The Original Code is Ajax.org Code Editor (ACE).
670
+ *
671
+ * The Initial Developer of the Original Code is
672
+ * Ajax.org B.V.
673
+ * Portions created by the Initial Developer are Copyright (C) 2010
674
+ * the Initial Developer. All Rights Reserved.
675
+ *
676
+ * Contributor(s):
677
+ * Fabian Jakobs <fabian AT ajax DOT org>
678
+ *
679
+ * Alternatively, the contents of this file may be used under the terms of
680
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
681
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
682
+ * in which case the provisions of the GPL or the LGPL are applicable instead
683
+ * of those above. If you wish to allow use of your version of this file only
684
+ * under the terms of either the GPL or the LGPL, and not to allow others to
685
+ * use your version of this file under the terms of the MPL, indicate your
686
+ * decision by deleting the provisions above and replace them with the notice
687
+ * and other provisions required by the GPL or the LGPL. If you do not delete
688
+ * the provisions above, a recipient may use your version of this file under
689
+ * the terms of any one of the MPL, the GPL or the LGPL.
690
+ *
691
+ * ***** END LICENSE BLOCK ***** */
692
+
693
+ define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
694
+ "use strict";
695
+
696
+ var Range = require("../../range").Range;
697
+
698
+ var FoldMode = exports.FoldMode = function() {};
699
+
700
+ (function() {
701
+
702
+ this.foldingStartMarker = null;
703
+ this.foldingStopMarker = null;
704
+
705
+ // must return "" if there's no fold, to enable caching
706
+ this.getFoldWidget = function(session, foldStyle, row) {
707
+ var line = session.getLine(row);
708
+ if (this.foldingStartMarker.test(line))
709
+ return "start";
710
+ if (foldStyle == "markbeginend"
711
+ && this.foldingStopMarker
712
+ && this.foldingStopMarker.test(line))
713
+ return "end";
714
+ return "";
715
+ };
716
+
717
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
718
+ return null;
719
+ };
720
+
721
+ this.indentationBlock = function(session, row, column) {
722
+ var re = /^\s*/;
723
+ var startRow = row;
724
+ var endRow = row;
725
+ var line = session.getLine(row);
726
+ var startColumn = column || line.length;
727
+ var startLevel = line.match(re)[0].length;
728
+ var maxRow = session.getLength()
729
+
730
+ while (++row < maxRow) {
731
+ line = session.getLine(row);
732
+ var level = line.match(re)[0].length;
733
+
734
+ if (level == line.length)
735
+ continue;
736
+
737
+ if (level <= startLevel)
738
+ break;
739
+
740
+ endRow = row;
741
+ }
742
+
743
+ if (endRow > startRow) {
744
+ var endColumn = session.getLine(endRow).length;
745
+ return new Range(startRow, startColumn, endRow, endColumn);
746
+ }
747
+ };
748
+
749
+ this.openingBracketBlock = function(session, bracket, row, column) {
750
+ var start = {row: row, column: column + 1};
751
+ var end = session.$findClosingBracket(bracket, start);
752
+ if (!end)
753
+ return;
754
+
755
+ var fw = session.foldWidgets[end.row];
756
+ if (fw == null)
757
+ fw = this.getFoldWidget(session, end.row);
758
+
759
+ if (fw == "start") {
760
+ end.row --;
761
+ end.column = session.getLine(end.row).length;
762
+ }
763
+ return Range.fromPoints(start, end);
764
+ };
765
+
766
+ }).call(FoldMode.prototype);
767
+
768
+ });