ace-rails-ap 0.0.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. data/lib/ace/rails/version.rb +1 -1
  2. data/vendor/assets/javascripts/ace.js +15680 -1
  3. data/vendor/assets/javascripts/keybinding-emacs.js +367 -1
  4. data/vendor/assets/javascripts/keybinding-vim.js +1635 -1
  5. data/vendor/assets/javascripts/mode-c9search.js +275 -0
  6. data/vendor/assets/javascripts/mode-c_cpp.js +744 -1
  7. data/vendor/assets/javascripts/mode-clojure.js +364 -1
  8. data/vendor/assets/javascripts/mode-coffee.js +527 -1
  9. data/vendor/assets/javascripts/mode-coldfusion.js +1966 -1
  10. data/vendor/assets/javascripts/mode-csharp.js +633 -1
  11. data/vendor/assets/javascripts/mode-css.js +499 -1
  12. data/vendor/assets/javascripts/mode-diff.js +250 -0
  13. data/vendor/assets/javascripts/{mode-c_cpp-uncompressed.js → mode-glsl.js} +147 -244
  14. data/vendor/assets/javascripts/mode-golang.js +681 -1
  15. data/vendor/assets/javascripts/mode-groovy.js +1240 -1
  16. data/vendor/assets/javascripts/mode-haxe.js +633 -1
  17. data/vendor/assets/javascripts/mode-html.js +2064 -1
  18. data/vendor/assets/javascripts/mode-java.js +1202 -1
  19. data/vendor/assets/javascripts/mode-javascript.js +1069 -1
  20. data/vendor/assets/javascripts/mode-json.js +588 -1
  21. data/vendor/assets/javascripts/{mode-haxe-uncompressed.js → mode-jsx.js} +189 -312
  22. data/vendor/assets/javascripts/mode-latex.js +95 -1
  23. data/vendor/assets/javascripts/mode-less.js +512 -1
  24. data/vendor/assets/javascripts/mode-liquid.js +1125 -1
  25. data/vendor/assets/javascripts/mode-lua.js +551 -1
  26. data/vendor/assets/javascripts/{mode-html-uncompressed.js → mode-luahtml.js} +544 -604
  27. data/vendor/assets/javascripts/{mode-coldfusion-uncompressed.js → mode-luapage.js} +2326 -2180
  28. data/vendor/assets/javascripts/mode-markdown.js +2369 -1
  29. data/vendor/assets/javascripts/mode-ocaml.js +464 -1
  30. data/vendor/assets/javascripts/mode-perl.js +432 -1
  31. data/vendor/assets/javascripts/mode-pgsql.js +970 -1
  32. data/vendor/assets/javascripts/mode-php.js +1718 -1
  33. data/vendor/assets/javascripts/mode-powershell.js +610 -1
  34. data/vendor/assets/javascripts/mode-python.js +397 -1
  35. data/vendor/assets/javascripts/mode-ruby.js +318 -1
  36. data/vendor/assets/javascripts/mode-scad.js +732 -1
  37. data/vendor/assets/javascripts/mode-scala.js +1237 -1
  38. data/vendor/assets/javascripts/mode-scss.js +537 -1
  39. data/vendor/assets/javascripts/mode-sh.js +250 -1
  40. data/vendor/assets/javascripts/mode-sql.js +140 -1
  41. data/vendor/assets/javascripts/mode-svg.js +1681 -1
  42. data/vendor/assets/javascripts/mode-tcl.js +320 -0
  43. data/vendor/assets/javascripts/mode-textile.js +182 -1
  44. data/vendor/assets/javascripts/mode-xml.js +829 -1
  45. data/vendor/assets/javascripts/mode-xquery.js +605 -1
  46. data/vendor/assets/javascripts/mode-yaml.js +189 -0
  47. data/vendor/assets/javascripts/theme-chrome.js +213 -1
  48. data/vendor/assets/javascripts/theme-clouds.js +167 -1
  49. data/vendor/assets/javascripts/theme-clouds_midnight.js +168 -1
  50. data/vendor/assets/javascripts/theme-cobalt.js +194 -1
  51. data/vendor/assets/javascripts/theme-crimson_editor.js +200 -1
  52. data/vendor/assets/javascripts/theme-dawn.js +198 -1
  53. data/vendor/assets/javascripts/theme-dreamweaver.js +230 -1
  54. data/vendor/assets/javascripts/theme-eclipse.js +157 -1
  55. data/vendor/assets/javascripts/theme-github.js +182 -0
  56. data/vendor/assets/javascripts/theme-idle_fingers.js +186 -1
  57. data/vendor/assets/javascripts/theme-kr_theme.js +189 -1
  58. data/vendor/assets/javascripts/theme-merbivore.js +189 -1
  59. data/vendor/assets/javascripts/theme-merbivore_soft.js +195 -1
  60. data/vendor/assets/javascripts/theme-mono_industrial.js +197 -1
  61. data/vendor/assets/javascripts/theme-monokai.js +194 -1
  62. data/vendor/assets/javascripts/theme-pastel_on_dark.js +199 -1
  63. data/vendor/assets/javascripts/theme-solarized_dark.js +180 -1
  64. data/vendor/assets/javascripts/theme-solarized_light.js +179 -1
  65. data/vendor/assets/javascripts/theme-textmate.js +216 -0
  66. data/vendor/assets/javascripts/theme-tomorrow.js +213 -1
  67. data/vendor/assets/javascripts/theme-tomorrow_night.js +213 -1
  68. data/vendor/assets/javascripts/theme-tomorrow_night_blue.js +213 -1
  69. data/vendor/assets/javascripts/theme-tomorrow_night_bright.js +213 -1
  70. data/vendor/assets/javascripts/theme-tomorrow_night_eighties.js +209 -1
  71. data/vendor/assets/javascripts/theme-twilight.js +211 -1
  72. data/vendor/assets/javascripts/theme-vibrant_ink.js +190 -1
  73. data/vendor/assets/javascripts/worker-coffee.js +83 -893
  74. data/vendor/assets/javascripts/worker-css.js +88 -1402
  75. data/vendor/assets/javascripts/worker-javascript.js +97 -812
  76. data/vendor/assets/javascripts/worker-json.js +84 -761
  77. data/vendor/assets/javascripts/worker-xquery.js +66464 -0
  78. metadata +12 -195
  79. data/vendor/assets/javascripts/ace-compat-noconflict.js +0 -1
  80. data/vendor/assets/javascripts/ace-compat-uncompressed-noconflict.js +0 -480
  81. data/vendor/assets/javascripts/ace-compat-uncompressed.js +0 -480
  82. data/vendor/assets/javascripts/ace-compat.js +0 -1
  83. data/vendor/assets/javascripts/ace-noconflict.js +0 -10
  84. data/vendor/assets/javascripts/ace-uncompressed-noconflict.js +0 -19976
  85. data/vendor/assets/javascripts/ace-uncompressed.js +0 -19976
  86. data/vendor/assets/javascripts/keybinding-emacs-noconflict.js +0 -1
  87. data/vendor/assets/javascripts/keybinding-emacs-uncompressed-noconflict.js +0 -150
  88. data/vendor/assets/javascripts/keybinding-emacs-uncompressed.js +0 -150
  89. data/vendor/assets/javascripts/keybinding-vim-noconflict.js +0 -1
  90. data/vendor/assets/javascripts/keybinding-vim-uncompressed-noconflict.js +0 -138
  91. data/vendor/assets/javascripts/keybinding-vim-uncompressed.js +0 -138
  92. data/vendor/assets/javascripts/mode-c_cpp-noconflict.js +0 -1
  93. data/vendor/assets/javascripts/mode-c_cpp-uncompressed-noconflict.js +0 -919
  94. data/vendor/assets/javascripts/mode-clojure-noconflict.js +0 -1
  95. data/vendor/assets/javascripts/mode-clojure-uncompressed-noconflict.js +0 -422
  96. data/vendor/assets/javascripts/mode-clojure-uncompressed.js +0 -422
  97. data/vendor/assets/javascripts/mode-coffee-noconflict.js +0 -1
  98. data/vendor/assets/javascripts/mode-coffee-uncompressed-noconflict.js +0 -607
  99. data/vendor/assets/javascripts/mode-coffee-uncompressed.js +0 -607
  100. data/vendor/assets/javascripts/mode-coldfusion-noconflict.js +0 -1
  101. data/vendor/assets/javascripts/mode-coldfusion-uncompressed-noconflict.js +0 -2458
  102. data/vendor/assets/javascripts/mode-csharp-noconflict.js +0 -1
  103. data/vendor/assets/javascripts/mode-csharp-uncompressed-noconflict.js +0 -769
  104. data/vendor/assets/javascripts/mode-csharp-uncompressed.js +0 -769
  105. data/vendor/assets/javascripts/mode-css-noconflict.js +0 -1
  106. data/vendor/assets/javascripts/mode-css-uncompressed-noconflict.js +0 -641
  107. data/vendor/assets/javascripts/mode-css-uncompressed.js +0 -641
  108. data/vendor/assets/javascripts/mode-golang-noconflict.js +0 -1
  109. data/vendor/assets/javascripts/mode-golang-uncompressed-noconflict.js +0 -378
  110. data/vendor/assets/javascripts/mode-golang-uncompressed.js +0 -378
  111. data/vendor/assets/javascripts/mode-groovy-noconflict.js +0 -1
  112. data/vendor/assets/javascripts/mode-groovy-uncompressed-noconflict.js +0 -1393
  113. data/vendor/assets/javascripts/mode-groovy-uncompressed.js +0 -1393
  114. data/vendor/assets/javascripts/mode-haxe-noconflict.js +0 -1
  115. data/vendor/assets/javascripts/mode-haxe-uncompressed-noconflict.js +0 -769
  116. data/vendor/assets/javascripts/mode-html-noconflict.js +0 -1
  117. data/vendor/assets/javascripts/mode-html-uncompressed-noconflict.js +0 -2475
  118. data/vendor/assets/javascripts/mode-java-noconflict.js +0 -1
  119. data/vendor/assets/javascripts/mode-java-uncompressed-noconflict.js +0 -1395
  120. data/vendor/assets/javascripts/mode-java-uncompressed.js +0 -1395
  121. data/vendor/assets/javascripts/mode-javascript-noconflict.js +0 -1
  122. data/vendor/assets/javascripts/mode-javascript-uncompressed-noconflict.js +0 -1226
  123. data/vendor/assets/javascripts/mode-javascript-uncompressed.js +0 -1226
  124. data/vendor/assets/javascripts/mode-json-noconflict.js +0 -1
  125. data/vendor/assets/javascripts/mode-json-uncompressed-noconflict.js +0 -701
  126. data/vendor/assets/javascripts/mode-json-uncompressed.js +0 -701
  127. data/vendor/assets/javascripts/mode-latex-noconflict.js +0 -1
  128. data/vendor/assets/javascripts/mode-latex-uncompressed-noconflict.js +0 -95
  129. data/vendor/assets/javascripts/mode-latex-uncompressed.js +0 -95
  130. data/vendor/assets/javascripts/mode-less-noconflict.js +0 -1
  131. data/vendor/assets/javascripts/mode-less-uncompressed-noconflict.js +0 -655
  132. data/vendor/assets/javascripts/mode-less-uncompressed.js +0 -655
  133. data/vendor/assets/javascripts/mode-liquid-noconflict.js +0 -1
  134. data/vendor/assets/javascripts/mode-liquid-uncompressed-noconflict.js +0 -1353
  135. data/vendor/assets/javascripts/mode-liquid-uncompressed.js +0 -1353
  136. data/vendor/assets/javascripts/mode-lua-noconflict.js +0 -1
  137. data/vendor/assets/javascripts/mode-lua-uncompressed-noconflict.js +0 -523
  138. data/vendor/assets/javascripts/mode-lua-uncompressed.js +0 -523
  139. data/vendor/assets/javascripts/mode-markdown-noconflict.js +0 -1
  140. data/vendor/assets/javascripts/mode-markdown-uncompressed-noconflict.js +0 -2925
  141. data/vendor/assets/javascripts/mode-markdown-uncompressed.js +0 -2925
  142. data/vendor/assets/javascripts/mode-ocaml-noconflict.js +0 -1
  143. data/vendor/assets/javascripts/mode-ocaml-uncompressed-noconflict.js +0 -539
  144. data/vendor/assets/javascripts/mode-ocaml-uncompressed.js +0 -539
  145. data/vendor/assets/javascripts/mode-perl-noconflict.js +0 -1
  146. data/vendor/assets/javascripts/mode-perl-uncompressed-noconflict.js +0 -574
  147. data/vendor/assets/javascripts/mode-perl-uncompressed.js +0 -574
  148. data/vendor/assets/javascripts/mode-pgsql-noconflict.js +0 -1
  149. data/vendor/assets/javascripts/mode-pgsql-uncompressed-noconflict.js +0 -1104
  150. data/vendor/assets/javascripts/mode-pgsql-uncompressed.js +0 -1104
  151. data/vendor/assets/javascripts/mode-php-noconflict.js +0 -1
  152. data/vendor/assets/javascripts/mode-php-uncompressed-noconflict.js +0 -1885
  153. data/vendor/assets/javascripts/mode-php-uncompressed.js +0 -1885
  154. data/vendor/assets/javascripts/mode-powershell-noconflict.js +0 -1
  155. data/vendor/assets/javascripts/mode-powershell-uncompressed-noconflict.js +0 -710
  156. data/vendor/assets/javascripts/mode-powershell-uncompressed.js +0 -710
  157. data/vendor/assets/javascripts/mode-python-noconflict.js +0 -1
  158. data/vendor/assets/javascripts/mode-python-uncompressed-noconflict.js +0 -507
  159. data/vendor/assets/javascripts/mode-python-uncompressed.js +0 -507
  160. data/vendor/assets/javascripts/mode-ruby-noconflict.js +0 -1
  161. data/vendor/assets/javascripts/mode-ruby-uncompressed-noconflict.js +0 -391
  162. data/vendor/assets/javascripts/mode-ruby-uncompressed.js +0 -391
  163. data/vendor/assets/javascripts/mode-scad-noconflict.js +0 -1
  164. data/vendor/assets/javascripts/mode-scad-uncompressed-noconflict.js +0 -907
  165. data/vendor/assets/javascripts/mode-scad-uncompressed.js +0 -907
  166. data/vendor/assets/javascripts/mode-scala-noconflict.js +0 -1
  167. data/vendor/assets/javascripts/mode-scala-uncompressed-noconflict.js +0 -1395
  168. data/vendor/assets/javascripts/mode-scala-uncompressed.js +0 -1395
  169. data/vendor/assets/javascripts/mode-scss-noconflict.js +0 -1
  170. data/vendor/assets/javascripts/mode-scss-uncompressed-noconflict.js +0 -679
  171. data/vendor/assets/javascripts/mode-scss-uncompressed.js +0 -679
  172. data/vendor/assets/javascripts/mode-sh-noconflict.js +0 -1
  173. data/vendor/assets/javascripts/mode-sh-uncompressed-noconflict.js +0 -289
  174. data/vendor/assets/javascripts/mode-sh-uncompressed.js +0 -289
  175. data/vendor/assets/javascripts/mode-sql-noconflict.js +0 -1
  176. data/vendor/assets/javascripts/mode-sql-uncompressed-noconflict.js +0 -159
  177. data/vendor/assets/javascripts/mode-sql-uncompressed.js +0 -159
  178. data/vendor/assets/javascripts/mode-svg-noconflict.js +0 -1
  179. data/vendor/assets/javascripts/mode-svg-uncompressed-noconflict.js +0 -2137
  180. data/vendor/assets/javascripts/mode-svg-uncompressed.js +0 -2137
  181. data/vendor/assets/javascripts/mode-text-noconflict.js +0 -0
  182. data/vendor/assets/javascripts/mode-text-uncompressed-noconflict.js +0 -0
  183. data/vendor/assets/javascripts/mode-text-uncompressed.js +0 -0
  184. data/vendor/assets/javascripts/mode-textile-noconflict.js +0 -1
  185. data/vendor/assets/javascripts/mode-textile-uncompressed-noconflict.js +0 -254
  186. data/vendor/assets/javascripts/mode-textile-uncompressed.js +0 -254
  187. data/vendor/assets/javascripts/mode-xml-noconflict.js +0 -1
  188. data/vendor/assets/javascripts/mode-xml-uncompressed-noconflict.js +0 -1012
  189. data/vendor/assets/javascripts/mode-xml-uncompressed.js +0 -1012
  190. data/vendor/assets/javascripts/mode-xquery-noconflict.js +0 -1
  191. data/vendor/assets/javascripts/mode-xquery-uncompressed-noconflict.js +0 -540
  192. data/vendor/assets/javascripts/mode-xquery-uncompressed.js +0 -540
  193. data/vendor/assets/javascripts/theme-chrome-noconflict.js +0 -1
  194. data/vendor/assets/javascripts/theme-chrome-uncompressed-noconflict.js +0 -207
  195. data/vendor/assets/javascripts/theme-chrome-uncompressed.js +0 -207
  196. data/vendor/assets/javascripts/theme-clouds-noconflict.js +0 -1
  197. data/vendor/assets/javascripts/theme-clouds-uncompressed-noconflict.js +0 -160
  198. data/vendor/assets/javascripts/theme-clouds-uncompressed.js +0 -160
  199. data/vendor/assets/javascripts/theme-clouds_midnight-noconflict.js +0 -1
  200. data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed-noconflict.js +0 -161
  201. data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed.js +0 -161
  202. data/vendor/assets/javascripts/theme-cobalt-noconflict.js +0 -1
  203. data/vendor/assets/javascripts/theme-cobalt-uncompressed-noconflict.js +0 -187
  204. data/vendor/assets/javascripts/theme-cobalt-uncompressed.js +0 -187
  205. data/vendor/assets/javascripts/theme-crimson_editor-noconflict.js +0 -1
  206. data/vendor/assets/javascripts/theme-crimson_editor-uncompressed-noconflict.js +0 -198
  207. data/vendor/assets/javascripts/theme-crimson_editor-uncompressed.js +0 -198
  208. data/vendor/assets/javascripts/theme-dawn-noconflict.js +0 -1
  209. data/vendor/assets/javascripts/theme-dawn-uncompressed-noconflict.js +0 -191
  210. data/vendor/assets/javascripts/theme-dawn-uncompressed.js +0 -191
  211. data/vendor/assets/javascripts/theme-dreamweaver-noconflict.js +0 -1
  212. data/vendor/assets/javascripts/theme-dreamweaver-uncompressed-noconflict.js +0 -227
  213. data/vendor/assets/javascripts/theme-dreamweaver-uncompressed.js +0 -227
  214. data/vendor/assets/javascripts/theme-eclipse-noconflict.js +0 -1
  215. data/vendor/assets/javascripts/theme-eclipse-uncompressed-noconflict.js +0 -147
  216. data/vendor/assets/javascripts/theme-eclipse-uncompressed.js +0 -147
  217. data/vendor/assets/javascripts/theme-idle_fingers-noconflict.js +0 -1
  218. data/vendor/assets/javascripts/theme-idle_fingers-uncompressed-noconflict.js +0 -179
  219. data/vendor/assets/javascripts/theme-idle_fingers-uncompressed.js +0 -179
  220. data/vendor/assets/javascripts/theme-kr_theme-noconflict.js +0 -1
  221. data/vendor/assets/javascripts/theme-kr_theme-uncompressed-noconflict.js +0 -182
  222. data/vendor/assets/javascripts/theme-kr_theme-uncompressed.js +0 -182
  223. data/vendor/assets/javascripts/theme-merbivore-noconflict.js +0 -1
  224. data/vendor/assets/javascripts/theme-merbivore-uncompressed-noconflict.js +0 -182
  225. data/vendor/assets/javascripts/theme-merbivore-uncompressed.js +0 -182
  226. data/vendor/assets/javascripts/theme-merbivore_soft-noconflict.js +0 -1
  227. data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed-noconflict.js +0 -188
  228. data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed.js +0 -188
  229. data/vendor/assets/javascripts/theme-mono_industrial-noconflict.js +0 -1
  230. data/vendor/assets/javascripts/theme-mono_industrial-uncompressed-noconflict.js +0 -190
  231. data/vendor/assets/javascripts/theme-mono_industrial-uncompressed.js +0 -190
  232. data/vendor/assets/javascripts/theme-monokai-noconflict.js +0 -1
  233. data/vendor/assets/javascripts/theme-monokai-uncompressed-noconflict.js +0 -191
  234. data/vendor/assets/javascripts/theme-monokai-uncompressed.js +0 -191
  235. data/vendor/assets/javascripts/theme-pastel_on_dark-noconflict.js +0 -1
  236. data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed-noconflict.js +0 -192
  237. data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed.js +0 -192
  238. data/vendor/assets/javascripts/theme-solarized_dark-noconflict.js +0 -1
  239. data/vendor/assets/javascripts/theme-solarized_dark-uncompressed-noconflict.js +0 -176
  240. data/vendor/assets/javascripts/theme-solarized_dark-uncompressed.js +0 -176
  241. data/vendor/assets/javascripts/theme-solarized_light-noconflict.js +0 -1
  242. data/vendor/assets/javascripts/theme-solarized_light-uncompressed-noconflict.js +0 -172
  243. data/vendor/assets/javascripts/theme-solarized_light-uncompressed.js +0 -172
  244. data/vendor/assets/javascripts/theme-textmate-noconflict.js +0 -0
  245. data/vendor/assets/javascripts/theme-textmate-uncompressed-noconflict.js +0 -0
  246. data/vendor/assets/javascripts/theme-textmate-uncompressed.js +0 -0
  247. data/vendor/assets/javascripts/theme-tomorrow-noconflict.js +0 -1
  248. data/vendor/assets/javascripts/theme-tomorrow-uncompressed-noconflict.js +0 -206
  249. data/vendor/assets/javascripts/theme-tomorrow-uncompressed.js +0 -206
  250. data/vendor/assets/javascripts/theme-tomorrow_night-noconflict.js +0 -1
  251. data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed-noconflict.js +0 -206
  252. data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed.js +0 -206
  253. data/vendor/assets/javascripts/theme-tomorrow_night_blue-noconflict.js +0 -1
  254. data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed-noconflict.js +0 -209
  255. data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed.js +0 -209
  256. data/vendor/assets/javascripts/theme-tomorrow_night_bright-noconflict.js +0 -1
  257. data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed-noconflict.js +0 -206
  258. data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed.js +0 -206
  259. data/vendor/assets/javascripts/theme-tomorrow_night_eighties-noconflict.js +0 -1
  260. data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed-noconflict.js +0 -202
  261. data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed.js +0 -202
  262. data/vendor/assets/javascripts/theme-twilight-noconflict.js +0 -1
  263. data/vendor/assets/javascripts/theme-twilight-uncompressed-noconflict.js +0 -204
  264. data/vendor/assets/javascripts/theme-twilight-uncompressed.js +0 -204
  265. data/vendor/assets/javascripts/theme-vibrant_ink-noconflict.js +0 -1
  266. data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed-noconflict.js +0 -183
  267. data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed.js +0 -183
@@ -1,710 +0,0 @@
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 == '"' || text == "'") {
429
- var quote = text;
430
- var selection = editor.getSelectionRange();
431
- var selected = session.doc.getTextRange(selection);
432
- if (selected !== "") {
433
- return {
434
- text: quote + selected + quote,
435
- selection: false
436
- };
437
- } else {
438
- var cursor = editor.getCursorPosition();
439
- var line = session.doc.getLine(cursor.row);
440
- var leftChar = line.substring(cursor.column-1, cursor.column);
441
-
442
- // We're escaped.
443
- if (leftChar == '\\') {
444
- return null;
445
- }
446
-
447
- // Find what token we're inside.
448
- var tokens = session.getTokens(selection.start.row, selection.start.row)[0].tokens;
449
- var col = 0, token;
450
- var quotepos = -1; // Track whether we're inside an open quote.
451
-
452
- for (var x = 0; x < tokens.length; x++) {
453
- token = tokens[x];
454
- if (token.type == "string") {
455
- quotepos = -1;
456
- } else if (quotepos < 0) {
457
- quotepos = token.value.indexOf(quote);
458
- }
459
- if ((token.value.length + col) > selection.start.column) {
460
- break;
461
- }
462
- col += tokens[x].value.length;
463
- }
464
-
465
- // Try and be smart about when we auto insert.
466
- if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
467
- return {
468
- text: quote + quote,
469
- selection: [1,1]
470
- };
471
- } else if (token && token.type === "string") {
472
- // Ignore input and move right one if we're typing over the closing quote.
473
- var rightChar = line.substring(cursor.column, cursor.column + 1);
474
- if (rightChar == quote) {
475
- return {
476
- text: '',
477
- selection: [1, 1]
478
- };
479
- }
480
- }
481
- }
482
- }
483
- });
484
-
485
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
486
- var selected = session.doc.getTextRange(range);
487
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
488
- var line = session.doc.getLine(range.start.row);
489
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
490
- if (rightChar == '"') {
491
- range.end.column++;
492
- return range;
493
- }
494
- }
495
- });
496
-
497
- };
498
-
499
- oop.inherits(CstyleBehaviour, Behaviour);
500
-
501
- exports.CstyleBehaviour = CstyleBehaviour;
502
- });
503
- /* ***** BEGIN LICENSE BLOCK *****
504
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
505
- *
506
- * The contents of this file are subject to the Mozilla Public License Version
507
- * 1.1 (the "License"); you may not use this file except in compliance with
508
- * the License. You may obtain a copy of the License at
509
- * http://www.mozilla.org/MPL/
510
- *
511
- * Software distributed under the License is distributed on an "AS IS" basis,
512
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
513
- * for the specific language governing rights and limitations under the
514
- * License.
515
- *
516
- * The Original Code is Ajax.org Code Editor (ACE).
517
- *
518
- * The Initial Developer of the Original Code is
519
- * Ajax.org B.V.
520
- * Portions created by the Initial Developer are Copyright (C) 2010
521
- * the Initial Developer. All Rights Reserved.
522
- *
523
- * Contributor(s):
524
- * Fabian Jakobs <fabian AT ajax DOT org>
525
- *
526
- * Alternatively, the contents of this file may be used under the terms of
527
- * either the GNU General Public License Version 2 or later (the "GPL"), or
528
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
529
- * in which case the provisions of the GPL or the LGPL are applicable instead
530
- * of those above. If you wish to allow use of your version of this file only
531
- * under the terms of either the GPL or the LGPL, and not to allow others to
532
- * use your version of this file under the terms of the MPL, indicate your
533
- * decision by deleting the provisions above and replace them with the notice
534
- * and other provisions required by the GPL or the LGPL. If you do not delete
535
- * the provisions above, a recipient may use your version of this file under
536
- * the terms of any one of the MPL, the GPL or the LGPL.
537
- *
538
- * ***** END LICENSE BLOCK ***** */
539
-
540
- define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
541
- "use strict";
542
-
543
- var oop = require("../../lib/oop");
544
- var Range = require("../../range").Range;
545
- var BaseFoldMode = require("./fold_mode").FoldMode;
546
-
547
- var FoldMode = exports.FoldMode = function() {};
548
- oop.inherits(FoldMode, BaseFoldMode);
549
-
550
- (function() {
551
-
552
- this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
553
- this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
554
-
555
- this.getFoldWidgetRange = function(session, foldStyle, row) {
556
- var line = session.getLine(row);
557
- var match = line.match(this.foldingStartMarker);
558
- if (match) {
559
- var i = match.index;
560
-
561
- if (match[1])
562
- return this.openingBracketBlock(session, match[1], row, i);
563
-
564
- var range = session.getCommentFoldRange(row, i + match[0].length);
565
- range.end.column -= 2;
566
- return range;
567
- }
568
-
569
- if (foldStyle !== "markbeginend")
570
- return;
571
-
572
- var match = line.match(this.foldingStopMarker);
573
- if (match) {
574
- var i = match.index + match[0].length;
575
-
576
- if (match[2]) {
577
- var range = session.getCommentFoldRange(row, i);
578
- range.end.column -= 2;
579
- return range;
580
- }
581
-
582
- var end = {row: row, column: i};
583
- var start = session.$findOpeningBracket(match[1], end);
584
-
585
- if (!start)
586
- return;
587
-
588
- start.column++;
589
- end.column--;
590
-
591
- return Range.fromPoints(start, end);
592
- }
593
- };
594
-
595
- }).call(FoldMode.prototype);
596
-
597
- });
598
- /* ***** BEGIN LICENSE BLOCK *****
599
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
600
- *
601
- * The contents of this file are subject to the Mozilla Public License Version
602
- * 1.1 (the "License"); you may not use this file except in compliance with
603
- * the License. You may obtain a copy of the License at
604
- * http://www.mozilla.org/MPL/
605
- *
606
- * Software distributed under the License is distributed on an "AS IS" basis,
607
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
608
- * for the specific language governing rights and limitations under the
609
- * License.
610
- *
611
- * The Original Code is Ajax.org Code Editor (ACE).
612
- *
613
- * The Initial Developer of the Original Code is
614
- * Ajax.org B.V.
615
- * Portions created by the Initial Developer are Copyright (C) 2010
616
- * the Initial Developer. All Rights Reserved.
617
- *
618
- * Contributor(s):
619
- * Fabian Jakobs <fabian AT ajax DOT org>
620
- *
621
- * Alternatively, the contents of this file may be used under the terms of
622
- * either the GNU General Public License Version 2 or later (the "GPL"), or
623
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
624
- * in which case the provisions of the GPL or the LGPL are applicable instead
625
- * of those above. If you wish to allow use of your version of this file only
626
- * under the terms of either the GPL or the LGPL, and not to allow others to
627
- * use your version of this file under the terms of the MPL, indicate your
628
- * decision by deleting the provisions above and replace them with the notice
629
- * and other provisions required by the GPL or the LGPL. If you do not delete
630
- * the provisions above, a recipient may use your version of this file under
631
- * the terms of any one of the MPL, the GPL or the LGPL.
632
- *
633
- * ***** END LICENSE BLOCK ***** */
634
-
635
- define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
636
- "use strict";
637
-
638
- var Range = require("../../range").Range;
639
-
640
- var FoldMode = exports.FoldMode = function() {};
641
-
642
- (function() {
643
-
644
- this.foldingStartMarker = null;
645
- this.foldingStopMarker = null;
646
-
647
- // must return "" if there's no fold, to enable caching
648
- this.getFoldWidget = function(session, foldStyle, row) {
649
- var line = session.getLine(row);
650
- if (this.foldingStartMarker.test(line))
651
- return "start";
652
- if (foldStyle == "markbeginend"
653
- && this.foldingStopMarker
654
- && this.foldingStopMarker.test(line))
655
- return "end";
656
- return "";
657
- };
658
-
659
- this.getFoldWidgetRange = function(session, foldStyle, row) {
660
- return null;
661
- };
662
-
663
- this.indentationBlock = function(session, row, column) {
664
- var re = /^\s*/;
665
- var startRow = row;
666
- var endRow = row;
667
- var line = session.getLine(row);
668
- var startColumn = column || line.length;
669
- var startLevel = line.match(re)[0].length;
670
- var maxRow = session.getLength()
671
-
672
- while (++row < maxRow) {
673
- line = session.getLine(row);
674
- var level = line.match(re)[0].length;
675
-
676
- if (level == line.length)
677
- continue;
678
-
679
- if (level <= startLevel)
680
- break;
681
-
682
- endRow = row;
683
- }
684
-
685
- if (endRow > startRow) {
686
- var endColumn = session.getLine(endRow).length;
687
- return new Range(startRow, startColumn, endRow, endColumn);
688
- }
689
- };
690
-
691
- this.openingBracketBlock = function(session, bracket, row, column) {
692
- var start = {row: row, column: column + 1};
693
- var end = session.$findClosingBracket(bracket, start);
694
- if (!end)
695
- return;
696
-
697
- var fw = session.foldWidgets[end.row];
698
- if (fw == null)
699
- fw = this.getFoldWidget(session, end.row);
700
-
701
- if (fw == "start") {
702
- end.row --;
703
- end.column = session.getLine(end.row).length;
704
- }
705
- return Range.fromPoints(start, end);
706
- };
707
-
708
- }).call(FoldMode.prototype);
709
-
710
- });