ace-rails-ap 4.3 → 4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (249) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -2
  3. data/ace-rails-ap.gemspec +0 -2
  4. data/lib/ace/rails/version.rb +1 -1
  5. data/vendor/assets/javascripts/ace/ace.js +659 -1137
  6. data/vendor/assets/javascripts/ace/ext-beautify.js +5 -2
  7. data/vendor/assets/javascripts/ace/ext-code_lens.js +238 -0
  8. data/vendor/assets/javascripts/ace/ext-emmet.js +36 -28
  9. data/vendor/assets/javascripts/ace/ext-language_tools.js +63 -48
  10. data/vendor/assets/javascripts/ace/ext-modelist.js +12 -6
  11. data/vendor/assets/javascripts/ace/ext-options.js +46 -19
  12. data/vendor/assets/javascripts/ace/ext-prompt.js +57 -38
  13. data/vendor/assets/javascripts/ace/ext-settings_menu.js +46 -19
  14. data/vendor/assets/javascripts/ace/ext-spellcheck.js +0 -1
  15. data/vendor/assets/javascripts/ace/ext-themelist.js +2 -1
  16. data/vendor/assets/javascripts/ace/keybinding-emacs.js +21 -22
  17. data/vendor/assets/javascripts/ace/keybinding-sublime.js +2 -5
  18. data/vendor/assets/javascripts/ace/keybinding-vim.js +45 -9
  19. data/vendor/assets/javascripts/ace/keybinding-vscode.js +262 -0
  20. data/vendor/assets/javascripts/ace/mode-abc.js +3 -0
  21. data/vendor/assets/javascripts/ace/mode-actionscript.js +1 -0
  22. data/vendor/assets/javascripts/ace/mode-alda.js +311 -0
  23. data/vendor/assets/javascripts/ace/mode-asl.js +17 -16
  24. data/vendor/assets/javascripts/ace/mode-c_cpp.js +1 -0
  25. data/vendor/assets/javascripts/ace/mode-clojure.js +1 -0
  26. data/vendor/assets/javascripts/ace/mode-coffee.js +1 -0
  27. data/vendor/assets/javascripts/ace/mode-coldfusion.js +3 -0
  28. data/vendor/assets/javascripts/ace/mode-csound_document.js +40 -5
  29. data/vendor/assets/javascripts/ace/mode-csound_orchestra.js +37 -5
  30. data/vendor/assets/javascripts/ace/mode-csound_score.js +1 -0
  31. data/vendor/assets/javascripts/ace/mode-css.js +1 -0
  32. data/vendor/assets/javascripts/ace/mode-curly.js +3 -0
  33. data/vendor/assets/javascripts/ace/mode-d.js +1 -1
  34. data/vendor/assets/javascripts/ace/mode-dart.js +2 -0
  35. data/vendor/assets/javascripts/ace/mode-diff.js +1 -0
  36. data/vendor/assets/javascripts/ace/mode-django.js +4 -0
  37. data/vendor/assets/javascripts/ace/mode-dockerfile.js +1 -0
  38. data/vendor/assets/javascripts/ace/mode-drools.js +1 -0
  39. data/vendor/assets/javascripts/ace/mode-edifact.js +1 -0
  40. data/vendor/assets/javascripts/ace/mode-ejs.js +673 -165
  41. data/vendor/assets/javascripts/ace/mode-erlang.js +1 -0
  42. data/vendor/assets/javascripts/ace/mode-fsl.js +1 -0
  43. data/vendor/assets/javascripts/ace/mode-glsl.js +1 -0
  44. data/vendor/assets/javascripts/ace/mode-gobstones.js +2 -0
  45. data/vendor/assets/javascripts/ace/mode-graphqlschema.js +1 -0
  46. data/vendor/assets/javascripts/ace/mode-groovy.js +1 -0
  47. data/vendor/assets/javascripts/ace/mode-haml.js +419 -104
  48. data/vendor/assets/javascripts/ace/mode-handlebars.js +3 -0
  49. data/vendor/assets/javascripts/ace/mode-haskell.js +1 -0
  50. data/vendor/assets/javascripts/ace/mode-html.js +3 -0
  51. data/vendor/assets/javascripts/ace/mode-html_elixir.js +3 -0
  52. data/vendor/assets/javascripts/ace/mode-html_ruby.js +673 -165
  53. data/vendor/assets/javascripts/ace/mode-io.js +1 -0
  54. data/vendor/assets/javascripts/ace/mode-java.js +2 -0
  55. data/vendor/assets/javascripts/ace/mode-javascript.js +1 -0
  56. data/vendor/assets/javascripts/ace/mode-json.js +3 -0
  57. data/vendor/assets/javascripts/ace/mode-json5.js +360 -0
  58. data/vendor/assets/javascripts/ace/mode-jsoniq.js +1 -0
  59. data/vendor/assets/javascripts/ace/mode-jsp.js +1 -0
  60. data/vendor/assets/javascripts/ace/mode-kotlin.js +2 -0
  61. data/vendor/assets/javascripts/ace/mode-liquid.js +4 -0
  62. data/vendor/assets/javascripts/ace/mode-lsl.js +1 -0
  63. data/vendor/assets/javascripts/ace/mode-lua.js +1 -0
  64. data/vendor/assets/javascripts/ace/mode-luapage.js +4 -0
  65. data/vendor/assets/javascripts/ace/mode-makefile.js +1 -0
  66. data/vendor/assets/javascripts/ace/mode-markdown.js +5 -0
  67. data/vendor/assets/javascripts/ace/mode-maze.js +1 -0
  68. data/vendor/assets/javascripts/ace/mode-mediawiki.js +592 -0
  69. data/vendor/assets/javascripts/ace/mode-nix.js +1 -0
  70. data/vendor/assets/javascripts/ace/mode-nsis.js +1 -1
  71. data/vendor/assets/javascripts/ace/mode-nunjucks.js +2698 -0
  72. data/vendor/assets/javascripts/ace/mode-perl.js +1 -0
  73. data/vendor/assets/javascripts/ace/mode-pgsql.js +2 -2
  74. data/vendor/assets/javascripts/ace/mode-php.js +4 -0
  75. data/vendor/assets/javascripts/ace/mode-php_laravel_blade.js +4 -0
  76. data/vendor/assets/javascripts/ace/mode-prisma.js +489 -0
  77. data/vendor/assets/javascripts/ace/mode-protobuf.js +1 -0
  78. data/vendor/assets/javascripts/ace/mode-puppet.js +5 -6
  79. data/vendor/assets/javascripts/ace/mode-python.js +3 -2
  80. data/vendor/assets/javascripts/ace/mode-qml.js +381 -0
  81. data/vendor/assets/javascripts/ace/mode-r.js +1 -0
  82. data/vendor/assets/javascripts/ace/mode-razor.js +4 -0
  83. data/vendor/assets/javascripts/ace/mode-rhtml.js +3 -0
  84. data/vendor/assets/javascripts/ace/mode-rst.js +1 -0
  85. data/vendor/assets/javascripts/ace/mode-ruby.js +670 -165
  86. data/vendor/assets/javascripts/ace/mode-rust.js +1 -1
  87. data/vendor/assets/javascripts/ace/mode-scala.js +1 -0
  88. data/vendor/assets/javascripts/ace/mode-sh.js +1 -0
  89. data/vendor/assets/javascripts/ace/mode-sjs.js +1 -0
  90. data/vendor/assets/javascripts/ace/mode-slim.js +708 -110
  91. data/vendor/assets/javascripts/ace/mode-smarty.js +3 -0
  92. data/vendor/assets/javascripts/ace/mode-snippets.js +1 -0
  93. data/vendor/assets/javascripts/ace/mode-soy_template.js +3 -0
  94. data/vendor/assets/javascripts/ace/mode-sql.js +1 -0
  95. data/vendor/assets/javascripts/ace/mode-sqlserver.js +2 -1
  96. data/vendor/assets/javascripts/ace/mode-svg.js +1 -0
  97. data/vendor/assets/javascripts/ace/mode-swift.js +6 -0
  98. data/vendor/assets/javascripts/ace/mode-tcl.js +1 -0
  99. data/vendor/assets/javascripts/ace/mode-terraform.js +10 -7
  100. data/vendor/assets/javascripts/ace/mode-tex.js +1 -0
  101. data/vendor/assets/javascripts/ace/mode-textile.js +1 -0
  102. data/vendor/assets/javascripts/ace/mode-tsx.js +1 -0
  103. data/vendor/assets/javascripts/ace/mode-twig.js +3 -0
  104. data/vendor/assets/javascripts/ace/mode-typescript.js +1 -0
  105. data/vendor/assets/javascripts/ace/mode-vala.js +1 -0
  106. data/vendor/assets/javascripts/ace/mode-vbscript.js +444 -15
  107. data/vendor/assets/javascripts/ace/mode-velocity.js +4 -0
  108. data/vendor/assets/javascripts/ace/mode-vhdl.js +5 -6
  109. data/vendor/assets/javascripts/ace/mode-visualforce.js +3 -0
  110. data/vendor/assets/javascripts/ace/mode-wollok.js +2 -0
  111. data/vendor/assets/javascripts/ace/mode-xquery.js +1 -0
  112. data/vendor/assets/javascripts/ace/snippets/abap.js +1 -6
  113. data/vendor/assets/javascripts/ace/snippets/ada.js +1 -6
  114. data/vendor/assets/javascripts/ace/snippets/alda.js +9 -0
  115. data/vendor/assets/javascripts/ace/snippets/apache_conf.js +1 -6
  116. data/vendor/assets/javascripts/ace/snippets/apex.js +1 -6
  117. data/vendor/assets/javascripts/ace/snippets/applescript.js +1 -6
  118. data/vendor/assets/javascripts/ace/snippets/aql.js +1 -6
  119. data/vendor/assets/javascripts/ace/snippets/asciidoc.js +1 -6
  120. data/vendor/assets/javascripts/ace/snippets/asl.js +1 -5
  121. data/vendor/assets/javascripts/ace/snippets/assembly_x86.js +1 -6
  122. data/vendor/assets/javascripts/ace/snippets/autohotkey.js +1 -6
  123. data/vendor/assets/javascripts/ace/snippets/batchfile.js +1 -6
  124. data/vendor/assets/javascripts/ace/snippets/c9search.js +1 -6
  125. data/vendor/assets/javascripts/ace/snippets/cirru.js +1 -6
  126. data/vendor/assets/javascripts/ace/snippets/cobol.js +1 -6
  127. data/vendor/assets/javascripts/ace/snippets/coldfusion.js +1 -6
  128. data/vendor/assets/javascripts/ace/snippets/crystal.js +1 -6
  129. data/vendor/assets/javascripts/ace/snippets/csharp.js +1 -6
  130. data/vendor/assets/javascripts/ace/snippets/csound_score.js +1 -6
  131. data/vendor/assets/javascripts/ace/snippets/csp.js +1 -6
  132. data/vendor/assets/javascripts/ace/snippets/curly.js +1 -6
  133. data/vendor/assets/javascripts/ace/snippets/d.js +1 -6
  134. data/vendor/assets/javascripts/ace/snippets/dockerfile.js +1 -6
  135. data/vendor/assets/javascripts/ace/snippets/dot.js +1 -6
  136. data/vendor/assets/javascripts/ace/snippets/eiffel.js +1 -6
  137. data/vendor/assets/javascripts/ace/snippets/ejs.js +1 -6
  138. data/vendor/assets/javascripts/ace/snippets/elixir.js +1 -6
  139. data/vendor/assets/javascripts/ace/snippets/elm.js +1 -6
  140. data/vendor/assets/javascripts/ace/snippets/forth.js +1 -6
  141. data/vendor/assets/javascripts/ace/snippets/fortran.js +1 -6
  142. data/vendor/assets/javascripts/ace/snippets/fsharp.js +1 -6
  143. data/vendor/assets/javascripts/ace/snippets/ftl.js +1 -6
  144. data/vendor/assets/javascripts/ace/snippets/gcode.js +1 -6
  145. data/vendor/assets/javascripts/ace/snippets/gherkin.js +1 -6
  146. data/vendor/assets/javascripts/ace/snippets/gitignore.js +1 -6
  147. data/vendor/assets/javascripts/ace/snippets/glsl.js +1 -6
  148. data/vendor/assets/javascripts/ace/snippets/golang.js +1 -6
  149. data/vendor/assets/javascripts/ace/snippets/groovy.js +1 -6
  150. data/vendor/assets/javascripts/ace/snippets/handlebars.js +1 -6
  151. data/vendor/assets/javascripts/ace/snippets/haskell_cabal.js +1 -6
  152. data/vendor/assets/javascripts/ace/snippets/haxe.js +1 -6
  153. data/vendor/assets/javascripts/ace/snippets/hjson.js +1 -6
  154. data/vendor/assets/javascripts/ace/snippets/html_elixir.js +1 -6
  155. data/vendor/assets/javascripts/ace/snippets/html_ruby.js +1 -6
  156. data/vendor/assets/javascripts/ace/snippets/ini.js +1 -6
  157. data/vendor/assets/javascripts/ace/snippets/jack.js +1 -6
  158. data/vendor/assets/javascripts/ace/snippets/jade.js +1 -6
  159. data/vendor/assets/javascripts/ace/snippets/json.js +1 -6
  160. data/vendor/assets/javascripts/ace/snippets/json5.js +9 -0
  161. data/vendor/assets/javascripts/ace/snippets/jssm.js +1 -6
  162. data/vendor/assets/javascripts/ace/snippets/jsx.js +1 -6
  163. data/vendor/assets/javascripts/ace/snippets/julia.js +1 -6
  164. data/vendor/assets/javascripts/ace/snippets/kotlin.js +1 -6
  165. data/vendor/assets/javascripts/ace/snippets/latex.js +1 -6
  166. data/vendor/assets/javascripts/ace/snippets/less.js +1 -6
  167. data/vendor/assets/javascripts/ace/snippets/lisp.js +1 -6
  168. data/vendor/assets/javascripts/ace/snippets/livescript.js +1 -6
  169. data/vendor/assets/javascripts/ace/snippets/logiql.js +1 -6
  170. data/vendor/assets/javascripts/ace/snippets/logtalk.js +1 -6
  171. data/vendor/assets/javascripts/ace/snippets/luapage.js +1 -6
  172. data/vendor/assets/javascripts/ace/snippets/lucene.js +1 -6
  173. data/vendor/assets/javascripts/ace/snippets/mask.js +1 -6
  174. data/vendor/assets/javascripts/ace/snippets/matlab.js +1 -6
  175. data/vendor/assets/javascripts/ace/snippets/mediawiki.js +9 -0
  176. data/vendor/assets/javascripts/ace/snippets/mel.js +1 -6
  177. data/vendor/assets/javascripts/ace/snippets/mixal.js +1 -6
  178. data/vendor/assets/javascripts/ace/snippets/mushcode.js +1 -6
  179. data/vendor/assets/javascripts/ace/snippets/mysql.js +1 -6
  180. data/vendor/assets/javascripts/ace/snippets/nginx.js +1 -6
  181. data/vendor/assets/javascripts/ace/snippets/nim.js +1 -6
  182. data/vendor/assets/javascripts/ace/snippets/nix.js +1 -6
  183. data/vendor/assets/javascripts/ace/snippets/nsis.js +1 -6
  184. data/vendor/assets/javascripts/ace/snippets/nunjucks.js +9 -0
  185. data/vendor/assets/javascripts/ace/snippets/objectivec.js +1 -6
  186. data/vendor/assets/javascripts/ace/snippets/ocaml.js +1 -6
  187. data/vendor/assets/javascripts/ace/snippets/pascal.js +1 -6
  188. data/vendor/assets/javascripts/ace/snippets/perl6.js +1 -6
  189. data/vendor/assets/javascripts/ace/snippets/pgsql.js +1 -6
  190. data/vendor/assets/javascripts/ace/snippets/php_laravel_blade.js +1 -6
  191. data/vendor/assets/javascripts/ace/snippets/pig.js +1 -6
  192. data/vendor/assets/javascripts/ace/snippets/plain_text.js +1 -6
  193. data/vendor/assets/javascripts/ace/snippets/powershell.js +1 -6
  194. data/vendor/assets/javascripts/ace/snippets/praat.js +1 -6
  195. data/vendor/assets/javascripts/ace/snippets/prisma.js +9 -0
  196. data/vendor/assets/javascripts/ace/snippets/prolog.js +1 -6
  197. data/vendor/assets/javascripts/ace/snippets/properties.js +1 -6
  198. data/vendor/assets/javascripts/ace/snippets/protobuf.js +1 -6
  199. data/vendor/assets/javascripts/ace/snippets/puppet.js +1 -6
  200. data/vendor/assets/javascripts/ace/snippets/qml.js +9 -0
  201. data/vendor/assets/javascripts/ace/snippets/rdoc.js +1 -6
  202. data/vendor/assets/javascripts/ace/snippets/red.js +1 -6
  203. data/vendor/assets/javascripts/ace/snippets/redshift.js +1 -6
  204. data/vendor/assets/javascripts/ace/snippets/rhtml.js +1 -6
  205. data/vendor/assets/javascripts/ace/snippets/rust.js +1 -6
  206. data/vendor/assets/javascripts/ace/snippets/sass.js +1 -6
  207. data/vendor/assets/javascripts/ace/snippets/scad.js +1 -6
  208. data/vendor/assets/javascripts/ace/snippets/scala.js +1 -6
  209. data/vendor/assets/javascripts/ace/snippets/scheme.js +1 -6
  210. data/vendor/assets/javascripts/ace/snippets/scss.js +1 -6
  211. data/vendor/assets/javascripts/ace/snippets/sjs.js +1 -6
  212. data/vendor/assets/javascripts/ace/snippets/slim.js +1 -6
  213. data/vendor/assets/javascripts/ace/snippets/smarty.js +1 -6
  214. data/vendor/assets/javascripts/ace/snippets/soy_template.js +1 -6
  215. data/vendor/assets/javascripts/ace/snippets/space.js +1 -6
  216. data/vendor/assets/javascripts/ace/snippets/sparql.js +1 -6
  217. data/vendor/assets/javascripts/ace/snippets/stylus.js +1 -6
  218. data/vendor/assets/javascripts/ace/snippets/svg.js +1 -6
  219. data/vendor/assets/javascripts/ace/snippets/swift.js +1 -6
  220. data/vendor/assets/javascripts/ace/snippets/terraform.js +1 -6
  221. data/vendor/assets/javascripts/ace/snippets/text.js +1 -6
  222. data/vendor/assets/javascripts/ace/snippets/toml.js +1 -6
  223. data/vendor/assets/javascripts/ace/snippets/tsx.js +1 -6
  224. data/vendor/assets/javascripts/ace/snippets/turtle.js +1 -6
  225. data/vendor/assets/javascripts/ace/snippets/twig.js +1 -6
  226. data/vendor/assets/javascripts/ace/snippets/typescript.js +1 -6
  227. data/vendor/assets/javascripts/ace/snippets/vbscript.js +1 -6
  228. data/vendor/assets/javascripts/ace/snippets/verilog.js +1 -6
  229. data/vendor/assets/javascripts/ace/snippets/vhdl.js +1 -6
  230. data/vendor/assets/javascripts/ace/snippets/visualforce.js +1 -6
  231. data/vendor/assets/javascripts/ace/snippets/xml.js +1 -6
  232. data/vendor/assets/javascripts/ace/snippets/yaml.js +1 -6
  233. data/vendor/assets/javascripts/ace/snippets/zeek.js +1 -6
  234. data/vendor/assets/javascripts/ace/theme-ambiance.js +3 -2
  235. data/vendor/assets/javascripts/ace/theme-chaos.js +1 -1
  236. data/vendor/assets/javascripts/ace/theme-nord_dark.js +102 -0
  237. data/vendor/assets/javascripts/ace/worker-base.js +1421 -0
  238. data/vendor/assets/javascripts/ace/worker-coffee.js +17 -703
  239. data/vendor/assets/javascripts/ace/worker-css.js +17 -703
  240. data/vendor/assets/javascripts/ace/worker-html.js +17 -703
  241. data/vendor/assets/javascripts/ace/worker-javascript.js +7833 -5352
  242. data/vendor/assets/javascripts/ace/worker-json.js +17 -703
  243. data/vendor/assets/javascripts/ace/worker-lua.js +17 -703
  244. data/vendor/assets/javascripts/ace/worker-php.js +857 -1475
  245. data/vendor/assets/javascripts/ace/worker-xml.js +26 -707
  246. data/vendor/assets/javascripts/ace/worker-xquery.js +17 -703
  247. metadata +18 -4
  248. data/vendor/assets/javascripts/ace/mode-bro.js +0 -334
  249. data/vendor/assets/javascripts/ace/snippets/bro.js +0 -14
@@ -784,6 +784,7 @@ oop.inherits(Mode, TextMode);
784
784
  };
785
785
 
786
786
  this.$id = "ace/mode/javascript";
787
+ this.snippetFileId = "ace/snippets/javascript";
787
788
  }).call(Mode.prototype);
788
789
 
789
790
  exports.Mode = Mode;
@@ -1316,6 +1317,7 @@ oop.inherits(Mode, TextMode);
1316
1317
  };
1317
1318
 
1318
1319
  this.$id = "ace/mode/css";
1320
+ this.snippetFileId = "ace/snippets/css";
1319
1321
  }).call(Mode.prototype);
1320
1322
 
1321
1323
  exports.Mode = Mode;
@@ -2493,6 +2495,7 @@ oop.inherits(Mode, TextMode);
2493
2495
  };
2494
2496
 
2495
2497
  this.$id = "ace/mode/html";
2498
+ this.snippetFileId = "ace/snippets/html";
2496
2499
  }).call(Mode.prototype);
2497
2500
 
2498
2501
  exports.Mode = Mode;
@@ -366,6 +366,7 @@ oop.inherits(Mode, TextMode);
366
366
  this.lineCommentStart = "--";
367
367
  this.blockComment = null;
368
368
  this.$id = "ace/mode/haskell";
369
+ this.snippetFileId = "ace/snippets/haskell";
369
370
  }).call(Mode.prototype);
370
371
 
371
372
  exports.Mode = Mode;
@@ -784,6 +784,7 @@ oop.inherits(Mode, TextMode);
784
784
  };
785
785
 
786
786
  this.$id = "ace/mode/javascript";
787
+ this.snippetFileId = "ace/snippets/javascript";
787
788
  }).call(Mode.prototype);
788
789
 
789
790
  exports.Mode = Mode;
@@ -1316,6 +1317,7 @@ oop.inherits(Mode, TextMode);
1316
1317
  };
1317
1318
 
1318
1319
  this.$id = "ace/mode/css";
1320
+ this.snippetFileId = "ace/snippets/css";
1319
1321
  }).call(Mode.prototype);
1320
1322
 
1321
1323
  exports.Mode = Mode;
@@ -2493,6 +2495,7 @@ oop.inherits(Mode, TextMode);
2493
2495
  };
2494
2496
 
2495
2497
  this.$id = "ace/mode/html";
2498
+ this.snippetFileId = "ace/snippets/html";
2496
2499
  }).call(Mode.prototype);
2497
2500
 
2498
2501
  exports.Mode = Mode;
@@ -1704,6 +1704,7 @@ oop.inherits(Mode, TextMode);
1704
1704
  };
1705
1705
 
1706
1706
  this.$id = "ace/mode/javascript";
1707
+ this.snippetFileId = "ace/snippets/javascript";
1707
1708
  }).call(Mode.prototype);
1708
1709
 
1709
1710
  exports.Mode = Mode;
@@ -2041,6 +2042,7 @@ oop.inherits(Mode, TextMode);
2041
2042
  };
2042
2043
 
2043
2044
  this.$id = "ace/mode/css";
2045
+ this.snippetFileId = "ace/snippets/css";
2044
2046
  }).call(Mode.prototype);
2045
2047
 
2046
2048
  exports.Mode = Mode;
@@ -2933,6 +2935,7 @@ oop.inherits(Mode, TextMode);
2933
2935
  };
2934
2936
 
2935
2937
  this.$id = "ace/mode/html";
2938
+ this.snippetFileId = "ace/snippets/html";
2936
2939
  }).call(Mode.prototype);
2937
2940
 
2938
2941
  exports.Mode = Mode;
@@ -1012,17 +1012,17 @@ var constantOtherSymbol = exports.constantOtherSymbol = {
1012
1012
  regex : "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?"
1013
1013
  };
1014
1014
 
1015
- var qString = exports.qString = {
1015
+ exports.qString = {
1016
1016
  token : "string", // single line
1017
1017
  regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
1018
1018
  };
1019
1019
 
1020
- var qqString = exports.qqString = {
1020
+ exports.qqString = {
1021
1021
  token : "string", // single line
1022
1022
  regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
1023
1023
  };
1024
1024
 
1025
- var tString = exports.tString = {
1025
+ exports.tString = {
1026
1026
  token : "string", // backtick string
1027
1027
  regex : "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]"
1028
1028
  };
@@ -1032,9 +1032,34 @@ var constantNumericHex = exports.constantNumericHex = {
1032
1032
  regex : "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b"
1033
1033
  };
1034
1034
 
1035
+ var constantNumericBinary = exports.constantNumericBinary = {
1036
+ token: "constant.numeric",
1037
+ regex: /\b(0[bB][01](?:[01]|_(?=[01]))*)\b/
1038
+ };
1039
+
1040
+ var constantNumericDecimal = exports.constantNumericDecimal = {
1041
+ token: "constant.numeric",
1042
+ regex: /\b(0[dD](?:[1-9](?:[\d]|_(?=[\d]))*|0))\b/
1043
+ };
1044
+
1045
+ var constantNumericOctal = exports.constantNumericDecimal = {
1046
+ token: "constant.numeric",
1047
+ regex: /\b(0[oO]?(?:[1-7](?:[0-7]|_(?=[0-7]))*|0))\b/
1048
+ };
1049
+
1050
+ var constantNumericRational = exports.constantNumericRational = {
1051
+ token: "constant.numeric", //rational + complex
1052
+ regex: /\b([\d]+(?:[./][\d]+)?ri?)\b/
1053
+ };
1054
+
1055
+ var constantNumericComplex = exports.constantNumericComplex = {
1056
+ token: "constant.numeric", //simple complex numbers
1057
+ regex: /\b([\d]i)\b/
1058
+ };
1059
+
1035
1060
  var constantNumericFloat = exports.constantNumericFloat = {
1036
- token : "constant.numeric", // float
1037
- regex : "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?\\b"
1061
+ token : "constant.numeric", // float + complex
1062
+ regex : "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?i?\\b"
1038
1063
  };
1039
1064
 
1040
1065
  var instanceVariable = exports.instanceVariable = {
@@ -1074,18 +1099,19 @@ var RubyHighlightRules = function() {
1074
1099
  "filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" +
1075
1100
  "translate|localize|extract_locale_from_tld|caches_page|expire_page|caches_action|expire_action|" +
1076
1101
  "cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" +
1077
- "has_many|has_one|belongs_to|has_and_belongs_to_many"
1102
+ "has_many|has_one|belongs_to|has_and_belongs_to_many|p|warn|refine|using|module_function|extend|alias_method|" +
1103
+ "private_class_method|remove_method|undef_method"
1078
1104
  );
1079
1105
 
1080
1106
  var keywords = (
1081
1107
  "alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" +
1082
1108
  "__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" +
1083
- "redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield"
1109
+ "redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield|__ENCODING__|prepend"
1084
1110
  );
1085
1111
 
1086
1112
  var buildinConstants = (
1087
1113
  "true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" +
1088
- "RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING"
1114
+ "RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING|RUBY_PATCHLEVEL|RUBY_REVISION|RUBY_COPYRIGHT|RUBY_ENGINE|RUBY_ENGINE_VERSION|RUBY_DESCRIPTION"
1089
1115
  );
1090
1116
 
1091
1117
  var builtinVariables = (
@@ -1101,126 +1127,191 @@ var RubyHighlightRules = function() {
1101
1127
  "invalid.deprecated": "debugger" // TODO is this a remnant from js mode?
1102
1128
  }, "identifier");
1103
1129
 
1130
+ var escapedChars = "\\\\(?:n(?:[1-7][0-7]{0,2}|0)|[nsrtvfbae'\"\\\\]|c(?:\\\\M-)?.|M-(?:\\\\C-|\\\\c)?.|C-(?:\\\\M-)?.|[0-7]{3}|x[\\da-fA-F]{2}|u[\\da-fA-F]{4}|u{[\\da-fA-F]{1,6}(?:\\s[\\da-fA-F]{1,6})*})";
1131
+
1132
+ var closeParen = {
1133
+ "(": ")",
1134
+ "[": "]",
1135
+ "{": "}",
1136
+ "<": ">",
1137
+ "^": "^",
1138
+ "|": "|",
1139
+ "%": "%"
1140
+ };
1141
+
1104
1142
  this.$rules = {
1105
- "start" : [
1143
+ "start": [
1106
1144
  {
1107
- token : "comment",
1108
- regex : "#.*$"
1145
+ token: "comment",
1146
+ regex: "#.*$"
1109
1147
  }, {
1110
- token : "comment", // multi line comment
1111
- regex : "^=begin(?:$|\\s.*$)",
1112
- next : "comment"
1148
+ token: "comment.multiline", // multi line comment
1149
+ regex: "^=begin(?=$|\\s.*$)",
1150
+ next: "comment"
1113
1151
  }, {
1114
- token : "string.regexp",
1115
- regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
1152
+ token: "string.regexp",
1153
+ regex: /[/](?=.*\/)/,
1154
+ next: "regex"
1116
1155
  },
1117
1156
 
1118
1157
  [{
1119
- regex: "[{}]", onMatch: function(val, state, stack) {
1120
- this.next = val == "{" ? this.nextState : "";
1121
- if (val == "{" && stack.length) {
1122
- stack.unshift("start", state);
1123
- return "paren.lparen";
1124
- }
1125
- if (val == "}" && stack.length) {
1126
- stack.shift();
1127
- this.next = stack.shift();
1128
- if (this.next.indexOf("string") != -1)
1129
- return "paren.end";
1130
- }
1131
- return val == "{" ? "paren.lparen" : "paren.rparen";
1132
- },
1133
- nextState: "start"
1134
- }, {
1135
- token : "string.start",
1136
- regex : /"/,
1137
- push : [{
1138
- token : "constant.language.escape",
1139
- regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/
1158
+ token: ["constant.other.symbol.ruby", "string.start"],
1159
+ regex: /(:)?(")/,
1160
+ push: [{
1161
+ token: "constant.language.escape",
1162
+ regex: escapedChars
1140
1163
  }, {
1141
- token : "paren.start",
1142
- regex : /#{/,
1143
- push : "start"
1164
+ token: "paren.start",
1165
+ regex: /#{/,
1166
+ push: "start"
1144
1167
  }, {
1145
- token : "string.end",
1146
- regex : /"/,
1147
- next : "pop"
1168
+ token: "string.end",
1169
+ regex: /"/,
1170
+ next: "pop"
1148
1171
  }, {
1149
1172
  defaultToken: "string"
1150
1173
  }]
1151
1174
  }, {
1152
- token : "string.start",
1153
- regex : /`/,
1154
- push : [{
1155
- token : "constant.language.escape",
1156
- regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/
1175
+ token: "string.start",
1176
+ regex: /`/,
1177
+ push: [{
1178
+ token: "constant.language.escape",
1179
+ regex: escapedChars
1157
1180
  }, {
1158
- token : "paren.start",
1159
- regex : /#{/,
1160
- push : "start"
1181
+ token: "paren.start",
1182
+ regex: /#{/,
1183
+ push: "start"
1161
1184
  }, {
1162
- token : "string.end",
1163
- regex : /`/,
1164
- next : "pop"
1185
+ token: "string.end",
1186
+ regex: /`/,
1187
+ next: "pop"
1165
1188
  }, {
1166
1189
  defaultToken: "string"
1167
1190
  }]
1168
1191
  }, {
1169
- token : "string.start",
1170
- regex : /'/,
1171
- push : [{
1172
- token : "constant.language.escape",
1173
- regex : /\\['\\]/
1174
- }, {
1175
- token : "string.end",
1176
- regex : /'/,
1177
- next : "pop"
1192
+ token: ["constant.other.symbol.ruby", "string.start"],
1193
+ regex: /(:)?(')/,
1194
+ push: [{
1195
+ token: "constant.language.escape",
1196
+ regex: /\\['\\]/
1197
+ }, {
1198
+ token: "string.end",
1199
+ regex: /'/,
1200
+ next: "pop"
1178
1201
  }, {
1179
1202
  defaultToken: "string"
1180
1203
  }]
1204
+ }, {
1205
+ token: "string.start",//doesn't see any differences between strings and array of strings in highlighting
1206
+ regex: /%[qwx]([(\[<{^|%])/, onMatch: function (val, state, stack) {
1207
+ if (stack.length)
1208
+ stack = [];
1209
+ var paren = val[val.length - 1];
1210
+ stack.unshift(paren, state);
1211
+ this.next = "qStateWithoutInterpolation";
1212
+ return this.token;
1213
+ }
1214
+ }, {
1215
+ token: "string.start", //doesn't see any differences between strings and array of strings in highlighting
1216
+ regex: /%[QWX]?([(\[<{^|%])/, onMatch: function (val, state, stack) {
1217
+ if (stack.length)
1218
+ stack = [];
1219
+ var paren = val[val.length - 1];
1220
+ stack.unshift(paren, state);
1221
+ this.next = "qStateWithInterpolation";
1222
+ return this.token;
1223
+ }
1224
+ }, {
1225
+ token: "constant.other.symbol.ruby", //doesn't see any differences between symbols and array of symbols in highlighting
1226
+ regex: /%[si]([(\[<{^|%])/, onMatch: function (val, state, stack) {
1227
+ if (stack.length)
1228
+ stack = [];
1229
+ var paren = val[val.length - 1];
1230
+ stack.unshift(paren, state);
1231
+ this.next = "sStateWithoutInterpolation";
1232
+ return this.token;
1233
+ }
1234
+ }, {
1235
+ token: "constant.other.symbol.ruby", //doesn't see any differences between symbols and array of symbols in highlighting
1236
+ regex: /%[SI]([(\[<{^|%])/, onMatch: function (val, state, stack) {
1237
+ if (stack.length)
1238
+ stack = [];
1239
+ var paren = val[val.length - 1];
1240
+ stack.unshift(paren, state);
1241
+ this.next = "sStateWithInterpolation";
1242
+ return this.token;
1243
+ }
1244
+ }, {
1245
+ token: "string.regexp",
1246
+ regex: /%[r]([(\[<{^|%])/, onMatch: function (val, state, stack) {
1247
+ if (stack.length)
1248
+ stack = [];
1249
+ var paren = val[val.length - 1];
1250
+ stack.unshift(paren, state);
1251
+ this.next = "rState";
1252
+ return this.token;
1253
+ }
1181
1254
  }],
1182
1255
 
1183
1256
  {
1184
- token : "text", // namespaces aren't symbols
1185
- regex : "::"
1257
+ token: "punctuation", // namespaces aren't symbols
1258
+ regex: "::"
1259
+ },
1260
+ instanceVariable,
1261
+ {
1262
+ token: "variable.global", // global variable
1263
+ regex: "[$][a-zA-Z_\\d]+"
1264
+ }, {
1265
+ token: "support.class", // class name
1266
+ regex: "[A-Z][a-zA-Z_\\d]*"
1186
1267
  }, {
1187
- token : "variable.instance", // instance variable
1188
- regex : "@{1,2}[a-zA-Z_\\d]+"
1268
+ token: ["punctuation.operator", "support.function"],
1269
+ regex: /(\.)([a-zA-Z_\d]+)(?=\()/
1189
1270
  }, {
1190
- token : "support.class", // class name
1191
- regex : "[A-Z][a-zA-Z_\\d]+"
1271
+ token: ["punctuation.operator", "identifier"],
1272
+ regex: /(\.)([a-zA-Z_][a-zA-Z_\d]*)/
1273
+ }, {
1274
+ token: "string.character",
1275
+ regex: "\\B\\?(?:" + escapedChars + "|\\S)"
1276
+ }, {
1277
+ token: "punctuation.operator",
1278
+ regex: /\?(?=.+:)/
1192
1279
  },
1193
1280
 
1281
+ constantNumericRational,
1282
+ constantNumericComplex,
1194
1283
  constantOtherSymbol,
1195
1284
  constantNumericHex,
1196
1285
  constantNumericFloat,
1197
-
1286
+ constantNumericBinary,
1287
+ constantNumericDecimal,
1288
+ constantNumericOctal,
1198
1289
  {
1199
- token : "constant.language.boolean",
1200
- regex : "(?:true|false)\\b"
1290
+ token: "constant.language.boolean",
1291
+ regex: "(?:true|false)\\b"
1201
1292
  }, {
1202
- token : keywordMapper,
1203
- regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
1293
+ token: keywordMapper,
1294
+ regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
1204
1295
  }, {
1205
- token : "punctuation.separator.key-value",
1206
- regex : "=>"
1296
+ token: "punctuation.separator.key-value",
1297
+ regex: "=>"
1207
1298
  }, {
1208
1299
  stateName: "heredoc",
1209
- onMatch : function(value, currentState, stack) {
1210
- var next = value[2] == '-' ? "indentedHeredoc" : "heredoc";
1300
+ onMatch: function (value, currentState, stack) {
1301
+ var next = (value[2] == '-' || value[2] == '~') ? "indentedHeredoc" : "heredoc";
1211
1302
  var tokens = value.split(this.splitRegex);
1212
1303
  stack.push(next, tokens[3]);
1213
1304
  return [
1214
- {type:"constant", value: tokens[1]},
1215
- {type:"string", value: tokens[2]},
1216
- {type:"support.class", value: tokens[3]},
1217
- {type:"string", value: tokens[4]}
1305
+ {type: "constant", value: tokens[1]},
1306
+ {type: "string", value: tokens[2]},
1307
+ {type: "support.class", value: tokens[3]},
1308
+ {type: "string", value: tokens[4]}
1218
1309
  ];
1219
1310
  },
1220
- regex : "(<<-?)(['\"`]?)([\\w]+)(['\"`]?)",
1311
+ regex: "(<<[-~]?)(['\"`]?)([\\w]+)(['\"`]?)",
1221
1312
  rules: {
1222
1313
  heredoc: [{
1223
- onMatch: function(value, currentState, stack) {
1314
+ onMatch: function(value, currentState, stack) {
1224
1315
  if (value === stack[1]) {
1225
1316
  stack.shift();
1226
1317
  stack.shift();
@@ -1237,7 +1328,7 @@ var RubyHighlightRules = function() {
1237
1328
  token: "string",
1238
1329
  regex: "^ +"
1239
1330
  }, {
1240
- onMatch: function(value, currentState, stack) {
1331
+ onMatch: function(value, currentState, stack) {
1241
1332
  if (value === stack[1]) {
1242
1333
  stack.shift();
1243
1334
  stack.shift();
@@ -1252,38 +1343,261 @@ var RubyHighlightRules = function() {
1252
1343
  }]
1253
1344
  }
1254
1345
  }, {
1255
- regex : "$",
1256
- token : "empty",
1257
- next : function(currentState, stack) {
1346
+ regex: "$",
1347
+ token: "empty",
1348
+ next: function(currentState, stack) {
1258
1349
  if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc")
1259
1350
  return stack[0];
1260
1351
  return currentState;
1261
1352
  }
1353
+ }, {
1354
+ token: "keyword.operator",
1355
+ regex: "!|\\$|%|&|\\*|/|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\||\\b(?:in|instanceof|new|delete|typeof|void)"
1356
+ }, {
1357
+ token: "paren.lparen",
1358
+ regex: "[[({]"
1359
+ }, {
1360
+ token: "paren.rparen",
1361
+ regex: "[\\])}]",
1362
+ onMatch: function(value, currentState, stack) {
1363
+ this.next = '';
1364
+ if (value == "}" && stack.length > 1 && stack[1] != "start") {
1365
+ stack.shift();
1366
+ this.next = stack.shift();
1367
+ }
1368
+ return this.token;
1369
+ }
1262
1370
  }, {
1263
- token : "string.character",
1264
- regex : "\\B\\?."
1371
+ token: "text",
1372
+ regex: "\\s+"
1265
1373
  }, {
1266
- token : "keyword.operator",
1267
- regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
1374
+ token: "punctuation.operator",
1375
+ regex: /[?:,;.]/
1376
+ }
1377
+ ],
1378
+ "comment": [
1379
+ {
1380
+ token: "comment.multiline", // closing comment
1381
+ regex: "^=end(?=$|\\s.*$)",
1382
+ next: "start"
1268
1383
  }, {
1269
- token : "paren.lparen",
1270
- regex : "[[({]"
1384
+ token: "comment", // comment spanning whole line
1385
+ regex: ".+"
1386
+ }
1387
+ ],
1388
+ "qStateWithInterpolation": [{
1389
+ token: "string.start",// excluded nested |^% due to difficulty in realization
1390
+ regex: /[(\[<{]/, onMatch: function (val, state, stack) {
1391
+ if (stack.length && val === stack[0]) {
1392
+ stack.unshift(val, state);
1393
+ return this.token;
1394
+ }
1395
+ return "string";
1396
+ }
1397
+ }, {
1398
+ token: "constant.language.escape",
1399
+ regex: escapedChars
1400
+ }, {
1401
+ token: "constant.language.escape",
1402
+ regex: /\\./
1403
+ }, {
1404
+ token: "paren.start",
1405
+ regex: /#{/,
1406
+ push: "start"
1407
+ }, {
1408
+ token: "string.end",
1409
+ regex: /[)\]>}^|%]/, onMatch: function (val, state, stack) {
1410
+ if (stack.length && val === closeParen[stack[0]]) {
1411
+ stack.shift();
1412
+ this.next = stack.shift();
1413
+ return this.token;
1414
+ }
1415
+ this.next = '';
1416
+ return "string";
1417
+ }
1418
+ }, {
1419
+ defaultToken: "string"
1420
+ }],
1421
+ "qStateWithoutInterpolation": [{
1422
+ token: "string.start",// excluded nested |^% due to difficulty in realization
1423
+ regex: /[(\[<{]/, onMatch: function (val, state, stack) {
1424
+ if (stack.length && val === stack[0]) {
1425
+ stack.unshift(val, state);
1426
+ return this.token;
1427
+ }
1428
+ return "string";
1429
+ }
1430
+ }, {
1431
+ token: "constant.language.escape",
1432
+ regex: /\\['\\]/
1433
+ }, {
1434
+ token: "constant.language.escape",
1435
+ regex: /\\./
1436
+ }, {
1437
+ token: "string.end",
1438
+ regex: /[)\]>}^|%]/, onMatch: function (val, state, stack) {
1439
+ if (stack.length && val === closeParen[stack[0]]) {
1440
+ stack.shift();
1441
+ this.next = stack.shift();
1442
+ return this.token;
1443
+ }
1444
+ this.next = '';
1445
+ return "string";
1446
+ }
1447
+ }, {
1448
+ defaultToken: "string"
1449
+ }],
1450
+ "sStateWithoutInterpolation": [{
1451
+ token: "constant.other.symbol.ruby",// excluded nested |^% due to difficulty in realization
1452
+ regex: /[(\[<{]/, onMatch: function (val, state, stack) {
1453
+ if (stack.length && val === stack[0]) {
1454
+ stack.unshift(val, state);
1455
+ return this.token;
1456
+ }
1457
+ return "constant.other.symbol.ruby";
1458
+ }
1459
+ }, {
1460
+ token: "constant.other.symbol.ruby",
1461
+ regex: /[)\]>}^|%]/, onMatch: function (val, state, stack) {
1462
+ if (stack.length && val === closeParen[stack[0]]) {
1463
+ stack.shift();
1464
+ this.next = stack.shift();
1465
+ return this.token;
1466
+ }
1467
+ this.next = '';
1468
+ return "constant.other.symbol.ruby";
1469
+ }
1470
+ }, {
1471
+ defaultToken: "constant.other.symbol.ruby"
1472
+ }],
1473
+ "sStateWithInterpolation": [{
1474
+ token: "constant.other.symbol.ruby",// excluded nested |^% due to difficulty in realization
1475
+ regex: /[(\[<{]/, onMatch: function (val, state, stack) {
1476
+ if (stack.length && val === stack[0]) {
1477
+ stack.unshift(val, state);
1478
+ return this.token;
1479
+ }
1480
+ return "constant.other.symbol.ruby";
1481
+ }
1482
+ }, {
1483
+ token: "constant.language.escape",
1484
+ regex: escapedChars
1485
+ }, {
1486
+ token: "constant.language.escape",
1487
+ regex: /\\./
1488
+ }, {
1489
+ token: "paren.start",
1490
+ regex: /#{/,
1491
+ push: "start"
1492
+ }, {
1493
+ token: "constant.other.symbol.ruby",
1494
+ regex: /[)\]>}^|%]/, onMatch: function (val, state, stack) {
1495
+ if (stack.length && val === closeParen[stack[0]]) {
1496
+ stack.shift();
1497
+ this.next = stack.shift();
1498
+ return this.token;
1499
+ }
1500
+ this.next = '';
1501
+ return "constant.other.symbol.ruby";
1502
+ }
1503
+ }, {
1504
+ defaultToken: "constant.other.symbol.ruby"
1505
+ }],
1506
+ "rState": [{
1507
+ token: "string.regexp",// excluded nested |^% due to difficulty in realization
1508
+ regex: /[(\[<{]/, onMatch: function (val, state, stack) {
1509
+ if (stack.length && val === stack[0]) {
1510
+ stack.unshift(val, state);
1511
+ return this.token;
1512
+ }
1513
+ return "constant.language.escape";
1514
+ }
1515
+ }, {
1516
+ token: "paren.start",
1517
+ regex: /#{/,
1518
+ push: "start"
1519
+ }, {
1520
+ token: "string.regexp",
1521
+ regex: /\//
1522
+ }, {
1523
+ token: "string.regexp",
1524
+ regex: /[)\]>}^|%][imxouesn]*/, onMatch: function (val, state, stack) {
1525
+ if (stack.length && val[0] === closeParen[stack[0]]) {
1526
+ stack.shift();
1527
+ this.next = stack.shift();
1528
+ return this.token;
1529
+ }
1530
+ this.next = '';
1531
+ return "constant.language.escape";
1532
+ }
1533
+ },
1534
+ {include: "regex"},
1535
+ {
1536
+ defaultToken: "string.regexp"
1537
+ }],
1538
+ "regex": [
1539
+ {// character classes
1540
+ token: "regexp.keyword",
1541
+ regex: /\\[wWdDhHsS]/
1271
1542
  }, {
1272
- token : "paren.rparen",
1273
- regex : "[\\])}]"
1543
+ token: "constant.language.escape",
1544
+ regex: /\\[AGbBzZ]/
1274
1545
  }, {
1275
- token : "text",
1276
- regex : "\\s+"
1546
+ token: "constant.language.escape",
1547
+ regex: /\\g<[a-zA-Z0-9]*>/
1548
+ }, {
1549
+ token: ["constant.language.escape", "regexp.keyword", "constant.language.escape"],
1550
+ regex: /(\\p{\^?)(Alnum|Alpha|Blank|Cntrl|Digit|Graph|Lower|Print|Punct|Space|Upper|XDigit|Word|ASCII|Any|Assigned|Arabic|Armenian|Balinese|Bengali|Bopomofo|Braille|Buginese|Buhid|Canadian_Aboriginal|Carian|Cham|Cherokee|Common|Coptic|Cuneiform|Cypriot|Cyrillic|Deseret|Devanagari|Ethiopic|Georgian|Glagolitic|Gothic|Greek|Gujarati|Gurmukhi|Han|Hangul|Hanunoo|Hebrew|Hiragana|Inherited|Kannada|Katakana|Kayah_Li|Kharoshthi|Khmer|Lao|Latin|Lepcha|Limbu|Linear_B|Lycian|Lydian|Malayalam|Mongolian|Myanmar|New_Tai_Lue|Nko|Ogham|Ol_Chiki|Old_Italic|Old_Persian|Oriya|Osmanya|Phags_Pa|Phoenician|Rejang|Runic|Saurashtra|Shavian|Sinhala|Sundanese|Syloti_Nagri|Syriac|Tagalog|Tagbanwa|Tai_Le|Tamil|Telugu|Thaana|Thai|Tibetan|Tifinagh|Ugaritic|Vai|Yi|Ll|Lm|Lt|Lu|Lo|Mn|Mc|Me|Nd|Nl|Pc|Pd|Ps|Pe|Pi|Pf|Po|No|Sm|Sc|Sk|So|Zs|Zl|Zp|Cc|Cf|Cn|Co|Cs|N|L|M|P|S|Z|C)(})/
1551
+ }, {
1552
+ token: ["constant.language.escape", "invalid", "constant.language.escape"],
1553
+ regex: /(\\p{\^?)([^/]*)(})/
1554
+ }, {// escapes
1555
+ token: "regexp.keyword.operator",
1556
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
1557
+ }, {// flag
1558
+ token: "string.regexp",
1559
+ regex: /[/][imxouesn]*/,
1560
+ next: "start"
1561
+ }, {// invalid operators
1562
+ token: "invalid",
1563
+ regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
1564
+ }, {// operators
1565
+ token: "constant.language.escape",
1566
+ regex: /\(\?(?:[:=!>]|<'?[a-zA-Z]*'?>|<[=!])|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
1567
+ }, {
1568
+ token: "constant.language.delimiter",
1569
+ regex: /\|/
1570
+ }, {
1571
+ token: "regexp.keyword",
1572
+ regex: /\[\[:(?:alnum|alpha|blank|cntrl|digit|graph|lower|print|punct|space|upper|xdigit|word|ascii):\]\]/
1573
+ }, {
1574
+ token: "constant.language.escape",
1575
+ regex: /\[\^?/,
1576
+ push: "regex_character_class"
1577
+ }, {
1578
+ defaultToken: "string.regexp"
1277
1579
  }
1278
1580
  ],
1279
- "comment" : [
1581
+ "regex_character_class": [
1280
1582
  {
1281
- token : "comment", // closing comment
1282
- regex : "^=end(?:$|\\s.*$)",
1283
- next : "start"
1583
+ token: "regexp.keyword",
1584
+ regex: /\\[wWdDhHsS]/
1585
+ }, {
1586
+ token: "regexp.charclass.keyword.operator",
1587
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
1588
+ }, {
1589
+ token: "constant.language.escape",
1590
+ regex: /&?&?\[\^?/,
1591
+ push: "regex_character_class"
1592
+ }, {
1593
+ token: "constant.language.escape",
1594
+ regex: "]",
1595
+ next: "pop"
1596
+ }, {
1597
+ token: "constant.language.escape",
1598
+ regex: "-"
1284
1599
  }, {
1285
- token : "comment", // comment spanning whole line
1286
- regex : ".+"
1600
+ defaultToken: "string.regexp.characterclass"
1287
1601
  }
1288
1602
  ]
1289
1603
  };
@@ -1613,6 +1927,7 @@ oop.inherits(Mode, TextMode);
1613
1927
  };
1614
1928
 
1615
1929
  this.$id = "ace/mode/javascript";
1930
+ this.snippetFileId = "ace/snippets/javascript";
1616
1931
  }).call(Mode.prototype);
1617
1932
 
1618
1933
  exports.Mode = Mode;
@@ -1950,6 +2265,7 @@ oop.inherits(Mode, TextMode);
1950
2265
  };
1951
2266
 
1952
2267
  this.$id = "ace/mode/css";
2268
+ this.snippetFileId = "ace/snippets/css";
1953
2269
  }).call(Mode.prototype);
1954
2270
 
1955
2271
  exports.Mode = Mode;
@@ -2842,99 +3158,277 @@ oop.inherits(Mode, TextMode);
2842
3158
  };
2843
3159
 
2844
3160
  this.$id = "ace/mode/html";
3161
+ this.snippetFileId = "ace/snippets/html";
2845
3162
  }).call(Mode.prototype);
2846
3163
 
2847
3164
  exports.Mode = Mode;
2848
3165
  });
2849
3166
 
2850
- define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) {
3167
+ define("ace/mode/folding/ruby",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"], function (require, exports, module) {
2851
3168
  "use strict";
2852
3169
 
2853
3170
  var oop = require("../../lib/oop");
2854
3171
  var BaseFoldMode = require("./fold_mode").FoldMode;
2855
3172
  var Range = require("../../range").Range;
3173
+ var TokenIterator = require("../../token_iterator").TokenIterator;
3174
+
3175
+
3176
+ var FoldMode = exports.FoldMode = function () {
3177
+ };
2856
3178
 
2857
- var FoldMode = exports.FoldMode = function() {};
2858
3179
  oop.inherits(FoldMode, BaseFoldMode);
2859
3180
 
2860
- (function() {
3181
+ (function () {
3182
+ this.indentKeywords = {
3183
+ "class": 1,
3184
+ "def": 1,
3185
+ "module": 1,
3186
+ "do": 1,
3187
+ "unless": 1,
3188
+ "if": 1,
3189
+ "while": 1,
3190
+ "for": 1,
3191
+ "until": 1,
3192
+ "begin": 1,
3193
+ "else": 0,
3194
+ "elsif": 0,
3195
+ "rescue": 0,
3196
+ "ensure": 0,
3197
+ "when": 0,
3198
+ "end": -1,
3199
+ "case": 1,
3200
+ "=begin": 1,
3201
+ "=end": -1
3202
+ };
2861
3203
 
2862
- this.getFoldWidgetRange = function(session, foldStyle, row) {
2863
- var range = this.indentationBlock(session, row);
2864
- if (range)
2865
- return range;
3204
+ this.foldingStartMarker = /(?:\s|^)(def|do|while|class|unless|module|if|for|until|begin|else|elsif|case|rescue|ensure|when)\b|({\s*$)|(=begin)/;
3205
+ this.foldingStopMarker = /(=end(?=$|\s.*$))|(^\s*})|\b(end)\b/;
2866
3206
 
2867
- var re = /\S/;
3207
+ this.getFoldWidget = function (session, foldStyle, row) {
2868
3208
  var line = session.getLine(row);
2869
- var startLevel = line.search(re);
2870
- if (startLevel == -1 || line[startLevel] != "#")
2871
- return;
2872
-
2873
- var startColumn = line.length;
2874
- var maxRow = session.getLength();
2875
- var startRow = row;
2876
- var endRow = row;
3209
+ var isStart = this.foldingStartMarker.test(line);
3210
+ var isEnd = this.foldingStopMarker.test(line);
3211
+
3212
+ if (isStart && !isEnd) {
3213
+ var match = line.match(this.foldingStartMarker);
3214
+ if (match[1]) {
3215
+ if (match[1] == "if" || match[1] == "else" || match[1] == "while" || match[1] == "until" || match[1] == "unless") {
3216
+ if (match[1] == "else" && /^\s*else\s*$/.test(line) === false) {
3217
+ return;
3218
+ }
3219
+ if (/^\s*(?:if|else|while|until|unless)\s*/.test(line) === false) {
3220
+ return;
3221
+ }
3222
+ }
2877
3223
 
2878
- while (++row < maxRow) {
2879
- line = session.getLine(row);
2880
- var level = line.search(re);
3224
+ if (match[1] == "when") {
3225
+ if (/\sthen\s/.test(line) === true) {
3226
+ return;
3227
+ }
3228
+ }
3229
+ if (session.getTokenAt(row, match.index + 2).type === "keyword")
3230
+ return "start";
3231
+ } else if (match[3]) {
3232
+ if (session.getTokenAt(row, match.index + 1).type === "comment.multiline")
3233
+ return "start";
3234
+ } else {
3235
+ return "start";
3236
+ }
3237
+ }
3238
+ if (foldStyle != "markbeginend" || !isEnd || isStart && isEnd)
3239
+ return "";
2881
3240
 
2882
- if (level == -1)
2883
- continue;
3241
+ var match = line.match(this.foldingStopMarker);
3242
+ if (match[3] === "end") {
3243
+ if (session.getTokenAt(row, match.index + 1).type === "keyword")
3244
+ return "end";
3245
+ } else if (match[1]) {
3246
+ if (session.getTokenAt(row, match.index + 1).type === "comment.multiline")
3247
+ return "end";
3248
+ } else
3249
+ return "end";
3250
+ };
2884
3251
 
2885
- if (line[level] != "#")
2886
- break;
3252
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
3253
+ var line = session.doc.getLine(row);
3254
+ var match = this.foldingStartMarker.exec(line);
3255
+ if (match) {
3256
+ if (match[1] || match[3])
3257
+ return this.rubyBlock(session, row, match.index + 2);
2887
3258
 
2888
- endRow = row;
3259
+ return this.openingBracketBlock(session, "{", row, match.index);
2889
3260
  }
2890
3261
 
2891
- if (endRow > startRow) {
2892
- var endColumn = session.getLine(endRow).length;
2893
- return new Range(startRow, startColumn, endRow, endColumn);
3262
+ var match = this.foldingStopMarker.exec(line);
3263
+ if (match) {
3264
+ if (match[3] === "end") {
3265
+ if (session.getTokenAt(row, match.index + 1).type === "keyword")
3266
+ return this.rubyBlock(session, row, match.index + 1);
3267
+ }
3268
+
3269
+ if (match[1] === "=end") {
3270
+ if (session.getTokenAt(row, match.index + 1).type === "comment.multiline")
3271
+ return this.rubyBlock(session, row, match.index + 1);
3272
+ }
3273
+
3274
+ return this.closingBracketBlock(session, "}", row, match.index + match[0].length);
2894
3275
  }
2895
3276
  };
2896
- this.getFoldWidget = function(session, foldStyle, row) {
3277
+
3278
+ this.rubyBlock = function (session, row, column, tokenRange) {
3279
+ var stream = new TokenIterator(session, row, column);
3280
+
3281
+ var token = stream.getCurrentToken();
3282
+ if (!token || (token.type != "keyword" && token.type != "comment.multiline"))
3283
+ return;
3284
+
3285
+ var val = token.value;
2897
3286
  var line = session.getLine(row);
2898
- var indent = line.search(/\S/);
2899
- var next = session.getLine(row + 1);
2900
- var prev = session.getLine(row - 1);
2901
- var prevIndent = prev.search(/\S/);
2902
- var nextIndent = next.search(/\S/);
2903
-
2904
- if (indent == -1) {
2905
- session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : "";
2906
- return "";
3287
+ switch (token.value) {
3288
+ case "if":
3289
+ case "unless":
3290
+ case "while":
3291
+ case "until":
3292
+ var checkToken = new RegExp("^\\s*" + token.value);
3293
+ if (!checkToken.test(line)) {
3294
+ return;
3295
+ }
3296
+ var dir = this.indentKeywords[val];
3297
+ break;
3298
+ case "when":
3299
+ if (/\sthen\s/.test(line)) {
3300
+ return;
3301
+ }
3302
+ case "elsif":
3303
+ case "rescue":
3304
+ case "ensure":
3305
+ var dir = 1;
3306
+ break;
3307
+ case "else":
3308
+ var checkToken = new RegExp("^\\s*" + token.value + "\\s*$");
3309
+ if (!checkToken.test(line)) {
3310
+ return;
3311
+ }
3312
+ var dir = 1;
3313
+ break;
3314
+ default:
3315
+ var dir = this.indentKeywords[val];
3316
+ break;
2907
3317
  }
2908
- if (prevIndent == -1) {
2909
- if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
2910
- session.foldWidgets[row - 1] = "";
2911
- session.foldWidgets[row + 1] = "";
2912
- return "start";
3318
+
3319
+ var stack = [val];
3320
+ if (!dir)
3321
+ return;
3322
+
3323
+ var startColumn = dir === -1 ? session.getLine(row - 1).length : session.getLine(row).length;
3324
+ var startRow = row;
3325
+ var ranges = [];
3326
+ ranges.push(stream.getCurrentTokenRange());
3327
+
3328
+ stream.step = dir === -1 ? stream.stepBackward : stream.stepForward;
3329
+ if (token.type == "comment.multiline") {
3330
+ while (token = stream.step()) {
3331
+ if (token.type !== "comment.multiline")
3332
+ continue;
3333
+ if (dir == 1) {
3334
+ startColumn = 6;
3335
+ if (token.value == "=end") {
3336
+ break;
3337
+ }
3338
+ } else {
3339
+ if (token.value == "=begin") {
3340
+ break;
3341
+ }
3342
+ }
2913
3343
  }
2914
- } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
2915
- if (session.getLine(row - 2).search(/\S/) == -1) {
2916
- session.foldWidgets[row - 1] = "start";
2917
- session.foldWidgets[row + 1] = "";
2918
- return "";
3344
+ } else {
3345
+ while (token = stream.step()) {
3346
+ var ignore = false;
3347
+ if (token.type !== "keyword")
3348
+ continue;
3349
+ var level = dir * this.indentKeywords[token.value];
3350
+ line = session.getLine(stream.getCurrentTokenRow());
3351
+ switch (token.value) {
3352
+ case "do":
3353
+ for (var i = stream.$tokenIndex - 1; i >= 0; i--) {
3354
+ var prevToken = stream.$rowTokens[i];
3355
+ if (prevToken && (prevToken.value == "while" || prevToken.value == "until" || prevToken.value == "for")) {
3356
+ level = 0;
3357
+ break;
3358
+ }
3359
+ }
3360
+ break;
3361
+ case "else":
3362
+ var checkToken = new RegExp("^\\s*" + token.value + "\\s*$");
3363
+ if (!checkToken.test(line) || val == "case") {
3364
+ level = 0;
3365
+ ignore = true;
3366
+ }
3367
+ break;
3368
+ case "if":
3369
+ case "unless":
3370
+ case "while":
3371
+ case "until":
3372
+ var checkToken = new RegExp("^\\s*" + token.value);
3373
+ if (!checkToken.test(line)) {
3374
+ level = 0;
3375
+ ignore = true;
3376
+ }
3377
+ break;
3378
+ case "when":
3379
+ if (/\sthen\s/.test(line) || val == "case") {
3380
+ level = 0;
3381
+ ignore = true;
3382
+ }
3383
+ break;
3384
+ }
3385
+
3386
+ if (level > 0) {
3387
+ stack.unshift(token.value);
3388
+ } else if (level <= 0 && ignore === false) {
3389
+ stack.shift();
3390
+ if (!stack.length) {
3391
+ if ((val == "while" || val == "until" || val == "for") && token.value != "do") {
3392
+ break;
3393
+ }
3394
+ if (token.value == "do" && dir == -1 && level != 0)
3395
+ break;
3396
+ if (token.value != "do")
3397
+ break;
3398
+ }
3399
+
3400
+ if (level === 0) {
3401
+ stack.unshift(token.value);
3402
+ }
3403
+ }
2919
3404
  }
2920
3405
  }
2921
3406
 
2922
- if (prevIndent!= -1 && prevIndent < indent)
2923
- session.foldWidgets[row - 1] = "start";
2924
- else
2925
- session.foldWidgets[row - 1] = "";
3407
+ if (!token)
3408
+ return null;
2926
3409
 
2927
- if (indent < nextIndent)
2928
- return "start";
2929
- else
2930
- return "";
3410
+ if (tokenRange) {
3411
+ ranges.push(stream.getCurrentTokenRange());
3412
+ return ranges;
3413
+ }
3414
+
3415
+ var row = stream.getCurrentTokenRow();
3416
+ if (dir === -1) {
3417
+ if (token.type === "comment.multiline") {
3418
+ var endColumn = 6;
3419
+ } else {
3420
+ var endColumn = session.getLine(row).length;
3421
+ }
3422
+ return new Range(row, endColumn, startRow - 1, startColumn);
3423
+ } else
3424
+ return new Range(startRow, startColumn, row - 1, session.getLine(row - 1).length);
2931
3425
  };
2932
3426
 
2933
3427
  }).call(FoldMode.prototype);
2934
3428
 
2935
3429
  });
2936
3430
 
2937
- define("ace/mode/ruby",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ruby_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/coffee"], function(require, exports, module) {
3431
+ define("ace/mode/ruby",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ruby_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/ruby"], function(require, exports, module) {
2938
3432
  "use strict";
2939
3433
 
2940
3434
  var oop = require("../lib/oop");
@@ -2943,13 +3437,14 @@ var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules;
2943
3437
  var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
2944
3438
  var Range = require("../range").Range;
2945
3439
  var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
2946
- var FoldMode = require("./folding/coffee").FoldMode;
3440
+ var FoldMode = require("./folding/ruby").FoldMode;
2947
3441
 
2948
3442
  var Mode = function() {
2949
3443
  this.HighlightRules = RubyHighlightRules;
2950
3444
  this.$outdent = new MatchingBraceOutdent();
2951
3445
  this.$behaviour = new CstyleBehaviour();
2952
3446
  this.foldingRules = new FoldMode();
3447
+ this.indentKeywords = this.foldingRules.indentKeywords;
2953
3448
  };
2954
3449
  oop.inherits(Mode, TextMode);
2955
3450
 
@@ -2964,7 +3459,7 @@ oop.inherits(Mode, TextMode);
2964
3459
  var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
2965
3460
  var tokens = tokenizedLine.tokens;
2966
3461
 
2967
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
3462
+ if (tokens.length && tokens[tokens.length - 1].type == "comment") {
2968
3463
  return indent;
2969
3464
  }
2970
3465
 
@@ -2972,7 +3467,7 @@ oop.inherits(Mode, TextMode);
2972
3467
  var match = line.match(/^.*[\{\(\[]\s*$/);
2973
3468
  var startingClassOrMethod = line.match(/^\s*(class|def|module)\s.*$/);
2974
3469
  var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/);
2975
- var startingConditional = line.match(/^\s*(if|else|when)\s*/);
3470
+ var startingConditional = line.match(/^\s*(if|else|when|elsif|unless|while|for|begin|rescue|ensure)\s*/);
2976
3471
  if (match || startingClassOrMethod || startingDoBlock || startingConditional) {
2977
3472
  indent += tab;
2978
3473
  }
@@ -2982,7 +3477,7 @@ oop.inherits(Mode, TextMode);
2982
3477
  };
2983
3478
 
2984
3479
  this.checkOutdent = function(state, line, input) {
2985
- return /^\s+(end|else)$/.test(line + input) || this.$outdent.checkOutdent(line, input);
3480
+ return /^\s+(end|else|rescue|ensure)$/.test(line + input) || this.$outdent.checkOutdent(line, input);
2986
3481
  };
2987
3482
 
2988
3483
  this.autoOutdent = function(state, session, row) {
@@ -2995,11 +3490,24 @@ oop.inherits(Mode, TextMode);
2995
3490
  var tab = session.getTabString();
2996
3491
  if (prevIndent.length <= indent.length) {
2997
3492
  if (indent.slice(-tab.length) == tab)
2998
- session.remove(new Range(row, indent.length-tab.length, row, indent.length));
3493
+ session.remove(new Range(row, indent.length - tab.length, row, indent.length));
2999
3494
  }
3000
3495
  };
3001
3496
 
3497
+ this.getMatching = function(session, row, column) {
3498
+ if (row == undefined) {
3499
+ var pos = session.selection.lead;
3500
+ column = pos.column;
3501
+ row = pos.row;
3502
+ }
3503
+
3504
+ var startToken = session.getTokenAt(row, column);
3505
+ if (startToken && startToken.value in this.indentKeywords)
3506
+ return this.foldingRules.rubyBlock(session, row, column, true);
3507
+ };
3508
+
3002
3509
  this.$id = "ace/mode/ruby";
3510
+ this.snippetFileId = "ace/snippets/ruby";
3003
3511
  }).call(Mode.prototype);
3004
3512
 
3005
3513
  exports.Mode = Mode;