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