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,706 @@
1
+ define('ace/mode/powershell', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/powershell_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 PowershellHighlightRules = require("./powershell_highlight_rules").PowershellHighlightRules;
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 PowershellHighlightRules().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/powershell_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', '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 TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
65
+
66
+ var PowershellHighlightRules = function() {
67
+
68
+ var keywords = lang.arrayToMap(
69
+ ("function|if|else|elseif|switch|while|default|for|do|until|break|continue|" +
70
+ "foreach|return|filter|in|trap|throw|param|begin|process|end").split("|")
71
+ );
72
+
73
+ var builtinFunctions = lang.arrayToMap(
74
+ ("Get-Alias|Import-Alias|New-Alias|Set-Alias|Get-AuthenticodeSignature|Set-AuthenticodeSignature|" +
75
+ "Set-Location|Get-ChildItem|Clear-Item|Get-Command|Measure-Command|Trace-Command|" +
76
+ "Add-Computer|Checkpoint-Computer|Remove-Computer|Restart-Computer|Restore-Computer|Stop-Computer|" +
77
+ "Reset-ComputerMachinePassword|Test-ComputerSecureChannel|Add-Content|Get-Content|Set-Content|Clear-Content|" +
78
+ "Get-Command|Invoke-Command|Enable-ComputerRestore|Disable-ComputerRestore|Get-ComputerRestorePoint|Test-Connection|" +
79
+ "ConvertFrom-CSV|ConvertTo-CSV|ConvertTo-Html|ConvertTo-Xml|ConvertFrom-SecureString|ConvertTo-SecureString|" +
80
+ "Copy-Item|Export-Counter|Get-Counter|Import-Counter|Get-Credential|Get-Culture|" +
81
+ "Get-ChildItem|Get-Date|Set-Date|Remove-Item|Compare-Object|Get-Event|" +
82
+ "Get-WinEvent|New-Event|Remove-Event|Unregister-Event|Wait-Event|Clear-EventLog|" +
83
+ "Get-Eventlog|Limit-EventLog|New-Eventlog|Remove-EventLog|Show-EventLog|Write-EventLog|" +
84
+ "Get-EventSubscriber|Register-EngineEvent|Register-ObjectEvent|Register-WmiEvent|Get-ExecutionPolicy|Set-ExecutionPolicy|" +
85
+ "Export-Alias|Export-Clixml|Export-Console|Export-Csv|ForEach-Object|Format-Custom|" +
86
+ "Format-List|Format-Table|Format-Wide|Export-FormatData|Get-FormatData|Get-Item|" +
87
+ "Get-ChildItem|Get-Help|Add-History|Clear-History|Get-History|Invoke-History|" +
88
+ "Get-Host|Read-Host|Write-Host|Get-HotFix|Import-Clixml|Import-Csv|" +
89
+ "Invoke-Command|Invoke-Expression|Get-Item|Invoke-Item|New-Item|Remove-Item|" +
90
+ "Set-Item|Clear-ItemProperty|Copy-ItemProperty|Get-ItemProperty|Move-ItemProperty|New-ItemProperty|" +
91
+ "Remove-ItemProperty|Rename-ItemProperty|Set-ItemProperty|Get-Job|Receive-Job|Remove-Job|" +
92
+ "Start-Job|Stop-Job|Wait-Job|Stop-Process|Update-List|Get-Location|" +
93
+ "Pop-Location|Push-Location|Set-Location|Send-MailMessage|Add-Member|Get-Member|" +
94
+ "Move-Item|Compare-Object|Group-Object|Measure-Object|New-Object|Select-Object|" +
95
+ "Sort-Object|Where-Object|Out-Default|Out-File|Out-GridView|Out-Host|" +
96
+ "Out-Null|Out-Printer|Out-String|Convert-Path|Join-Path|Resolve-Path|" +
97
+ "Split-Path|Test-Path|Get-Pfxcertificate|Pop-Location|Push-Location|Get-Process|" +
98
+ "Start-Process|Stop-Process|Wait-Process|Enable-PSBreakpoint|Disable-PSBreakpoint|Get-PSBreakpoint|" +
99
+ "Set-PSBreakpoint|Remove-PSBreakpoint|Get-PSDrive|New-PSDrive|Remove-PSDrive|Get-PSProvider|" +
100
+ "Set-PSdebug|Enter-PSSession|Exit-PSSession|Export-PSSession|Get-PSSession|Import-PSSession|" +
101
+ "New-PSSession|Remove-PSSession|Disable-PSSessionConfiguration|Enable-PSSessionConfiguration|Get-PSSessionConfiguration|Register-PSSessionConfiguration|" +
102
+ "Set-PSSessionConfiguration|Unregister-PSSessionConfiguration|New-PSSessionOption|Add-PsSnapIn|Get-PsSnapin|Remove-PSSnapin|" +
103
+ "Get-Random|Read-Host|Remove-Item|Rename-Item|Rename-ItemProperty|Select-Object|" +
104
+ "Select-XML|Send-MailMessage|Get-Service|New-Service|Restart-Service|Resume-Service|" +
105
+ "Set-Service|Start-Service|Stop-Service|Suspend-Service|Sort-Object|Start-Sleep|" +
106
+ "ConvertFrom-StringData|Select-String|Tee-Object|New-Timespan|Trace-Command|Get-Tracesource|" +
107
+ "Set-Tracesource|Start-Transaction|Complete-Transaction|Get-Transaction|Use-Transaction|Undo-Transaction|" +
108
+ "Start-Transcript|Stop-Transcript|Add-Type|Update-TypeData|Get-Uiculture|Get-Unique|" +
109
+ "Update-Formatdata|Update-Typedata|Clear-Variable|Get-Variable|New-Variable|Remove-Variable|" +
110
+ "Set-Variable|New-WebServiceProxy|Where-Object|Write-Debug|Write-Error|Write-Host|" +
111
+ "Write-Output|Write-Progress|Write-Verbose|Write-Warning|Set-WmiInstance|Invoke-WmiMethod|" +
112
+ "Get-WmiObject|Remove-WmiObject|Connect-WSMan|Disconnect-WSMan|Test-WSMan|Invoke-WSManAction|" +
113
+ "Disable-WSManCredSSP|Enable-WSManCredSSP|Get-WSManCredSSP|New-WSManInstance|Get-WSManInstance|Set-WSManInstance|" +
114
+ "Remove-WSManInstance|Set-WSManQuickConfig|New-WSManSessionOption").split("|"));
115
+
116
+ var binaryOperatorsRe = "eq|ne|ge|gt|lt|le|like|notlike|match|notmatch|replace|contains|notcontains|" +
117
+ "ieq|ine|ige|igt|ile|ilt|ilike|inotlike|imatch|inotmatch|ireplace|icontains|inotcontains|" +
118
+ "is|isnot|as|" +
119
+ "and|or|band|bor|not";
120
+
121
+ // regexp must not have capturing parentheses. Use (?:) instead.
122
+ // regexps are ordered -> the first match is used
123
+
124
+ this.$rules = {
125
+ "start" : [
126
+ {
127
+ token : "comment",
128
+ regex : "#.*$"
129
+ }, {
130
+ token : "string", // single line
131
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
132
+ }, {
133
+ token : "string", // single line
134
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
135
+ }, {
136
+ token : "constant.numeric", // hex
137
+ regex : "0[xX][0-9a-fA-F]+\\b"
138
+ }, {
139
+ token : "constant.numeric", // float
140
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
141
+ }, {
142
+ token : "constant.language.boolean",
143
+ regex : "[$](?:[Tt]rue|[Ff]alse)\\b"
144
+ }, {
145
+ token : "constant.language",
146
+ regex : "[$][Nn]ull\\b"
147
+ }, {
148
+ token : "variable.instance",
149
+ regex : "[$][a-zA-Z][a-zA-Z0-9_]*\\b"
150
+ }, {
151
+ token : function(value) {
152
+ if (keywords.hasOwnProperty(value))
153
+ return "keyword";
154
+ else if (builtinFunctions.hasOwnProperty(value))
155
+ return "support.function";
156
+ else
157
+ return "identifier";
158
+ },
159
+ // TODO: Unicode escape sequences
160
+ // TODO: Unicode identifiers
161
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$\\-]*\\b"
162
+ }, {
163
+ token : "keyword.operator",
164
+ regex : "\\-(?:" + binaryOperatorsRe + ")"
165
+ }, {
166
+ token : "keyword.operator",
167
+ regex : "&|\\*|\\+|\\-|\\=|\\+=|\\-="
168
+ }, {
169
+ token : "lparen",
170
+ regex : "[[({]"
171
+ }, {
172
+ token : "rparen",
173
+ regex : "[\\])}]"
174
+ }, {
175
+ token : "text",
176
+ regex : "\\s+"
177
+ }
178
+ ],
179
+ "comment" : [
180
+ {
181
+ token : "comment", // closing comment
182
+ regex : ".*?\\*\\/",
183
+ next : "start"
184
+ }, {
185
+ token : "comment", // comment spanning whole line
186
+ merge : true,
187
+ regex : ".+"
188
+ }
189
+ ]
190
+ };
191
+ };
192
+
193
+ oop.inherits(PowershellHighlightRules, TextHighlightRules);
194
+
195
+ exports.PowershellHighlightRules = PowershellHighlightRules;
196
+ });
197
+ /* ***** BEGIN LICENSE BLOCK *****
198
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
199
+ *
200
+ * The contents of this file are subject to the Mozilla Public License Version
201
+ * 1.1 (the "License"); you may not use this file except in compliance with
202
+ * the License. You may obtain a copy of the License at
203
+ * http://www.mozilla.org/MPL/
204
+ *
205
+ * Software distributed under the License is distributed on an "AS IS" basis,
206
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
207
+ * for the specific language governing rights and limitations under the
208
+ * License.
209
+ *
210
+ * The Original Code is Ajax.org Code Editor (ACE).
211
+ *
212
+ * The Initial Developer of the Original Code is
213
+ * Ajax.org B.V.
214
+ * Portions created by the Initial Developer are Copyright (C) 2010
215
+ * the Initial Developer. All Rights Reserved.
216
+ *
217
+ * Contributor(s):
218
+ * Fabian Jakobs <fabian AT ajax DOT org>
219
+ *
220
+ * Alternatively, the contents of this file may be used under the terms of
221
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
222
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
223
+ * in which case the provisions of the GPL or the LGPL are applicable instead
224
+ * of those above. If you wish to allow use of your version of this file only
225
+ * under the terms of either the GPL or the LGPL, and not to allow others to
226
+ * use your version of this file under the terms of the MPL, indicate your
227
+ * decision by deleting the provisions above and replace them with the notice
228
+ * and other provisions required by the GPL or the LGPL. If you do not delete
229
+ * the provisions above, a recipient may use your version of this file under
230
+ * the terms of any one of the MPL, the GPL or the LGPL.
231
+ *
232
+ * ***** END LICENSE BLOCK ***** */
233
+
234
+ define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
235
+ "use strict";
236
+
237
+ var Range = require("../range").Range;
238
+
239
+ var MatchingBraceOutdent = function() {};
240
+
241
+ (function() {
242
+
243
+ this.checkOutdent = function(line, input) {
244
+ if (! /^\s+$/.test(line))
245
+ return false;
246
+
247
+ return /^\s*\}/.test(input);
248
+ };
249
+
250
+ this.autoOutdent = function(doc, row) {
251
+ var line = doc.getLine(row);
252
+ var match = line.match(/^(\s*\})/);
253
+
254
+ if (!match) return 0;
255
+
256
+ var column = match[1].length;
257
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
258
+
259
+ if (!openBracePos || openBracePos.row == row) return 0;
260
+
261
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
262
+ doc.replace(new Range(row, 0, row, column-1), indent);
263
+ };
264
+
265
+ this.$getIndent = function(line) {
266
+ var match = line.match(/^(\s+)/);
267
+ if (match) {
268
+ return match[1];
269
+ }
270
+
271
+ return "";
272
+ };
273
+
274
+ }).call(MatchingBraceOutdent.prototype);
275
+
276
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
277
+ });
278
+ /* vim:ts=4:sts=4:sw=4:
279
+ * ***** BEGIN LICENSE BLOCK *****
280
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
281
+ *
282
+ * The contents of this file are subject to the Mozilla Public License Version
283
+ * 1.1 (the "License"); you may not use this file except in compliance with
284
+ * the License. You may obtain a copy of the License at
285
+ * http://www.mozilla.org/MPL/
286
+ *
287
+ * Software distributed under the License is distributed on an "AS IS" basis,
288
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
289
+ * for the specific language governing rights and limitations under the
290
+ * License.
291
+ *
292
+ * The Original Code is Ajax.org Code Editor (ACE).
293
+ *
294
+ * The Initial Developer of the Original Code is
295
+ * Ajax.org B.V.
296
+ * Portions created by the Initial Developer are Copyright (C) 2010
297
+ * the Initial Developer. All Rights Reserved.
298
+ *
299
+ * Contributor(s):
300
+ * Chris Spencer <chris.ag.spencer AT googlemail DOT com>
301
+ *
302
+ * Alternatively, the contents of this file may be used under the terms of
303
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
304
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
305
+ * in which case the provisions of the GPL or the LGPL are applicable instead
306
+ * of those above. If you wish to allow use of your version of this file only
307
+ * under the terms of either the GPL or the LGPL, and not to allow others to
308
+ * use your version of this file under the terms of the MPL, indicate your
309
+ * decision by deleting the provisions above and replace them with the notice
310
+ * and other provisions required by the GPL or the LGPL. If you do not delete
311
+ * the provisions above, a recipient may use your version of this file under
312
+ * the terms of any one of the MPL, the GPL or the LGPL.
313
+ *
314
+ * ***** END LICENSE BLOCK ***** */
315
+
316
+ define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
317
+ "use strict";
318
+
319
+ var oop = require("../../lib/oop");
320
+ var Behaviour = require('../behaviour').Behaviour;
321
+
322
+ var CstyleBehaviour = function () {
323
+
324
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
325
+ if (text == '{') {
326
+ var selection = editor.getSelectionRange();
327
+ var selected = session.doc.getTextRange(selection);
328
+ if (selected !== "") {
329
+ return {
330
+ text: '{' + selected + '}',
331
+ selection: false
332
+ }
333
+ } else {
334
+ return {
335
+ text: '{}',
336
+ selection: [1, 1]
337
+ }
338
+ }
339
+ } else if (text == '}') {
340
+ var cursor = editor.getCursorPosition();
341
+ var line = session.doc.getLine(cursor.row);
342
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
343
+ if (rightChar == '}') {
344
+ var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
345
+ if (matching !== null) {
346
+ return {
347
+ text: '',
348
+ selection: [1, 1]
349
+ }
350
+ }
351
+ }
352
+ } else if (text == "\n") {
353
+ var cursor = editor.getCursorPosition();
354
+ var line = session.doc.getLine(cursor.row);
355
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
356
+ if (rightChar == '}') {
357
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
358
+ if (!openBracePos)
359
+ return null;
360
+
361
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
362
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
363
+
364
+ return {
365
+ text: '\n' + indent + '\n' + next_indent,
366
+ selection: [1, indent.length, 1, indent.length]
367
+ }
368
+ }
369
+ }
370
+ });
371
+
372
+ this.add("braces", "deletion", function (state, action, editor, session, range) {
373
+ var selected = session.doc.getTextRange(range);
374
+ if (!range.isMultiLine() && selected == '{') {
375
+ var line = session.doc.getLine(range.start.row);
376
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
377
+ if (rightChar == '}') {
378
+ range.end.column++;
379
+ return range;
380
+ }
381
+ }
382
+ });
383
+
384
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
385
+ if (text == '(') {
386
+ var selection = editor.getSelectionRange();
387
+ var selected = session.doc.getTextRange(selection);
388
+ if (selected !== "") {
389
+ return {
390
+ text: '(' + selected + ')',
391
+ selection: false
392
+ }
393
+ } else {
394
+ return {
395
+ text: '()',
396
+ selection: [1, 1]
397
+ }
398
+ }
399
+ } else if (text == ')') {
400
+ var cursor = editor.getCursorPosition();
401
+ var line = session.doc.getLine(cursor.row);
402
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
403
+ if (rightChar == ')') {
404
+ var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
405
+ if (matching !== null) {
406
+ return {
407
+ text: '',
408
+ selection: [1, 1]
409
+ }
410
+ }
411
+ }
412
+ }
413
+ });
414
+
415
+ this.add("parens", "deletion", function (state, action, editor, session, range) {
416
+ var selected = session.doc.getTextRange(range);
417
+ if (!range.isMultiLine() && selected == '(') {
418
+ var line = session.doc.getLine(range.start.row);
419
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
420
+ if (rightChar == ')') {
421
+ range.end.column++;
422
+ return range;
423
+ }
424
+ }
425
+ });
426
+
427
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
428
+ if (text == '"') {
429
+ var selection = editor.getSelectionRange();
430
+ var selected = session.doc.getTextRange(selection);
431
+ if (selected !== "") {
432
+ return {
433
+ text: '"' + selected + '"',
434
+ selection: false
435
+ }
436
+ } else {
437
+ var cursor = editor.getCursorPosition();
438
+ var line = session.doc.getLine(cursor.row);
439
+ var leftChar = line.substring(cursor.column-1, cursor.column);
440
+
441
+ // We're escaped.
442
+ if (leftChar == '\\') {
443
+ return null;
444
+ }
445
+
446
+ // Find what token we're inside.
447
+ var tokens = session.getTokens(selection.start.row, selection.start.row)[0].tokens;
448
+ var col = 0, token;
449
+ var quotepos = -1; // Track whether we're inside an open quote.
450
+
451
+ for (var x = 0; x < tokens.length; x++) {
452
+ token = tokens[x];
453
+ if (token.type == "string") {
454
+ quotepos = -1;
455
+ } else if (quotepos < 0) {
456
+ quotepos = token.value.indexOf('"');
457
+ }
458
+ if ((token.value.length + col) > selection.start.column) {
459
+ break;
460
+ }
461
+ col += tokens[x].value.length;
462
+ }
463
+
464
+ // Try and be smart about when we auto insert.
465
+ 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)))) {
466
+ return {
467
+ text: '""',
468
+ selection: [1,1]
469
+ }
470
+ } else if (token && token.type === "string") {
471
+ // Ignore input and move right one if we're typing over the closing quote.
472
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
473
+ if (rightChar == '"') {
474
+ return {
475
+ text: '',
476
+ selection: [1, 1]
477
+ }
478
+ }
479
+ }
480
+ }
481
+ }
482
+ });
483
+
484
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
485
+ var selected = session.doc.getTextRange(range);
486
+ if (!range.isMultiLine() && selected == '"') {
487
+ var line = session.doc.getLine(range.start.row);
488
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
489
+ if (rightChar == '"') {
490
+ range.end.column++;
491
+ return range;
492
+ }
493
+ }
494
+ });
495
+
496
+ }
497
+ oop.inherits(CstyleBehaviour, Behaviour);
498
+
499
+ exports.CstyleBehaviour = CstyleBehaviour;
500
+ });/* ***** BEGIN LICENSE BLOCK *****
501
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
502
+ *
503
+ * The contents of this file are subject to the Mozilla Public License Version
504
+ * 1.1 (the "License"); you may not use this file except in compliance with
505
+ * the License. You may obtain a copy of the License at
506
+ * http://www.mozilla.org/MPL/
507
+ *
508
+ * Software distributed under the License is distributed on an "AS IS" basis,
509
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
510
+ * for the specific language governing rights and limitations under the
511
+ * License.
512
+ *
513
+ * The Original Code is Ajax.org Code Editor (ACE).
514
+ *
515
+ * The Initial Developer of the Original Code is
516
+ * Ajax.org B.V.
517
+ * Portions created by the Initial Developer are Copyright (C) 2010
518
+ * the Initial Developer. All Rights Reserved.
519
+ *
520
+ * Contributor(s):
521
+ * Fabian Jakobs <fabian AT ajax DOT org>
522
+ *
523
+ * Alternatively, the contents of this file may be used under the terms of
524
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
525
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
526
+ * in which case the provisions of the GPL or the LGPL are applicable instead
527
+ * of those above. If you wish to allow use of your version of this file only
528
+ * under the terms of either the GPL or the LGPL, and not to allow others to
529
+ * use your version of this file under the terms of the MPL, indicate your
530
+ * decision by deleting the provisions above and replace them with the notice
531
+ * and other provisions required by the GPL or the LGPL. If you do not delete
532
+ * the provisions above, a recipient may use your version of this file under
533
+ * the terms of any one of the MPL, the GPL or the LGPL.
534
+ *
535
+ * ***** END LICENSE BLOCK ***** */
536
+
537
+ define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
538
+ "use strict";
539
+
540
+ var oop = require("../../lib/oop");
541
+ var Range = require("../../range").Range;
542
+ var BaseFoldMode = require("./fold_mode").FoldMode;
543
+
544
+ var FoldMode = exports.FoldMode = function() {};
545
+ oop.inherits(FoldMode, BaseFoldMode);
546
+
547
+ (function() {
548
+
549
+ this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
550
+ this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
551
+
552
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
553
+ var line = session.getLine(row);
554
+ var match = line.match(this.foldingStartMarker);
555
+ if (match) {
556
+ var i = match.index;
557
+
558
+ if (match[1])
559
+ return this.openingBracketBlock(session, match[1], row, i);
560
+
561
+ var range = session.getCommentFoldRange(row, i + match[0].length);
562
+ range.end.column -= 2;
563
+ return range;
564
+ }
565
+
566
+ if (foldStyle !== "markbeginend")
567
+ return;
568
+
569
+ var match = line.match(this.foldingStopMarker);
570
+ if (match) {
571
+ var i = match.index + match[0].length;
572
+
573
+ if (match[2]) {
574
+ var range = session.getCommentFoldRange(row, i);
575
+ range.end.column -= 2;
576
+ return range;
577
+ }
578
+
579
+ var end = {row: row, column: i};
580
+ var start = session.$findOpeningBracket(match[1], end);
581
+
582
+ if (!start)
583
+ return;
584
+
585
+ start.column++;
586
+ end.column--;
587
+
588
+ return Range.fromPoints(start, end);
589
+ }
590
+ };
591
+
592
+ }).call(FoldMode.prototype);
593
+
594
+ });/* ***** BEGIN LICENSE BLOCK *****
595
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
596
+ *
597
+ * The contents of this file are subject to the Mozilla Public License Version
598
+ * 1.1 (the "License"); you may not use this file except in compliance with
599
+ * the License. You may obtain a copy of the License at
600
+ * http://www.mozilla.org/MPL/
601
+ *
602
+ * Software distributed under the License is distributed on an "AS IS" basis,
603
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
604
+ * for the specific language governing rights and limitations under the
605
+ * License.
606
+ *
607
+ * The Original Code is Ajax.org Code Editor (ACE).
608
+ *
609
+ * The Initial Developer of the Original Code is
610
+ * Ajax.org B.V.
611
+ * Portions created by the Initial Developer are Copyright (C) 2010
612
+ * the Initial Developer. All Rights Reserved.
613
+ *
614
+ * Contributor(s):
615
+ * Fabian Jakobs <fabian AT ajax DOT org>
616
+ *
617
+ * Alternatively, the contents of this file may be used under the terms of
618
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
619
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
620
+ * in which case the provisions of the GPL or the LGPL are applicable instead
621
+ * of those above. If you wish to allow use of your version of this file only
622
+ * under the terms of either the GPL or the LGPL, and not to allow others to
623
+ * use your version of this file under the terms of the MPL, indicate your
624
+ * decision by deleting the provisions above and replace them with the notice
625
+ * and other provisions required by the GPL or the LGPL. If you do not delete
626
+ * the provisions above, a recipient may use your version of this file under
627
+ * the terms of any one of the MPL, the GPL or the LGPL.
628
+ *
629
+ * ***** END LICENSE BLOCK ***** */
630
+
631
+ define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
632
+ "use strict";
633
+
634
+ var Range = require("../../range").Range;
635
+
636
+ var FoldMode = exports.FoldMode = function() {};
637
+
638
+ (function() {
639
+
640
+ this.foldingStartMarker = null;
641
+ this.foldingStopMarker = null;
642
+
643
+ // must return "" if there's no fold, to enable caching
644
+ this.getFoldWidget = function(session, foldStyle, row) {
645
+ var line = session.getLine(row);
646
+ if (this.foldingStartMarker.test(line))
647
+ return "start";
648
+ if (foldStyle == "markbeginend"
649
+ && this.foldingStopMarker
650
+ && this.foldingStopMarker.test(line))
651
+ return "end";
652
+ return "";
653
+ };
654
+
655
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
656
+ return null;
657
+ };
658
+
659
+ this.indentationBlock = function(session, row, column) {
660
+ var re = /^\s*/;
661
+ var startRow = row;
662
+ var endRow = row;
663
+ var line = session.getLine(row);
664
+ var startColumn = column || line.length;
665
+ var startLevel = line.match(re)[0].length;
666
+ var maxRow = session.getLength()
667
+
668
+ while (++row < maxRow) {
669
+ line = session.getLine(row);
670
+ var level = line.match(re)[0].length;
671
+
672
+ if (level == line.length)
673
+ continue;
674
+
675
+ if (level <= startLevel)
676
+ break;
677
+
678
+ endRow = row;
679
+ }
680
+
681
+ if (endRow > startRow) {
682
+ var endColumn = session.getLine(endRow).length;
683
+ return new Range(startRow, startColumn, endRow, endColumn);
684
+ }
685
+ };
686
+
687
+ this.openingBracketBlock = function(session, bracket, row, column) {
688
+ var start = {row: row, column: column + 1};
689
+ var end = session.$findClosingBracket(bracket, start);
690
+ if (!end)
691
+ return;
692
+
693
+ var fw = session.foldWidgets[end.row];
694
+ if (fw == null)
695
+ fw = this.getFoldWidget(session, end.row);
696
+
697
+ if (fw == "start") {
698
+ end.row --;
699
+ end.column = session.getLine(end.row).length;
700
+ }
701
+ return Range.fromPoints(start, end);
702
+ };
703
+
704
+ }).call(FoldMode.prototype);
705
+
706
+ });