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,1393 +0,0 @@
1
- define('ace/mode/groovy', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/groovy_highlight_rules'], function(require, exports, module) {
2
- "use strict";
3
-
4
- var oop = require("../lib/oop");
5
- var JavaScriptMode = require("./javascript").Mode;
6
- var Tokenizer = require("../tokenizer").Tokenizer;
7
- var GroovyHighlightRules = require("./groovy_highlight_rules").GroovyHighlightRules;
8
-
9
- var Mode = function() {
10
- JavaScriptMode.call(this);
11
- this.$tokenizer = new Tokenizer(new GroovyHighlightRules().getRules());
12
- };
13
- oop.inherits(Mode, JavaScriptMode);
14
-
15
- (function() {
16
-
17
- this.createWorker = function(session) {
18
- return null;
19
- };
20
-
21
- }).call(Mode.prototype);
22
-
23
- exports.Mode = Mode;
24
- });
25
- /* ***** BEGIN LICENSE BLOCK *****
26
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
27
- *
28
- * The contents of this file are subject to the Mozilla Public License Version
29
- * 1.1 (the "License"); you may not use this file except in compliance with
30
- * the License. You may obtain a copy of the License at
31
- * http://www.mozilla.org/MPL/
32
- *
33
- * Software distributed under the License is distributed on an "AS IS" basis,
34
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
35
- * for the specific language governing rights and limitations under the
36
- * License.
37
- *
38
- * The Original Code is Ajax.org Code Editor (ACE).
39
- *
40
- * The Initial Developer of the Original Code is
41
- * Ajax.org B.V.
42
- * Portions created by the Initial Developer are Copyright (C) 2010
43
- * the Initial Developer. All Rights Reserved.
44
- *
45
- * Contributor(s):
46
- * Fabian Jakobs <fabian AT ajax DOT org>
47
- *
48
- * Alternatively, the contents of this file may be used under the terms of
49
- * either the GNU General Public License Version 2 or later (the "GPL"), or
50
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
51
- * in which case the provisions of the GPL or the LGPL are applicable instead
52
- * of those above. If you wish to allow use of your version of this file only
53
- * under the terms of either the GPL or the LGPL, and not to allow others to
54
- * use your version of this file under the terms of the MPL, indicate your
55
- * decision by deleting the provisions above and replace them with the notice
56
- * and other provisions required by the GPL or the LGPL. If you do not delete
57
- * the provisions above, a recipient may use your version of this file under
58
- * the terms of any one of the MPL, the GPL or the LGPL.
59
- *
60
- * ***** END LICENSE BLOCK ***** */
61
-
62
- define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
63
- "use strict";
64
-
65
- var oop = require("../lib/oop");
66
- var TextMode = require("./text").Mode;
67
- var Tokenizer = require("../tokenizer").Tokenizer;
68
- var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
69
- var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
70
- var Range = require("../range").Range;
71
- var WorkerClient = require("../worker/worker_client").WorkerClient;
72
- var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
73
- var CStyleFoldMode = require("./folding/cstyle").FoldMode;
74
-
75
- var Mode = function() {
76
- this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
77
- this.$outdent = new MatchingBraceOutdent();
78
- this.$behaviour = new CstyleBehaviour();
79
- this.foldingRules = new CStyleFoldMode();
80
- };
81
- oop.inherits(Mode, TextMode);
82
-
83
- (function() {
84
-
85
-
86
- this.toggleCommentLines = function(state, doc, startRow, endRow) {
87
- var outdent = true;
88
- var re = /^(\s*)\/\//;
89
-
90
- for (var i=startRow; i<= endRow; i++) {
91
- if (!re.test(doc.getLine(i))) {
92
- outdent = false;
93
- break;
94
- }
95
- }
96
-
97
- if (outdent) {
98
- var deleteRange = new Range(0, 0, 0, 0);
99
- for (var i=startRow; i<= endRow; i++)
100
- {
101
- var line = doc.getLine(i);
102
- var m = line.match(re);
103
- deleteRange.start.row = i;
104
- deleteRange.end.row = i;
105
- deleteRange.end.column = m[0].length;
106
- doc.replace(deleteRange, m[1]);
107
- }
108
- }
109
- else {
110
- doc.indentRows(startRow, endRow, "//");
111
- }
112
- };
113
-
114
- this.getNextLineIndent = function(state, line, tab) {
115
- var indent = this.$getIndent(line);
116
-
117
- var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
118
- var tokens = tokenizedLine.tokens;
119
- var endState = tokenizedLine.state;
120
-
121
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
122
- return indent;
123
- }
124
-
125
- if (state == "start" || state == "regex_allowed") {
126
- var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
127
- if (match) {
128
- indent += tab;
129
- }
130
- } else if (state == "doc-start") {
131
- if (endState == "start" || state == "regex_allowed") {
132
- return "";
133
- }
134
- var match = line.match(/^\s*(\/?)\*/);
135
- if (match) {
136
- if (match[1]) {
137
- indent += " ";
138
- }
139
- indent += "* ";
140
- }
141
- }
142
-
143
- return indent;
144
- };
145
-
146
- this.checkOutdent = function(state, line, input) {
147
- return this.$outdent.checkOutdent(line, input);
148
- };
149
-
150
- this.autoOutdent = function(state, doc, row) {
151
- this.$outdent.autoOutdent(doc, row);
152
- };
153
-
154
- this.createWorker = function(session) {
155
- var worker = new WorkerClient(["ace"], "worker-javascript.js", "ace/mode/javascript_worker", "JavaScriptWorker");
156
- worker.attachToDocument(session.getDocument());
157
-
158
- worker.on("jslint", function(results) {
159
- var errors = [];
160
- for (var i=0; i<results.data.length; i++) {
161
- var error = results.data[i];
162
- if (error)
163
- errors.push({
164
- row: error.line-1,
165
- column: error.character-1,
166
- text: error.reason,
167
- type: "warning",
168
- lint: error
169
- });
170
- }
171
- session.setAnnotations(errors);
172
- });
173
-
174
- worker.on("narcissus", function(e) {
175
- session.setAnnotations([e.data]);
176
- });
177
-
178
- worker.on("terminate", function() {
179
- session.clearAnnotations();
180
- });
181
-
182
- return worker;
183
- };
184
-
185
- }).call(Mode.prototype);
186
-
187
- exports.Mode = Mode;
188
- });
189
- /* ***** BEGIN LICENSE BLOCK *****
190
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
191
- *
192
- * The contents of this file are subject to the Mozilla Public License Version
193
- * 1.1 (the "License"); you may not use this file except in compliance with
194
- * the License. You may obtain a copy of the License at
195
- * http://www.mozilla.org/MPL/
196
- *
197
- * Software distributed under the License is distributed on an "AS IS" basis,
198
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
199
- * for the specific language governing rights and limitations under the
200
- * License.
201
- *
202
- * The Original Code is Ajax.org Code Editor (ACE).
203
- *
204
- * The Initial Developer of the Original Code is
205
- * Ajax.org B.V.
206
- * Portions created by the Initial Developer are Copyright (C) 2010
207
- * the Initial Developer. All Rights Reserved.
208
- *
209
- * Contributor(s):
210
- * Fabian Jakobs <fabian AT ajax DOT org>
211
- * Mihai Sucan <mihai DOT sucan AT gmail DOT com>
212
- *
213
- * Alternatively, the contents of this file may be used under the terms of
214
- * either the GNU General Public License Version 2 or later (the "GPL"), or
215
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
216
- * in which case the provisions of the GPL or the LGPL are applicable instead
217
- * of those above. If you wish to allow use of your version of this file only
218
- * under the terms of either the GPL or the LGPL, and not to allow others to
219
- * use your version of this file under the terms of the MPL, indicate your
220
- * decision by deleting the provisions above and replace them with the notice
221
- * and other provisions required by the GPL or the LGPL. If you do not delete
222
- * the provisions above, a recipient may use your version of this file under
223
- * the terms of any one of the MPL, the GPL or the LGPL.
224
- *
225
- * ***** END LICENSE BLOCK ***** */
226
-
227
- define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
228
- "use strict";
229
-
230
- var oop = require("../lib/oop");
231
- var lang = require("../lib/lang");
232
- var unicode = require("../unicode");
233
- var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
234
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
235
-
236
- var JavaScriptHighlightRules = function() {
237
-
238
- // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
239
- var globals = lang.arrayToMap(
240
- // Constructors
241
- ("Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" +
242
- // E4X
243
- "Namespace|QName|XML|XMLList|" +
244
- "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
245
- "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
246
- // Errors
247
- "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
248
- "SyntaxError|TypeError|URIError|" +
249
- // Non-constructor functions
250
- "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" +
251
- "isNaN|parseFloat|parseInt|" +
252
- // Other
253
- "JSON|Math|" +
254
- // Pseudo
255
- "this|arguments|prototype|window|document"
256
- ).split("|")
257
- );
258
-
259
- var keywords = lang.arrayToMap(
260
- ("break|case|catch|continue|default|delete|do|else|finally|for|function|" +
261
- "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|" +
262
- "const|yield|import|get|set").split("|")
263
- );
264
-
265
- // keywords which can be followed by regular expressions
266
- var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
267
-
268
- var deprecated = lang.arrayToMap(
269
- ("__parent__|__count__|escape|unescape|with|__proto__").split("|")
270
- );
271
-
272
- var definitions = lang.arrayToMap(("const|let|var|function").split("|"));
273
-
274
- var buildinConstants = lang.arrayToMap(
275
- ("null|Infinity|NaN|undefined").split("|")
276
- );
277
-
278
- var futureReserved = lang.arrayToMap(
279
- ("class|enum|extends|super|export|implements|private|" +
280
- "public|interface|package|protected|static").split("|")
281
- );
282
-
283
- // TODO: Unicode escape sequences
284
- var identifierRe = "[" + unicode.packages.L + "\\$_]["
285
- + unicode.packages.L
286
- + unicode.packages.Mn + unicode.packages.Mc
287
- + unicode.packages.Nd
288
- + unicode.packages.Pc + "\\$_]*\\b";
289
-
290
- var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
291
- "u[0-9a-fA-F]{4}|" + // unicode
292
- "[0-2][0-7]{0,2}|" + // oct
293
- "3[0-6][0-7]?|" + // oct
294
- "37[0-7]?|" + // oct
295
- "[4-7][0-7]?|" + //oct
296
- ".)";
297
-
298
- // regexp must not have capturing parentheses. Use (?:) instead.
299
- // regexps are ordered -> the first match is used
300
-
301
- this.$rules = {
302
- "start" : [
303
- {
304
- token : "comment",
305
- regex : /\/\/.*$/
306
- },
307
- DocCommentHighlightRules.getStartRule("doc-start"),
308
- {
309
- token : "comment", // multi line comment
310
- merge : true,
311
- regex : /\/\*/,
312
- next : "comment"
313
- }, {
314
- token : "string",
315
- regex : "'(?=.)",
316
- next : "qstring"
317
- }, {
318
- token : "string",
319
- regex : '"(?=.)',
320
- next : "qqstring"
321
- }, {
322
- token : "constant.numeric", // hex
323
- regex : /0[xX][0-9a-fA-F]+\b/
324
- }, {
325
- token : "constant.numeric", // float
326
- regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
327
- }, { // match stuff like: Sound.prototype.play = function() { }
328
- token : [
329
- "storage.type",
330
- "punctuation.operator",
331
- "support.function",
332
- "punctuation.operator",
333
- "entity.name.function",
334
- "text",
335
- "keyword.operator",
336
- "text",
337
- "storage.type",
338
- "text",
339
- "paren.lparen"
340
- ],
341
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
342
- next: "function_arguments"
343
- }, { // match stuff like: Sound.prototype.play = myfunc
344
- token : [
345
- "storage.type",
346
- "punctuation.operator",
347
- "support.function",
348
- "punctuation.operator",
349
- "entity.name.function",
350
- "text",
351
- "keyword.operator",
352
- "text"
353
- ],
354
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
355
- next: "function_arguments"
356
- }, { // match stuff like: Sound.play = function() { }
357
- token : [
358
- "storage.type",
359
- "punctuation.operator",
360
- "entity.name.function",
361
- "text",
362
- "keyword.operator",
363
- "text",
364
- "storage.type",
365
- "text",
366
- "paren.lparen"
367
- ],
368
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
369
- next: "function_arguments"
370
- }, { // match stuff like: play = function() { }
371
- token : [
372
- "entity.name.function",
373
- "text",
374
- "keyword.operator",
375
- "text",
376
- "storage.type",
377
- "text",
378
- "paren.lparen"
379
- ],
380
- regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
381
- next: "function_arguments"
382
- }, { // match regular function like: function myFunc(arg) { }
383
- token : [
384
- "storage.type",
385
- "text",
386
- "entity.name.function",
387
- "text",
388
- "paren.lparen"
389
- ],
390
- regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
391
- next: "function_arguments"
392
- }, { // match stuff like: foobar: function() { }
393
- token : [
394
- "entity.name.function",
395
- "text",
396
- "punctuation.operator",
397
- "text",
398
- "storage.type",
399
- "text",
400
- "paren.lparen"
401
- ],
402
- regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
403
- next: "function_arguments"
404
- }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
405
- token : [
406
- "text",
407
- "text",
408
- "storage.type",
409
- "text",
410
- "paren.lparen"
411
- ],
412
- regex : "(:)(\\s*)(function)(\\s*)(\\()",
413
- next: "function_arguments"
414
- }, {
415
- token : "constant.language.boolean",
416
- regex : /(?:true|false)\b/
417
- }, {
418
- token : "keyword",
419
- regex : "(?:" + kwBeforeRe + ")\\b",
420
- next : "regex_allowed"
421
- }, {
422
- token : ["punctuation.operator", "support.function"],
423
- regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
424
- }, {
425
- token : ["punctuation.operator", "support.function.dom"],
426
- regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
427
- }, {
428
- token : ["punctuation.operator", "support.constant"],
429
- regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
430
- }, {
431
- token : ["storage.type", "punctuation.operator", "support.function.firebug"],
432
- regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
433
- }, {
434
- token : function(value) {
435
- if (globals.hasOwnProperty(value))
436
- return "variable.language";
437
- else if (deprecated.hasOwnProperty(value))
438
- return "invalid.deprecated";
439
- else if (definitions.hasOwnProperty(value))
440
- return "storage.type";
441
- else if (keywords.hasOwnProperty(value))
442
- return "keyword";
443
- else if (buildinConstants.hasOwnProperty(value))
444
- return "constant.language";
445
- else if (futureReserved.hasOwnProperty(value))
446
- return "invalid.illegal";
447
- else if (value == "debugger")
448
- return "invalid.deprecated";
449
- else
450
- return "identifier";
451
- },
452
- regex : identifierRe
453
- }, {
454
- token : "keyword.operator",
455
- regex : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
456
- next : "regex_allowed"
457
- }, {
458
- token : "punctuation.operator",
459
- regex : /\?|\:|\,|\;|\./,
460
- next : "regex_allowed"
461
- }, {
462
- token : "paren.lparen",
463
- regex : /[\[({]/,
464
- next : "regex_allowed"
465
- }, {
466
- token : "paren.rparen",
467
- regex : /[\])}]/
468
- }, {
469
- token : "keyword.operator",
470
- regex : /\/=?/,
471
- next : "regex_allowed"
472
- }, {
473
- token: "comment",
474
- regex: /^#!.*$/
475
- }, {
476
- token : "text",
477
- regex : /\s+/
478
- }
479
- ],
480
- // regular expressions are only allowed after certain tokens. This
481
- // makes sure we don't mix up regexps with the divison operator
482
- "regex_allowed": [
483
- DocCommentHighlightRules.getStartRule("doc-start"),
484
- {
485
- token : "comment", // multi line comment
486
- merge : true,
487
- regex : "\\/\\*",
488
- next : "comment_regex_allowed"
489
- }, {
490
- token : "comment",
491
- regex : "\\/\\/.*$"
492
- }, {
493
- token: "string.regexp",
494
- regex: "\\/",
495
- next: "regex",
496
- merge: true
497
- }, {
498
- token : "text",
499
- regex : "\\s+"
500
- }, {
501
- // immediately return to the start mode without matching
502
- // anything
503
- token: "empty",
504
- regex: "",
505
- next: "start"
506
- }
507
- ],
508
- "regex": [
509
- {
510
- token: "regexp.keyword.operator",
511
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
512
- }, {
513
- // flag
514
- token: "string.regexp",
515
- regex: "/\\w*",
516
- next: "start",
517
- merge: true
518
- }, {
519
- token: "string.regexp",
520
- regex: "[^\\\\/\\[]+",
521
- merge: true
522
- }, {
523
- token: "string.regexp.charachterclass",
524
- regex: "\\[",
525
- next: "regex_character_class",
526
- merge: true
527
- }, {
528
- token: "empty",
529
- regex: "",
530
- next: "start"
531
- }
532
- ],
533
- "regex_character_class": [
534
- {
535
- token: "regexp.keyword.operator",
536
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
537
- }, {
538
- token: "string.regexp.charachterclass",
539
- regex: "]",
540
- next: "regex",
541
- merge: true
542
- }, {
543
- token: "string.regexp.charachterclass",
544
- regex: "[^\\\\\\]]+",
545
- merge: true
546
- }, {
547
- token: "empty",
548
- regex: "",
549
- next: "start"
550
- }
551
- ],
552
- "function_arguments": [
553
- {
554
- token: "variable.parameter",
555
- regex: identifierRe,
556
- }, {
557
- token: "punctuation.operator",
558
- regex: "[, ]+",
559
- merge: true
560
- }, {
561
- token: "punctuation.operator",
562
- regex: "$",
563
- merge: true
564
- }, {
565
- token: "empty",
566
- regex: "",
567
- next: "start"
568
- }
569
- ],
570
- "comment_regex_allowed" : [
571
- {
572
- token : "comment", // closing comment
573
- regex : ".*?\\*\\/",
574
- merge : true,
575
- next : "regex_allowed"
576
- }, {
577
- token : "comment", // comment spanning whole line
578
- merge : true,
579
- regex : ".+"
580
- }
581
- ],
582
- "comment" : [
583
- {
584
- token : "comment", // closing comment
585
- regex : ".*?\\*\\/",
586
- merge : true,
587
- next : "start"
588
- }, {
589
- token : "comment", // comment spanning whole line
590
- merge : true,
591
- regex : ".+"
592
- }
593
- ],
594
- "qqstring" : [
595
- {
596
- token : "constant.language.escape",
597
- regex : escapedRe
598
- }, {
599
- token : "string",
600
- regex : '[^"\\\\]+',
601
- merge : true
602
- }, {
603
- token : "string",
604
- regex : "\\\\$",
605
- next : "qqstring",
606
- merge : true
607
- }, {
608
- token : "string",
609
- regex : '"|$',
610
- next : "start",
611
- merge : true
612
- }
613
- ],
614
- "qstring" : [
615
- {
616
- token : "constant.language.escape",
617
- regex : escapedRe
618
- }, {
619
- token : "string",
620
- regex : "[^'\\\\]+",
621
- merge : true
622
- }, {
623
- token : "string",
624
- regex : "\\\\$",
625
- next : "qstring",
626
- merge : true
627
- }, {
628
- token : "string",
629
- regex : "'|$",
630
- next : "start",
631
- merge : true
632
- }
633
- ]
634
- };
635
-
636
- this.embedRules(DocCommentHighlightRules, "doc-",
637
- [ DocCommentHighlightRules.getEndRule("start") ]);
638
- };
639
-
640
- oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
641
-
642
- exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
643
- });
644
- /* ***** BEGIN LICENSE BLOCK *****
645
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
646
- *
647
- * The contents of this file are subject to the Mozilla Public License Version
648
- * 1.1 (the "License"); you may not use this file except in compliance with
649
- * the License. You may obtain a copy of the License at
650
- * http://www.mozilla.org/MPL/
651
- *
652
- * Software distributed under the License is distributed on an "AS IS" basis,
653
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
654
- * for the specific language governing rights and limitations under the
655
- * License.
656
- *
657
- * The Original Code is Ajax.org Code Editor (ACE).
658
- *
659
- * The Initial Developer of the Original Code is
660
- * Ajax.org B.V.
661
- * Portions created by the Initial Developer are Copyright (C) 2010
662
- * the Initial Developer. All Rights Reserved.
663
- *
664
- * Contributor(s):
665
- * Fabian Jakobs <fabian AT ajax DOT org>
666
- *
667
- * Alternatively, the contents of this file may be used under the terms of
668
- * either the GNU General Public License Version 2 or later (the "GPL"), or
669
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
670
- * in which case the provisions of the GPL or the LGPL are applicable instead
671
- * of those above. If you wish to allow use of your version of this file only
672
- * under the terms of either the GPL or the LGPL, and not to allow others to
673
- * use your version of this file under the terms of the MPL, indicate your
674
- * decision by deleting the provisions above and replace them with the notice
675
- * and other provisions required by the GPL or the LGPL. If you do not delete
676
- * the provisions above, a recipient may use your version of this file under
677
- * the terms of any one of the MPL, the GPL or the LGPL.
678
- *
679
- * ***** END LICENSE BLOCK ***** */
680
-
681
- define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
682
- "use strict";
683
-
684
- var oop = require("../lib/oop");
685
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
686
-
687
- var DocCommentHighlightRules = function() {
688
-
689
- this.$rules = {
690
- "start" : [ {
691
- token : "comment.doc.tag",
692
- regex : "@[\\w\\d_]+" // TODO: fix email addresses
693
- }, {
694
- token : "comment.doc",
695
- merge : true,
696
- regex : "\\s+"
697
- }, {
698
- token : "comment.doc",
699
- merge : true,
700
- regex : "TODO"
701
- }, {
702
- token : "comment.doc",
703
- merge : true,
704
- regex : "[^@\\*]+"
705
- }, {
706
- token : "comment.doc",
707
- merge : true,
708
- regex : "."
709
- }]
710
- };
711
- };
712
-
713
- oop.inherits(DocCommentHighlightRules, TextHighlightRules);
714
-
715
- DocCommentHighlightRules.getStartRule = function(start) {
716
- return {
717
- token : "comment.doc", // doc comment
718
- merge : true,
719
- regex : "\\/\\*(?=\\*)",
720
- next : start
721
- };
722
- };
723
-
724
- DocCommentHighlightRules.getEndRule = function (start) {
725
- return {
726
- token : "comment.doc", // closing comment
727
- merge : true,
728
- regex : "\\*\\/",
729
- next : start
730
- };
731
- };
732
-
733
-
734
- exports.DocCommentHighlightRules = DocCommentHighlightRules;
735
-
736
- });
737
- /* ***** BEGIN LICENSE BLOCK *****
738
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
739
- *
740
- * The contents of this file are subject to the Mozilla Public License Version
741
- * 1.1 (the "License"); you may not use this file except in compliance with
742
- * the License. You may obtain a copy of the License at
743
- * http://www.mozilla.org/MPL/
744
- *
745
- * Software distributed under the License is distributed on an "AS IS" basis,
746
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
747
- * for the specific language governing rights and limitations under the
748
- * License.
749
- *
750
- * The Original Code is Ajax.org Code Editor (ACE).
751
- *
752
- * The Initial Developer of the Original Code is
753
- * Ajax.org B.V.
754
- * Portions created by the Initial Developer are Copyright (C) 2010
755
- * the Initial Developer. All Rights Reserved.
756
- *
757
- * Contributor(s):
758
- * Fabian Jakobs <fabian AT ajax DOT org>
759
- *
760
- * Alternatively, the contents of this file may be used under the terms of
761
- * either the GNU General Public License Version 2 or later (the "GPL"), or
762
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
763
- * in which case the provisions of the GPL or the LGPL are applicable instead
764
- * of those above. If you wish to allow use of your version of this file only
765
- * under the terms of either the GPL or the LGPL, and not to allow others to
766
- * use your version of this file under the terms of the MPL, indicate your
767
- * decision by deleting the provisions above and replace them with the notice
768
- * and other provisions required by the GPL or the LGPL. If you do not delete
769
- * the provisions above, a recipient may use your version of this file under
770
- * the terms of any one of the MPL, the GPL or the LGPL.
771
- *
772
- * ***** END LICENSE BLOCK ***** */
773
-
774
- define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
775
- "use strict";
776
-
777
- var Range = require("../range").Range;
778
-
779
- var MatchingBraceOutdent = function() {};
780
-
781
- (function() {
782
-
783
- this.checkOutdent = function(line, input) {
784
- if (! /^\s+$/.test(line))
785
- return false;
786
-
787
- return /^\s*\}/.test(input);
788
- };
789
-
790
- this.autoOutdent = function(doc, row) {
791
- var line = doc.getLine(row);
792
- var match = line.match(/^(\s*\})/);
793
-
794
- if (!match) return 0;
795
-
796
- var column = match[1].length;
797
- var openBracePos = doc.findMatchingBracket({row: row, column: column});
798
-
799
- if (!openBracePos || openBracePos.row == row) return 0;
800
-
801
- var indent = this.$getIndent(doc.getLine(openBracePos.row));
802
- doc.replace(new Range(row, 0, row, column-1), indent);
803
- };
804
-
805
- this.$getIndent = function(line) {
806
- var match = line.match(/^(\s+)/);
807
- if (match) {
808
- return match[1];
809
- }
810
-
811
- return "";
812
- };
813
-
814
- }).call(MatchingBraceOutdent.prototype);
815
-
816
- exports.MatchingBraceOutdent = MatchingBraceOutdent;
817
- });
818
- /* vim:ts=4:sts=4:sw=4:
819
- * ***** BEGIN LICENSE BLOCK *****
820
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
821
- *
822
- * The contents of this file are subject to the Mozilla Public License Version
823
- * 1.1 (the "License"); you may not use this file except in compliance with
824
- * the License. You may obtain a copy of the License at
825
- * http://www.mozilla.org/MPL/
826
- *
827
- * Software distributed under the License is distributed on an "AS IS" basis,
828
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
829
- * for the specific language governing rights and limitations under the
830
- * License.
831
- *
832
- * The Original Code is Ajax.org Code Editor (ACE).
833
- *
834
- * The Initial Developer of the Original Code is
835
- * Ajax.org B.V.
836
- * Portions created by the Initial Developer are Copyright (C) 2010
837
- * the Initial Developer. All Rights Reserved.
838
- *
839
- * Contributor(s):
840
- * Chris Spencer <chris.ag.spencer AT googlemail DOT com>
841
- *
842
- * Alternatively, the contents of this file may be used under the terms of
843
- * either the GNU General Public License Version 2 or later (the "GPL"), or
844
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
845
- * in which case the provisions of the GPL or the LGPL are applicable instead
846
- * of those above. If you wish to allow use of your version of this file only
847
- * under the terms of either the GPL or the LGPL, and not to allow others to
848
- * use your version of this file under the terms of the MPL, indicate your
849
- * decision by deleting the provisions above and replace them with the notice
850
- * and other provisions required by the GPL or the LGPL. If you do not delete
851
- * the provisions above, a recipient may use your version of this file under
852
- * the terms of any one of the MPL, the GPL or the LGPL.
853
- *
854
- * ***** END LICENSE BLOCK ***** */
855
-
856
- define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
857
- "use strict";
858
-
859
- var oop = require("../../lib/oop");
860
- var Behaviour = require('../behaviour').Behaviour;
861
-
862
- var CstyleBehaviour = function () {
863
-
864
- this.add("braces", "insertion", function (state, action, editor, session, text) {
865
- if (text == '{') {
866
- var selection = editor.getSelectionRange();
867
- var selected = session.doc.getTextRange(selection);
868
- if (selected !== "") {
869
- return {
870
- text: '{' + selected + '}',
871
- selection: false
872
- };
873
- } else {
874
- return {
875
- text: '{}',
876
- selection: [1, 1]
877
- };
878
- }
879
- } else if (text == '}') {
880
- var cursor = editor.getCursorPosition();
881
- var line = session.doc.getLine(cursor.row);
882
- var rightChar = line.substring(cursor.column, cursor.column + 1);
883
- if (rightChar == '}') {
884
- var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
885
- if (matching !== null) {
886
- return {
887
- text: '',
888
- selection: [1, 1]
889
- };
890
- }
891
- }
892
- } else if (text == "\n") {
893
- var cursor = editor.getCursorPosition();
894
- var line = session.doc.getLine(cursor.row);
895
- var rightChar = line.substring(cursor.column, cursor.column + 1);
896
- if (rightChar == '}') {
897
- var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
898
- if (!openBracePos)
899
- return null;
900
-
901
- var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
902
- var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
903
-
904
- return {
905
- text: '\n' + indent + '\n' + next_indent,
906
- selection: [1, indent.length, 1, indent.length]
907
- };
908
- }
909
- }
910
- });
911
-
912
- this.add("braces", "deletion", function (state, action, editor, session, range) {
913
- var selected = session.doc.getTextRange(range);
914
- if (!range.isMultiLine() && selected == '{') {
915
- var line = session.doc.getLine(range.start.row);
916
- var rightChar = line.substring(range.end.column, range.end.column + 1);
917
- if (rightChar == '}') {
918
- range.end.column++;
919
- return range;
920
- }
921
- }
922
- });
923
-
924
- this.add("parens", "insertion", function (state, action, editor, session, text) {
925
- if (text == '(') {
926
- var selection = editor.getSelectionRange();
927
- var selected = session.doc.getTextRange(selection);
928
- if (selected !== "") {
929
- return {
930
- text: '(' + selected + ')',
931
- selection: false
932
- };
933
- } else {
934
- return {
935
- text: '()',
936
- selection: [1, 1]
937
- };
938
- }
939
- } else if (text == ')') {
940
- var cursor = editor.getCursorPosition();
941
- var line = session.doc.getLine(cursor.row);
942
- var rightChar = line.substring(cursor.column, cursor.column + 1);
943
- if (rightChar == ')') {
944
- var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
945
- if (matching !== null) {
946
- return {
947
- text: '',
948
- selection: [1, 1]
949
- };
950
- }
951
- }
952
- }
953
- });
954
-
955
- this.add("parens", "deletion", function (state, action, editor, session, range) {
956
- var selected = session.doc.getTextRange(range);
957
- if (!range.isMultiLine() && selected == '(') {
958
- var line = session.doc.getLine(range.start.row);
959
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
960
- if (rightChar == ')') {
961
- range.end.column++;
962
- return range;
963
- }
964
- }
965
- });
966
-
967
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
968
- if (text == '"' || text == "'") {
969
- var quote = text;
970
- var selection = editor.getSelectionRange();
971
- var selected = session.doc.getTextRange(selection);
972
- if (selected !== "") {
973
- return {
974
- text: quote + selected + quote,
975
- selection: false
976
- };
977
- } else {
978
- var cursor = editor.getCursorPosition();
979
- var line = session.doc.getLine(cursor.row);
980
- var leftChar = line.substring(cursor.column-1, cursor.column);
981
-
982
- // We're escaped.
983
- if (leftChar == '\\') {
984
- return null;
985
- }
986
-
987
- // Find what token we're inside.
988
- var tokens = session.getTokens(selection.start.row, selection.start.row)[0].tokens;
989
- var col = 0, token;
990
- var quotepos = -1; // Track whether we're inside an open quote.
991
-
992
- for (var x = 0; x < tokens.length; x++) {
993
- token = tokens[x];
994
- if (token.type == "string") {
995
- quotepos = -1;
996
- } else if (quotepos < 0) {
997
- quotepos = token.value.indexOf(quote);
998
- }
999
- if ((token.value.length + col) > selection.start.column) {
1000
- break;
1001
- }
1002
- col += tokens[x].value.length;
1003
- }
1004
-
1005
- // Try and be smart about when we auto insert.
1006
- 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)))) {
1007
- return {
1008
- text: quote + quote,
1009
- selection: [1,1]
1010
- };
1011
- } else if (token && token.type === "string") {
1012
- // Ignore input and move right one if we're typing over the closing quote.
1013
- var rightChar = line.substring(cursor.column, cursor.column + 1);
1014
- if (rightChar == quote) {
1015
- return {
1016
- text: '',
1017
- selection: [1, 1]
1018
- };
1019
- }
1020
- }
1021
- }
1022
- }
1023
- });
1024
-
1025
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
1026
- var selected = session.doc.getTextRange(range);
1027
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
1028
- var line = session.doc.getLine(range.start.row);
1029
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1030
- if (rightChar == '"') {
1031
- range.end.column++;
1032
- return range;
1033
- }
1034
- }
1035
- });
1036
-
1037
- };
1038
-
1039
- oop.inherits(CstyleBehaviour, Behaviour);
1040
-
1041
- exports.CstyleBehaviour = CstyleBehaviour;
1042
- });
1043
- /* ***** BEGIN LICENSE BLOCK *****
1044
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1045
- *
1046
- * The contents of this file are subject to the Mozilla Public License Version
1047
- * 1.1 (the "License"); you may not use this file except in compliance with
1048
- * the License. You may obtain a copy of the License at
1049
- * http://www.mozilla.org/MPL/
1050
- *
1051
- * Software distributed under the License is distributed on an "AS IS" basis,
1052
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1053
- * for the specific language governing rights and limitations under the
1054
- * License.
1055
- *
1056
- * The Original Code is Ajax.org Code Editor (ACE).
1057
- *
1058
- * The Initial Developer of the Original Code is
1059
- * Ajax.org B.V.
1060
- * Portions created by the Initial Developer are Copyright (C) 2010
1061
- * the Initial Developer. All Rights Reserved.
1062
- *
1063
- * Contributor(s):
1064
- * Fabian Jakobs <fabian AT ajax DOT org>
1065
- *
1066
- * Alternatively, the contents of this file may be used under the terms of
1067
- * either the GNU General Public License Version 2 or later (the "GPL"), or
1068
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1069
- * in which case the provisions of the GPL or the LGPL are applicable instead
1070
- * of those above. If you wish to allow use of your version of this file only
1071
- * under the terms of either the GPL or the LGPL, and not to allow others to
1072
- * use your version of this file under the terms of the MPL, indicate your
1073
- * decision by deleting the provisions above and replace them with the notice
1074
- * and other provisions required by the GPL or the LGPL. If you do not delete
1075
- * the provisions above, a recipient may use your version of this file under
1076
- * the terms of any one of the MPL, the GPL or the LGPL.
1077
- *
1078
- * ***** END LICENSE BLOCK ***** */
1079
-
1080
- define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
1081
- "use strict";
1082
-
1083
- var oop = require("../../lib/oop");
1084
- var Range = require("../../range").Range;
1085
- var BaseFoldMode = require("./fold_mode").FoldMode;
1086
-
1087
- var FoldMode = exports.FoldMode = function() {};
1088
- oop.inherits(FoldMode, BaseFoldMode);
1089
-
1090
- (function() {
1091
-
1092
- this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
1093
- this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
1094
-
1095
- this.getFoldWidgetRange = function(session, foldStyle, row) {
1096
- var line = session.getLine(row);
1097
- var match = line.match(this.foldingStartMarker);
1098
- if (match) {
1099
- var i = match.index;
1100
-
1101
- if (match[1])
1102
- return this.openingBracketBlock(session, match[1], row, i);
1103
-
1104
- var range = session.getCommentFoldRange(row, i + match[0].length);
1105
- range.end.column -= 2;
1106
- return range;
1107
- }
1108
-
1109
- if (foldStyle !== "markbeginend")
1110
- return;
1111
-
1112
- var match = line.match(this.foldingStopMarker);
1113
- if (match) {
1114
- var i = match.index + match[0].length;
1115
-
1116
- if (match[2]) {
1117
- var range = session.getCommentFoldRange(row, i);
1118
- range.end.column -= 2;
1119
- return range;
1120
- }
1121
-
1122
- var end = {row: row, column: i};
1123
- var start = session.$findOpeningBracket(match[1], end);
1124
-
1125
- if (!start)
1126
- return;
1127
-
1128
- start.column++;
1129
- end.column--;
1130
-
1131
- return Range.fromPoints(start, end);
1132
- }
1133
- };
1134
-
1135
- }).call(FoldMode.prototype);
1136
-
1137
- });
1138
- /* ***** BEGIN LICENSE BLOCK *****
1139
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1140
- *
1141
- * The contents of this file are subject to the Mozilla Public License Version
1142
- * 1.1 (the "License"); you may not use this file except in compliance with
1143
- * the License. You may obtain a copy of the License at
1144
- * http://www.mozilla.org/MPL/
1145
- *
1146
- * Software distributed under the License is distributed on an "AS IS" basis,
1147
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1148
- * for the specific language governing rights and limitations under the
1149
- * License.
1150
- *
1151
- * The Original Code is Ajax.org Code Editor (ACE).
1152
- *
1153
- * The Initial Developer of the Original Code is
1154
- * Ajax.org B.V.
1155
- * Portions created by the Initial Developer are Copyright (C) 2010
1156
- * the Initial Developer. All Rights Reserved.
1157
- *
1158
- * Contributor(s):
1159
- * Fabian Jakobs <fabian AT ajax DOT org>
1160
- *
1161
- * Alternatively, the contents of this file may be used under the terms of
1162
- * either the GNU General Public License Version 2 or later (the "GPL"), or
1163
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1164
- * in which case the provisions of the GPL or the LGPL are applicable instead
1165
- * of those above. If you wish to allow use of your version of this file only
1166
- * under the terms of either the GPL or the LGPL, and not to allow others to
1167
- * use your version of this file under the terms of the MPL, indicate your
1168
- * decision by deleting the provisions above and replace them with the notice
1169
- * and other provisions required by the GPL or the LGPL. If you do not delete
1170
- * the provisions above, a recipient may use your version of this file under
1171
- * the terms of any one of the MPL, the GPL or the LGPL.
1172
- *
1173
- * ***** END LICENSE BLOCK ***** */
1174
-
1175
- define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
1176
- "use strict";
1177
-
1178
- var Range = require("../../range").Range;
1179
-
1180
- var FoldMode = exports.FoldMode = function() {};
1181
-
1182
- (function() {
1183
-
1184
- this.foldingStartMarker = null;
1185
- this.foldingStopMarker = null;
1186
-
1187
- // must return "" if there's no fold, to enable caching
1188
- this.getFoldWidget = function(session, foldStyle, row) {
1189
- var line = session.getLine(row);
1190
- if (this.foldingStartMarker.test(line))
1191
- return "start";
1192
- if (foldStyle == "markbeginend"
1193
- && this.foldingStopMarker
1194
- && this.foldingStopMarker.test(line))
1195
- return "end";
1196
- return "";
1197
- };
1198
-
1199
- this.getFoldWidgetRange = function(session, foldStyle, row) {
1200
- return null;
1201
- };
1202
-
1203
- this.indentationBlock = function(session, row, column) {
1204
- var re = /^\s*/;
1205
- var startRow = row;
1206
- var endRow = row;
1207
- var line = session.getLine(row);
1208
- var startColumn = column || line.length;
1209
- var startLevel = line.match(re)[0].length;
1210
- var maxRow = session.getLength()
1211
-
1212
- while (++row < maxRow) {
1213
- line = session.getLine(row);
1214
- var level = line.match(re)[0].length;
1215
-
1216
- if (level == line.length)
1217
- continue;
1218
-
1219
- if (level <= startLevel)
1220
- break;
1221
-
1222
- endRow = row;
1223
- }
1224
-
1225
- if (endRow > startRow) {
1226
- var endColumn = session.getLine(endRow).length;
1227
- return new Range(startRow, startColumn, endRow, endColumn);
1228
- }
1229
- };
1230
-
1231
- this.openingBracketBlock = function(session, bracket, row, column) {
1232
- var start = {row: row, column: column + 1};
1233
- var end = session.$findClosingBracket(bracket, start);
1234
- if (!end)
1235
- return;
1236
-
1237
- var fw = session.foldWidgets[end.row];
1238
- if (fw == null)
1239
- fw = this.getFoldWidget(session, end.row);
1240
-
1241
- if (fw == "start") {
1242
- end.row --;
1243
- end.column = session.getLine(end.row).length;
1244
- }
1245
- return Range.fromPoints(start, end);
1246
- };
1247
-
1248
- }).call(FoldMode.prototype);
1249
-
1250
- });
1251
- define('ace/mode/groovy_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) {
1252
- "use strict";
1253
-
1254
- var oop = require("../lib/oop");
1255
- var lang = require("../lib/lang");
1256
- var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
1257
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1258
-
1259
- var GroovyHighlightRules = function() {
1260
-
1261
- var keywords = lang.arrayToMap(
1262
- ("assert|with|abstract|continue|for|new|switch|" +
1263
- "assert|default|goto|package|synchronized|" +
1264
- "boolean|do|if|private|this|" +
1265
- "break|double|implements|protected|throw|" +
1266
- "byte|else|import|public|throws|" +
1267
- "case|enum|instanceof|return|transient|" +
1268
- "catch|extends|int|short|try|" +
1269
- "char|final|interface|static|void|" +
1270
- "class|finally|long|strictfp|volatile|" +
1271
- "def|float|native|super|while").split("|")
1272
- );
1273
-
1274
- var buildinConstants = lang.arrayToMap(
1275
- ("null|Infinity|NaN|undefined").split("|")
1276
- );
1277
-
1278
- var langClasses = lang.arrayToMap(
1279
- ("AbstractMethodError|AssertionError|ClassCircularityError|"+
1280
- "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+
1281
- "ExceptionInInitializerError|IllegalAccessError|"+
1282
- "IllegalThreadStateException|InstantiationError|InternalError|"+
1283
- "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+
1284
- "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+
1285
- "SuppressWarnings|TypeNotPresentException|UnknownError|"+
1286
- "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+
1287
- "InstantiationException|IndexOutOfBoundsException|"+
1288
- "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+
1289
- "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+
1290
- "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+
1291
- "InterruptedException|NoSuchMethodException|IllegalAccessException|"+
1292
- "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+
1293
- "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+
1294
- "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+
1295
- "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+
1296
- "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+
1297
- "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+
1298
- "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+
1299
- "ArrayStoreException|ClassCastException|LinkageError|"+
1300
- "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+
1301
- "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+
1302
- "Cloneable|Class|CharSequence|Comparable|String|Object").split("|")
1303
- );
1304
-
1305
- var importClasses = lang.arrayToMap(
1306
- ("").split("|")
1307
- );
1308
- // regexp must not have capturing parentheses. Use (?:) instead.
1309
- // regexps are ordered -> the first match is used
1310
-
1311
- this.$rules = {
1312
- "start" : [
1313
- {
1314
- token : "comment",
1315
- regex : "\\/\\/.*$"
1316
- },
1317
- DocCommentHighlightRules.getStartRule("doc-start"),
1318
- {
1319
- token : "comment", // multi line comment
1320
- merge : true,
1321
- regex : "\\/\\*",
1322
- next : "comment"
1323
- }, {
1324
- token : "string.regexp",
1325
- regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
1326
- }, {
1327
- token : "string", // single line
1328
- regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
1329
- }, {
1330
- token : "string", // single line
1331
- regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
1332
- }, {
1333
- token : "constant.numeric", // hex
1334
- regex : "0[xX][0-9a-fA-F]+\\b"
1335
- }, {
1336
- token : "constant.numeric", // float
1337
- regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
1338
- }, {
1339
- token : "constant.language.boolean",
1340
- regex : "(?:true|false)\\b"
1341
- }, {
1342
- token : function(value) {
1343
- if (value == "this")
1344
- return "variable.language";
1345
- else if (keywords.hasOwnProperty(value))
1346
- return "keyword";
1347
- else if (langClasses.hasOwnProperty(value))
1348
- return "support.function";
1349
- else if (importClasses.hasOwnProperty(value))
1350
- return "support.function";
1351
- else if (buildinConstants.hasOwnProperty(value))
1352
- return "constant.language";
1353
- else
1354
- return "identifier";
1355
- },
1356
- // TODO: Unicode escape sequences
1357
- // TODO: Unicode identifiers
1358
- regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
1359
- }, {
1360
- token : "keyword.operator",
1361
- regex : "\\?:|\\?\\.|\\*\\.|<=>|=~|==~|\\.@|\\*\\.@|\\.&|as|in|is|!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
1362
- }, {
1363
- token : "lparen",
1364
- regex : "[[({]"
1365
- }, {
1366
- token : "rparen",
1367
- regex : "[\\])}]"
1368
- }, {
1369
- token : "text",
1370
- regex : "\\s+"
1371
- }
1372
- ],
1373
- "comment" : [
1374
- {
1375
- token : "comment", // closing comment
1376
- regex : ".*?\\*\\/",
1377
- next : "start"
1378
- }, {
1379
- token : "comment", // comment spanning whole line
1380
- merge : true,
1381
- regex : ".+"
1382
- }
1383
- ]
1384
- };
1385
-
1386
- this.embedRules(DocCommentHighlightRules, "doc-",
1387
- [ DocCommentHighlightRules.getEndRule("start") ]);
1388
- };
1389
-
1390
- oop.inherits(GroovyHighlightRules, TextHighlightRules);
1391
-
1392
- exports.GroovyHighlightRules = GroovyHighlightRules;
1393
- });