ace-rails-ap 4.2 → 4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (235) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ace/rails/version.rb +1 -1
  3. data/update.sh +1 -1
  4. data/vendor/assets/javascripts/ace/ace.js +661 -160
  5. data/vendor/assets/javascripts/ace/ext-beautify.js +1 -0
  6. data/vendor/assets/javascripts/ace/ext-emmet.js +314 -218
  7. data/vendor/assets/javascripts/ace/ext-keybinding_menu.js +37 -32
  8. data/vendor/assets/javascripts/ace/ext-language_tools.js +362 -225
  9. data/vendor/assets/javascripts/ace/ext-linking.js +1 -1
  10. data/vendor/assets/javascripts/ace/ext-modelist.js +6 -2
  11. data/vendor/assets/javascripts/ace/ext-options.js +45 -34
  12. data/vendor/assets/javascripts/ace/ext-prompt.js +2764 -0
  13. data/vendor/assets/javascripts/ace/ext-rtl.js +1 -3
  14. data/vendor/assets/javascripts/ace/ext-settings_menu.js +49 -38
  15. data/vendor/assets/javascripts/ace/ext-statusbar.js +2 -2
  16. data/vendor/assets/javascripts/ace/ext-whitespace.js +4 -0
  17. data/vendor/assets/javascripts/ace/keybinding-emacs.js +1 -0
  18. data/vendor/assets/javascripts/ace/keybinding-vim.js +296 -66
  19. data/vendor/assets/javascripts/ace/mode-aql.js +102 -0
  20. data/vendor/assets/javascripts/ace/mode-autohotkey.js +3 -1
  21. data/vendor/assets/javascripts/ace/mode-cirru.js +2 -2
  22. data/vendor/assets/javascripts/ace/mode-crystal.js +642 -0
  23. data/vendor/assets/javascripts/ace/mode-csound_document.js +42 -29
  24. data/vendor/assets/javascripts/ace/mode-csound_orchestra.js +35 -25
  25. data/vendor/assets/javascripts/ace/mode-csound_score.js +29 -21
  26. data/vendor/assets/javascripts/ace/mode-fsharp.js +2 -2
  27. data/vendor/assets/javascripts/ace/mode-gherkin.js +0 -2
  28. data/vendor/assets/javascripts/ace/mode-gobstones.js +252 -94
  29. data/vendor/assets/javascripts/ace/mode-io.js +1 -7
  30. data/vendor/assets/javascripts/ace/mode-jade.js +1 -1
  31. data/vendor/assets/javascripts/ace/mode-lua.js +30 -10
  32. data/vendor/assets/javascripts/ace/mode-luapage.js +30 -10
  33. data/vendor/assets/javascripts/ace/mode-lucene.js +77 -9
  34. data/vendor/assets/javascripts/ace/mode-markdown.js +2 -1
  35. data/vendor/assets/javascripts/ace/mode-mask.js +1 -1
  36. data/vendor/assets/javascripts/ace/mode-nginx.js +298 -0
  37. data/vendor/assets/javascripts/ace/mode-nim.js +363 -0
  38. data/vendor/assets/javascripts/ace/mode-pascal.js +84 -66
  39. data/vendor/assets/javascripts/ace/mode-php.js +1 -1
  40. data/vendor/assets/javascripts/ace/mode-php_laravel_blade.js +1 -1
  41. data/vendor/assets/javascripts/ace/mode-puppet.js +3 -3
  42. data/vendor/assets/javascripts/ace/mode-slim.js +2 -1
  43. data/vendor/assets/javascripts/ace/mode-tcl.js +3 -0
  44. data/vendor/assets/javascripts/ace/mode-terraform.js +4 -4
  45. data/vendor/assets/javascripts/ace/mode-yaml.js +44 -13
  46. data/vendor/assets/javascripts/ace/mode-zeek.js +539 -0
  47. data/vendor/assets/javascripts/ace/snippets/abap.js +8 -1
  48. data/vendor/assets/javascripts/ace/snippets/abc.js +8 -1
  49. data/vendor/assets/javascripts/ace/snippets/actionscript.js +8 -1
  50. data/vendor/assets/javascripts/ace/snippets/ada.js +8 -1
  51. data/vendor/assets/javascripts/ace/snippets/apache_conf.js +8 -1
  52. data/vendor/assets/javascripts/ace/snippets/apex.js +14 -0
  53. data/vendor/assets/javascripts/ace/snippets/applescript.js +8 -1
  54. data/vendor/assets/javascripts/ace/snippets/aql.js +14 -0
  55. data/vendor/assets/javascripts/ace/snippets/asciidoc.js +8 -1
  56. data/vendor/assets/javascripts/ace/snippets/asl.js +13 -0
  57. data/vendor/assets/javascripts/ace/snippets/assembly_x86.js +8 -1
  58. data/vendor/assets/javascripts/ace/snippets/autohotkey.js +8 -1
  59. data/vendor/assets/javascripts/ace/snippets/batchfile.js +8 -1
  60. data/vendor/assets/javascripts/ace/snippets/bro.js +8 -1
  61. data/vendor/assets/javascripts/ace/snippets/c9search.js +8 -1
  62. data/vendor/assets/javascripts/ace/snippets/c_cpp.js +8 -1
  63. data/vendor/assets/javascripts/ace/snippets/cirru.js +8 -1
  64. data/vendor/assets/javascripts/ace/snippets/clojure.js +8 -1
  65. data/vendor/assets/javascripts/ace/snippets/cobol.js +8 -1
  66. data/vendor/assets/javascripts/ace/snippets/coffee.js +8 -1
  67. data/vendor/assets/javascripts/ace/snippets/coldfusion.js +8 -1
  68. data/vendor/assets/javascripts/ace/snippets/crystal.js +14 -0
  69. data/vendor/assets/javascripts/ace/snippets/csharp.js +8 -1
  70. data/vendor/assets/javascripts/ace/snippets/csound_document.js +24 -0
  71. data/vendor/assets/javascripts/ace/snippets/csound_orchestra.js +61 -0
  72. data/vendor/assets/javascripts/ace/snippets/csound_score.js +14 -0
  73. data/vendor/assets/javascripts/ace/snippets/csp.js +14 -0
  74. data/vendor/assets/javascripts/ace/snippets/css.js +8 -1
  75. data/vendor/assets/javascripts/ace/snippets/curly.js +8 -1
  76. data/vendor/assets/javascripts/ace/snippets/d.js +8 -1
  77. data/vendor/assets/javascripts/ace/snippets/dart.js +8 -1
  78. data/vendor/assets/javascripts/ace/snippets/diff.js +8 -1
  79. data/vendor/assets/javascripts/ace/snippets/django.js +8 -1
  80. data/vendor/assets/javascripts/ace/snippets/dockerfile.js +8 -1
  81. data/vendor/assets/javascripts/ace/snippets/dot.js +8 -1
  82. data/vendor/assets/javascripts/ace/snippets/drools.js +8 -1
  83. data/vendor/assets/javascripts/ace/snippets/edifact.js +254 -0
  84. data/vendor/assets/javascripts/ace/snippets/eiffel.js +8 -1
  85. data/vendor/assets/javascripts/ace/snippets/ejs.js +8 -1
  86. data/vendor/assets/javascripts/ace/snippets/elixir.js +8 -1
  87. data/vendor/assets/javascripts/ace/snippets/elm.js +8 -1
  88. data/vendor/assets/javascripts/ace/snippets/erlang.js +8 -1
  89. data/vendor/assets/javascripts/ace/snippets/forth.js +8 -1
  90. data/vendor/assets/javascripts/ace/snippets/fortran.js +8 -1
  91. data/vendor/assets/javascripts/ace/snippets/fsharp.js +14 -0
  92. data/vendor/assets/javascripts/ace/snippets/fsl.js +14 -0
  93. data/vendor/assets/javascripts/ace/snippets/ftl.js +8 -1
  94. data/vendor/assets/javascripts/ace/snippets/gcode.js +8 -1
  95. data/vendor/assets/javascripts/ace/snippets/gherkin.js +8 -1
  96. data/vendor/assets/javascripts/ace/snippets/gitignore.js +8 -1
  97. data/vendor/assets/javascripts/ace/snippets/glsl.js +8 -1
  98. data/vendor/assets/javascripts/ace/snippets/gobstones.js +1701 -24
  99. data/vendor/assets/javascripts/ace/snippets/golang.js +8 -1
  100. data/vendor/assets/javascripts/ace/snippets/graphqlschema.js +8 -1
  101. data/vendor/assets/javascripts/ace/snippets/groovy.js +8 -1
  102. data/vendor/assets/javascripts/ace/snippets/haml.js +8 -1
  103. data/vendor/assets/javascripts/ace/snippets/handlebars.js +8 -1
  104. data/vendor/assets/javascripts/ace/snippets/haskell.js +8 -1
  105. data/vendor/assets/javascripts/ace/snippets/haskell_cabal.js +8 -1
  106. data/vendor/assets/javascripts/ace/snippets/haxe.js +8 -1
  107. data/vendor/assets/javascripts/ace/snippets/hjson.js +8 -1
  108. data/vendor/assets/javascripts/ace/snippets/html.js +36 -2
  109. data/vendor/assets/javascripts/ace/snippets/html_elixir.js +8 -1
  110. data/vendor/assets/javascripts/ace/snippets/html_ruby.js +8 -1
  111. data/vendor/assets/javascripts/ace/snippets/ini.js +8 -1
  112. data/vendor/assets/javascripts/ace/snippets/io.js +8 -1
  113. data/vendor/assets/javascripts/ace/snippets/jack.js +8 -1
  114. data/vendor/assets/javascripts/ace/snippets/jade.js +8 -1
  115. data/vendor/assets/javascripts/ace/snippets/java.js +8 -1
  116. data/vendor/assets/javascripts/ace/snippets/javascript.js +8 -1
  117. data/vendor/assets/javascripts/ace/snippets/json.js +8 -1
  118. data/vendor/assets/javascripts/ace/snippets/jsoniq.js +8 -1
  119. data/vendor/assets/javascripts/ace/snippets/jsp.js +8 -1
  120. data/vendor/assets/javascripts/ace/snippets/jssm.js +14 -0
  121. data/vendor/assets/javascripts/ace/snippets/jsx.js +8 -1
  122. data/vendor/assets/javascripts/ace/snippets/julia.js +8 -1
  123. data/vendor/assets/javascripts/ace/snippets/kotlin.js +8 -1
  124. data/vendor/assets/javascripts/ace/snippets/latex.js +8 -1
  125. data/vendor/assets/javascripts/ace/snippets/less.js +8 -1
  126. data/vendor/assets/javascripts/ace/snippets/liquid.js +890 -2
  127. data/vendor/assets/javascripts/ace/snippets/lisp.js +8 -1
  128. data/vendor/assets/javascripts/ace/snippets/livescript.js +8 -1
  129. data/vendor/assets/javascripts/ace/snippets/logiql.js +8 -1
  130. data/vendor/assets/javascripts/ace/snippets/logtalk.js +14 -0
  131. data/vendor/assets/javascripts/ace/snippets/lsl.js +8 -1
  132. data/vendor/assets/javascripts/ace/snippets/lua.js +8 -1
  133. data/vendor/assets/javascripts/ace/snippets/luapage.js +8 -1
  134. data/vendor/assets/javascripts/ace/snippets/lucene.js +8 -1
  135. data/vendor/assets/javascripts/ace/snippets/makefile.js +8 -1
  136. data/vendor/assets/javascripts/ace/snippets/markdown.js +8 -1
  137. data/vendor/assets/javascripts/ace/snippets/mask.js +8 -1
  138. data/vendor/assets/javascripts/ace/snippets/matlab.js +8 -1
  139. data/vendor/assets/javascripts/ace/snippets/maze.js +8 -1
  140. data/vendor/assets/javascripts/ace/snippets/mel.js +8 -1
  141. data/vendor/assets/javascripts/ace/snippets/mixal.js +14 -0
  142. data/vendor/assets/javascripts/ace/snippets/mushcode.js +8 -1
  143. data/vendor/assets/javascripts/ace/snippets/mysql.js +8 -1
  144. data/vendor/assets/javascripts/ace/snippets/nginx.js +14 -0
  145. data/vendor/assets/javascripts/ace/snippets/nim.js +14 -0
  146. data/vendor/assets/javascripts/ace/snippets/nix.js +8 -1
  147. data/vendor/assets/javascripts/ace/snippets/nsis.js +8 -1
  148. data/vendor/assets/javascripts/ace/snippets/objectivec.js +8 -1
  149. data/vendor/assets/javascripts/ace/snippets/ocaml.js +8 -1
  150. data/vendor/assets/javascripts/ace/snippets/pascal.js +8 -1
  151. data/vendor/assets/javascripts/ace/snippets/perl.js +8 -1
  152. data/vendor/assets/javascripts/ace/snippets/perl6.js +14 -0
  153. data/vendor/assets/javascripts/ace/snippets/pgsql.js +8 -1
  154. data/vendor/assets/javascripts/ace/snippets/php.js +49 -36
  155. data/vendor/assets/javascripts/ace/snippets/php_laravel_blade.js +14 -0
  156. data/vendor/assets/javascripts/ace/snippets/pig.js +8 -1
  157. data/vendor/assets/javascripts/ace/snippets/plain_text.js +8 -1
  158. data/vendor/assets/javascripts/ace/snippets/powershell.js +8 -1
  159. data/vendor/assets/javascripts/ace/snippets/praat.js +8 -1
  160. data/vendor/assets/javascripts/ace/snippets/prolog.js +8 -1
  161. data/vendor/assets/javascripts/ace/snippets/properties.js +8 -1
  162. data/vendor/assets/javascripts/ace/snippets/protobuf.js +8 -1
  163. data/vendor/assets/javascripts/ace/snippets/puppet.js +14 -0
  164. data/vendor/assets/javascripts/ace/snippets/python.js +8 -1
  165. data/vendor/assets/javascripts/ace/snippets/r.js +8 -1
  166. data/vendor/assets/javascripts/ace/snippets/razor.js +8 -1
  167. data/vendor/assets/javascripts/ace/snippets/rdoc.js +8 -1
  168. data/vendor/assets/javascripts/ace/snippets/red.js +14 -0
  169. data/vendor/assets/javascripts/ace/snippets/redshift.js +14 -0
  170. data/vendor/assets/javascripts/ace/snippets/rhtml.js +8 -1
  171. data/vendor/assets/javascripts/ace/snippets/rst.js +8 -1
  172. data/vendor/assets/javascripts/ace/snippets/ruby.js +8 -1
  173. data/vendor/assets/javascripts/ace/snippets/rust.js +8 -1
  174. data/vendor/assets/javascripts/ace/snippets/sass.js +8 -1
  175. data/vendor/assets/javascripts/ace/snippets/scad.js +8 -1
  176. data/vendor/assets/javascripts/ace/snippets/scala.js +8 -1
  177. data/vendor/assets/javascripts/ace/snippets/scheme.js +8 -1
  178. data/vendor/assets/javascripts/ace/snippets/scss.js +8 -1
  179. data/vendor/assets/javascripts/ace/snippets/sh.js +8 -1
  180. data/vendor/assets/javascripts/ace/snippets/sjs.js +8 -1
  181. data/vendor/assets/javascripts/ace/snippets/slim.js +14 -0
  182. data/vendor/assets/javascripts/ace/snippets/smarty.js +8 -1
  183. data/vendor/assets/javascripts/ace/snippets/snippets.js +8 -1
  184. data/vendor/assets/javascripts/ace/snippets/soy_template.js +8 -1
  185. data/vendor/assets/javascripts/ace/snippets/space.js +8 -1
  186. data/vendor/assets/javascripts/ace/snippets/sparql.js +8 -1
  187. data/vendor/assets/javascripts/ace/snippets/sql.js +8 -1
  188. data/vendor/assets/javascripts/ace/snippets/sqlserver.js +8 -1
  189. data/vendor/assets/javascripts/ace/snippets/stylus.js +8 -1
  190. data/vendor/assets/javascripts/ace/snippets/svg.js +8 -1
  191. data/vendor/assets/javascripts/ace/snippets/swift.js +8 -1
  192. data/vendor/assets/javascripts/ace/snippets/tcl.js +8 -1
  193. data/vendor/assets/javascripts/ace/snippets/terraform.js +14 -0
  194. data/vendor/assets/javascripts/ace/snippets/tex.js +8 -1
  195. data/vendor/assets/javascripts/ace/snippets/text.js +8 -1
  196. data/vendor/assets/javascripts/ace/snippets/textile.js +8 -1
  197. data/vendor/assets/javascripts/ace/snippets/toml.js +8 -1
  198. data/vendor/assets/javascripts/ace/snippets/tsx.js +8 -1
  199. data/vendor/assets/javascripts/ace/snippets/turtle.js +8 -1
  200. data/vendor/assets/javascripts/ace/snippets/twig.js +8 -1
  201. data/vendor/assets/javascripts/ace/snippets/typescript.js +8 -1
  202. data/vendor/assets/javascripts/ace/snippets/vala.js +8 -1
  203. data/vendor/assets/javascripts/ace/snippets/vbscript.js +8 -1
  204. data/vendor/assets/javascripts/ace/snippets/velocity.js +8 -1
  205. data/vendor/assets/javascripts/ace/snippets/verilog.js +8 -1
  206. data/vendor/assets/javascripts/ace/snippets/vhdl.js +8 -1
  207. data/vendor/assets/javascripts/ace/snippets/visualforce.js +14 -0
  208. data/vendor/assets/javascripts/ace/snippets/wollok.js +8 -1
  209. data/vendor/assets/javascripts/ace/snippets/xml.js +8 -1
  210. data/vendor/assets/javascripts/ace/snippets/xquery.js +8 -1
  211. data/vendor/assets/javascripts/ace/snippets/yaml.js +8 -1
  212. data/vendor/assets/javascripts/ace/snippets/zeek.js +14 -0
  213. data/vendor/assets/javascripts/ace/worker-coffee.js +2 -2
  214. data/vendor/assets/javascripts/ace/worker-css.js +9 -3
  215. data/vendor/assets/javascripts/ace/worker-html.js +2 -2
  216. data/vendor/assets/javascripts/ace/worker-javascript.js +2 -2
  217. data/vendor/assets/javascripts/ace/worker-json.js +2 -2
  218. data/vendor/assets/javascripts/ace/worker-lua.js +2 -2
  219. data/vendor/assets/javascripts/ace/worker-php.js +4 -4
  220. data/vendor/assets/javascripts/ace/worker-xml.js +2 -2
  221. data/vendor/assets/javascripts/ace/worker-xquery.js +2 -2
  222. metadata +34 -16
  223. data/vendor/assets/javascripts/ace/ext-chromevox.js +0 -540
  224. data/vendor/assets/javascripts/ace/ext-old_ie.js +0 -502
  225. data/vendor/assets/javascripts/ace/mode-bash.js +0 -247
  226. data/vendor/assets/javascripts/ace/mode-lean.js +0 -281
  227. data/vendor/assets/javascripts/ace/mode-live_script.js +0 -481
  228. data/vendor/assets/javascripts/ace/mode-mips_assembler.js +0 -235
  229. data/vendor/assets/javascripts/ace/mode-mipsassembler.js +0 -196
  230. data/vendor/assets/javascripts/ace/mode-swig.js +0 -1099
  231. data/vendor/assets/javascripts/ace/snippets/lean.js +0 -7
  232. data/vendor/assets/javascripts/ace/snippets/live_script.js +0 -7
  233. data/vendor/assets/javascripts/ace/snippets/mips_assembler.js +0 -7
  234. data/vendor/assets/javascripts/ace/snippets/mipsassembler.js +0 -7
  235. data/vendor/assets/javascripts/ace/snippets/swig.js +0 -7
@@ -7,13 +7,7 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
7
7
  var IoHighlightRules = function() {
8
8
 
9
9
  this.$rules = { start:
10
- [ { token: [ 'text', 'meta.empty-parenthesis.io' ],
11
- regex: '(\\()(\\))',
12
- comment: 'we match this to overload return inside () --Allan; scoping rules for what gets the scope have changed, so we now group the ) instead of the ( -- Rob' },
13
- { token: [ 'text', 'meta.comma-parenthesis.io' ],
14
- regex: '(\\,)(\\))',
15
- comment: 'We want to do the same for ,) -- Seckar; same as above -- Rob' },
16
- { token: 'keyword.control.io',
10
+ [ { token: 'keyword.control.io',
17
11
  regex: '\\b(?:if|ifTrue|ifFalse|ifTrueIfFalse|for|loop|reverseForeach|foreach|map|continue|break|while|do|return)\\b' },
18
12
  { token: 'punctuation.definition.comment.io',
19
13
  regex: '/\\*',
@@ -1083,7 +1083,7 @@ var MarkdownHighlightRules = function() {
1083
1083
  next : "blockquote"
1084
1084
  }, { // HR * - _
1085
1085
  token : "constant",
1086
- regex : "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",
1086
+ regex : "^ {0,3}(?:(?:\\* ?){3,}|(?:\\- ?){3,}|(?:\\_ ?){3,})\\s*$",
1087
1087
  next: "allowBlock"
1088
1088
  }, { // list
1089
1089
  token : "markup.list",
@@ -237,7 +237,7 @@ oop.inherits(FoldMode, BaseFoldMode);
237
237
  }
238
238
  };
239
239
 
240
- this.luaBlock = function(session, row, column) {
240
+ this.luaBlock = function(session, row, column, tokenRange) {
241
241
  var stream = new TokenIterator(session, row, column);
242
242
  var indentKeywords = {
243
243
  "function": 1,
@@ -280,6 +280,12 @@ oop.inherits(FoldMode, BaseFoldMode);
280
280
  }
281
281
  }
282
282
 
283
+ if (!token)
284
+ return null;
285
+
286
+ if (tokenRange)
287
+ return stream.getCurrentTokenRange();
288
+
283
289
  var row = stream.getCurrentTokenRow();
284
290
  if (dir === -1)
285
291
  return new Range(row, session.getLine(row).length, startRow, startColumn);
@@ -389,17 +395,31 @@ oop.inherits(Mode, TextMode);
389
395
  return (tokens[0].type == "keyword" && outdentKeywords.indexOf(tokens[0].value) != -1);
390
396
  };
391
397
 
398
+ this.getMatching = function(session, row, column) {
399
+ if (row == undefined) {
400
+ var pos = session.selection.lead;
401
+ column = pos.column;
402
+ row = pos.row;
403
+ }
404
+
405
+ var startToken = session.getTokenAt(row, column);
406
+ if (startToken && startToken.value in indentKeywords)
407
+ return this.foldingRules.luaBlock(session, row, column, true);
408
+ };
409
+
392
410
  this.autoOutdent = function(state, session, row) {
393
- var prevLine = session.getLine(row - 1);
394
- var prevIndent = this.$getIndent(prevLine).length;
395
- var prevTokens = this.getTokenizer().getLineTokens(prevLine, "start").tokens;
396
- var tabLength = session.getTabString().length;
397
- var expectedIndent = prevIndent + tabLength * getNetIndentLevel(prevTokens);
398
- var curIndent = this.$getIndent(session.getLine(row)).length;
399
- if (curIndent <= expectedIndent) {
400
- return;
411
+ var line = session.getLine(row);
412
+ var column = line.match(/^\s*/)[0].length;
413
+ if (!column || !row) return;
414
+
415
+ var startRange = this.getMatching(session, row, column + 1);
416
+ if (!startRange || startRange.start.row == row)
417
+ return;
418
+ var indent = this.$getIndent(session.getLine(startRange.start.row));
419
+ if (indent.length != column) {
420
+ session.replace(new Range(row, 0, row, column), indent);
421
+ session.outdentRows(new Range(row + 1, 0, row + 1, 0));
401
422
  }
402
- session.outdentRows(new Range(row, 0, row + 2, 0));
403
423
  };
404
424
 
405
425
  this.createWorker = function(session) {
@@ -2737,7 +2737,7 @@ oop.inherits(FoldMode, BaseFoldMode);
2737
2737
  }
2738
2738
  };
2739
2739
 
2740
- this.luaBlock = function(session, row, column) {
2740
+ this.luaBlock = function(session, row, column, tokenRange) {
2741
2741
  var stream = new TokenIterator(session, row, column);
2742
2742
  var indentKeywords = {
2743
2743
  "function": 1,
@@ -2780,6 +2780,12 @@ oop.inherits(FoldMode, BaseFoldMode);
2780
2780
  }
2781
2781
  }
2782
2782
 
2783
+ if (!token)
2784
+ return null;
2785
+
2786
+ if (tokenRange)
2787
+ return stream.getCurrentTokenRange();
2788
+
2783
2789
  var row = stream.getCurrentTokenRow();
2784
2790
  if (dir === -1)
2785
2791
  return new Range(row, session.getLine(row).length, startRow, startColumn);
@@ -2889,17 +2895,31 @@ oop.inherits(Mode, TextMode);
2889
2895
  return (tokens[0].type == "keyword" && outdentKeywords.indexOf(tokens[0].value) != -1);
2890
2896
  };
2891
2897
 
2898
+ this.getMatching = function(session, row, column) {
2899
+ if (row == undefined) {
2900
+ var pos = session.selection.lead;
2901
+ column = pos.column;
2902
+ row = pos.row;
2903
+ }
2904
+
2905
+ var startToken = session.getTokenAt(row, column);
2906
+ if (startToken && startToken.value in indentKeywords)
2907
+ return this.foldingRules.luaBlock(session, row, column, true);
2908
+ };
2909
+
2892
2910
  this.autoOutdent = function(state, session, row) {
2893
- var prevLine = session.getLine(row - 1);
2894
- var prevIndent = this.$getIndent(prevLine).length;
2895
- var prevTokens = this.getTokenizer().getLineTokens(prevLine, "start").tokens;
2896
- var tabLength = session.getTabString().length;
2897
- var expectedIndent = prevIndent + tabLength * getNetIndentLevel(prevTokens);
2898
- var curIndent = this.$getIndent(session.getLine(row)).length;
2899
- if (curIndent <= expectedIndent) {
2900
- return;
2911
+ var line = session.getLine(row);
2912
+ var column = line.match(/^\s*/)[0].length;
2913
+ if (!column || !row) return;
2914
+
2915
+ var startRange = this.getMatching(session, row, column + 1);
2916
+ if (!startRange || startRange.start.row == row)
2917
+ return;
2918
+ var indent = this.$getIndent(session.getLine(startRange.start.row));
2919
+ if (indent.length != column) {
2920
+ session.replace(new Range(row, 0, row, column), indent);
2921
+ session.outdentRows(new Range(row + 1, 0, row + 1, 0));
2901
2922
  }
2902
- session.outdentRows(new Range(row, 0, row + 2, 0));
2903
2923
  };
2904
2924
 
2905
2925
  this.createWorker = function(session) {
@@ -1,8 +1,7 @@
1
- define("ace/mode/lucene_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
1
+ define("ace/mode/lucene_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2
2
  "use strict";
3
3
 
4
4
  var oop = require("../lib/oop");
5
- var lang = require("../lib/lang");
6
5
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
7
6
 
8
7
  var LuceneHighlightRules = function() {
@@ -10,7 +9,7 @@ var LuceneHighlightRules = function() {
10
9
  "start" : [
11
10
  {
12
11
  token: "constant.language.escape",
13
- regex: /\\[\+\-&\|!\(\)\{\}\[\]^"~\*\?:\\]/
12
+ regex: /\\[\-+&|!(){}\[\]^"~*?:\\]/
14
13
  }, {
15
14
  token: "constant.character.negation",
16
15
  regex: "\\-"
@@ -36,17 +35,86 @@ var LuceneHighlightRules = function() {
36
35
  token: "paren.rparen",
37
36
  regex: "[\\)\\}\\]]"
38
37
  }, {
39
- token: "keyword",
40
- regex: "(?:\\\\.|[^\\s:\\\\])+:"
38
+ token: "keyword.operator",
39
+ regex: /[><=^]/
40
+ }, {
41
+ token: "constant.numeric",
42
+ regex: /\d[\d.-]*/
43
+ }, {
44
+ token: "string",
45
+ regex: /"(?:\\"|[^"])*"/
41
46
  }, {
42
- token: "string", // " string
43
- regex: '"(?:\\\\"|[^"])*"'
47
+ token: "keyword",
48
+ regex: /(?:\\.|[^\s\-+&|!(){}\[\]^"~*?:\\])+:/,
49
+ next: "maybeRegex"
44
50
  }, {
45
51
  token: "term",
46
- regex: "\\w+"
52
+ regex: /\w+/
47
53
  }, {
48
54
  token: "text",
49
- regex: "\\s+"
55
+ regex: /\s+/
56
+ }
57
+ ],
58
+ "maybeRegex": [{
59
+ token: "text",
60
+ regex: /\s+/
61
+ }, {
62
+ token: "string.regexp.start",
63
+ regex: "/",
64
+ next: "regex"
65
+ }, {
66
+ regex: "",
67
+ next: "start"
68
+ }],
69
+ "regex": [
70
+ {
71
+ token: "regexp.keyword.operator",
72
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
73
+ }, {
74
+ token: "string.regexp.end",
75
+ regex: "/[sxngimy]*",
76
+ next: "no_regex"
77
+ }, {
78
+ token : "invalid",
79
+ regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
80
+ }, {
81
+ token : "constant.language.escape",
82
+ regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
83
+ }, {
84
+ token: "constant.language.escape",
85
+ regex: "<\d+-\d+>|[~&@]"
86
+ }, {
87
+ token : "constant.language.delimiter",
88
+ regex: /\|/
89
+ }, {
90
+ token: "constant.language.escape",
91
+ regex: /\[\^?/,
92
+ next: "regex_character_class"
93
+ }, {
94
+ token: "empty",
95
+ regex: "$",
96
+ next: "no_regex"
97
+ }, {
98
+ defaultToken: "string.regexp"
99
+ }
100
+ ],
101
+ "regex_character_class": [
102
+ {
103
+ token: "regexp.charclass.keyword.operator",
104
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
105
+ }, {
106
+ token: "constant.language.escape",
107
+ regex: "]",
108
+ next: "regex"
109
+ }, {
110
+ token: "constant.language.escape",
111
+ regex: "-"
112
+ }, {
113
+ token: "empty",
114
+ regex: "$",
115
+ next: "no_regex"
116
+ }, {
117
+ defaultToken: "string.regexp.charachterclass"
50
118
  }
51
119
  ]
52
120
  };
@@ -2625,7 +2625,7 @@ var MarkdownHighlightRules = function() {
2625
2625
  next : "blockquote"
2626
2626
  }, { // HR * - _
2627
2627
  token : "constant",
2628
- regex : "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",
2628
+ regex : "^ {0,3}(?:(?:\\* ?){3,}|(?:\\- ?){3,}|(?:\\_ ?){3,})\\s*$",
2629
2629
  next: "allowBlock"
2630
2630
  }, { // list
2631
2631
  token : "markup.list",
@@ -3160,6 +3160,7 @@ oop.inherits(Mode, TextMode);
3160
3160
  (function() {
3161
3161
  this.type = "text";
3162
3162
  this.blockComment = {start: "<!--", end: "-->"};
3163
+ this.$quotes = {'"': '"', "`": "`"};
3163
3164
 
3164
3165
  this.getNextLineIndent = function(state, line, tab) {
3165
3166
  if (state == "listblock") {
@@ -1083,7 +1083,7 @@ var MarkdownHighlightRules = function() {
1083
1083
  next : "blockquote"
1084
1084
  }, { // HR * - _
1085
1085
  token : "constant",
1086
- regex : "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",
1086
+ regex : "^ {0,3}(?:(?:\\* ?){3,}|(?:\\- ?){3,}|(?:\\_ ?){3,})\\s*$",
1087
1087
  next: "allowBlock"
1088
1088
  }, { // list
1089
1089
  token : "markup.list",
@@ -0,0 +1,298 @@
1
+ define("ace/mode/nginx_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function (require, exports, module) {
2
+ "use strict";
3
+
4
+ var oop = require("../lib/oop");
5
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
6
+ var NginxHighlightRules = function () {
7
+ var keywords = "include|index|absolute_redirect|aio|output_buffers|directio|sendfile|aio_write|alias|root|chunked_transfer_encoding|client_body_buffer_size|client_body_in_file_only|client_body_in_single_buffer|client_body_temp_path|client_body_timeout|client_header_buffer_size|client_header_timeout|client_max_body_size|connection_pool_size|default_type|disable_symlinks|directio_alignment|error_page|etag|if_modified_since|ignore_invalid_headers|internal|keepalive_requests|keepalive_disable|keepalive_timeout|limit_except|large_client_header_buffers|limit_rate|limit_rate_after|lingering_close|lingering_time|lingering_timeout|listen|log_not_found|log_subrequest|max_ranges|merge_slashes|msie_padding|msie_refresh|open_file_cache|open_file_cache_errors|open_file_cache_min_uses|open_file_cache_valid|output_buffers|port_in_redirect|postpone_output|read_ahead|recursive_error_pages|request_pool_size|reset_timedout_connection|resolver|resolver_timeout|satisfy|send_lowat|send_timeout|sendfile|sendfile_max_chunk|server_name|server_name_in_redirect|server_names_hash_bucket_size|server_names_hash_max_size|server_tokens|subrequest_output_buffer_size|tcp_nodelay|tcp_nopush|try_files|types|types_hash_bucket_size|types_hash_max_size|underscores_in_headers|variables_hash_bucket_size|variables_hash_max_size|accept_mutex|accept_mutex_delay|debug_connection|error_log|daemon|debug_points|env|load_module|lock_file|master_process|multi_accept|pcre_jit|pid|ssl_engine|thread_pool|timer_resolution|use|user|worker_aio_requests|worker_connections|worker_cpu_affinity|worker_priority|worker_processes|worker_rlimit_core|worker_rlimit_nofile|worker_shutdown_timeout|working_directory|allow|deny|add_before_body|add_after_body|addition_types|api|status_zone|auth_basic|auth_basic_user_file|auth_jwt|auth_jwt|auth_jwt_claim_set|auth_jwt_header_set|auth_jwt_key_file|auth_jwt_key_request|auth_jwt_leeway|auth_request|auth_request_set|autoindex|autoindex_exact_size|autoindex_format|autoindex_localtime|ancient_browser|ancient_browser_value|modern_browser|modern_browser_value|charset|charset_map|charset_types|override_charset|source_charset|create_full_put_path|dav_access|dav_methods|min_delete_depth|empty_gif|f4f|f4f_buffer_size|fastcgi_bind|fastcgi_buffer_size|fastcgi_buffering|fastcgi_buffers|fastcgi_busy_buffers_size|fastcgi_cache|fastcgi_cache_background_update|fastcgi_cache_bypass|fastcgi_cache_key|fastcgi_cache_lock|fastcgi_cache_lock_age|fastcgi_cache_lock_timeout|fastcgi_cache_max_range_offset|fastcgi_cache_methods|fastcgi_cache_min_uses|fastcgi_cache_min_uses|fastcgi_cache_path|fastcgi_cache_purge|fastcgi_cache_revalidate|fastcgi_cache_use_stale|fastcgi_cache_valid|fastcgi_catch_stderr|fastcgi_connect_timeout|fastcgi_force_ranges|fastcgi_hide_header|fastcgi_ignore_client_abort|fastcgi_ignore_headers|fastcgi_index|fastcgi_intercept_errors|fastcgi_keep_conn|fastcgi_limit_rate|fastcgi_max_temp_file_size|fastcgi_next_upstream|fastcgi_next_upstream_timeout|fastcgi_next_upstream_tries|fastcgi_no_cache|fastcgi_param|fastcgi_pass|fastcgi_pass_header|fastcgi_pass_request_body|fastcgi_pass_request_headers|fastcgi_read_timeout|fastcgi_request_buffering|fastcgi_send_lowat|fastcgi_send_timeout|fastcgi_socket_keepalive|fastcgi_split_path_info|fastcgi_store|fastcgi_store_access|fastcgi_temp_file_write_size|fastcgi_temp_path|flv|geoip_country|geoip_city|geoip_org|geoip_proxy|geoip_proxy_recursive|grpc_bind|grpc_buffer_size|grpc_connect_timeout|grpc_hide_header|grpc_ignore_headers|grpc_intercept_errors|grpc_next_upstream|grpc_next_upstream_timeout|grpc_next_upstream_tries|grpc_pass|grpc_pass_header|grpc_read_timeout|grpc_send_timeout|grpc_set_header|grpc_socket_keepalive|grpc_ssl_certificate|grpc_ssl_certificate_key|grpc_ssl_ciphers|grpc_ssl_crl|grpc_ssl_name|grpc_ssl_password_file|grpc_ssl_protocols|grpc_ssl_server_name|grpc_ssl_session_reuse|grpc_ssl_trusted_certificate|grpc_ssl_verify|grpc_ssl_verify_depth|gunzip|gunzip_buffers|gzip|gzip_buffers|gzip_comp_level|gzip_disable|gzip_http_version|gzip_min_length|gzip_proxied|gzip_types|gzip_vary|gzip_static|add_header|add_trailer|expires|hlshls_buffers|hls_forward_args|hls_fragment|hls_mp4_buffer_size|hls_mp4_max_buffer_size|image_filter|image_filter_buffer|image_filter_interlace|image_filter_jpeg_quality|image_filter_sharpen|image_filter_transparency|image_filter_webp_quality|js_content|js_include|js_set|keyval|keyval_zone|limit_conn|limit_conn_log_level|limit_conn_status|limit_conn_zone|limit_zone|limit_req|limit_req_log_level|limit_req_status|limit_req_zone|access_log|log_format|open_log_file_cache|map_hash_bucket_size|map_hash_max_size|memcached_bind|memcached_buffer_size|memcached_connect_timeout|memcached_force_ranges|memcached_gzip_flag|memcached_next_upstream|memcached_next_upstream_timeout|memcached_next_upstream_tries|memcached_pass|memcached_read_timeout|memcached_send_timeout|memcached_socket_keepalive|mirror|mirror_request_body|mp4|mp4_buffer_size|mp4_max_buffer_size|mp4_limit_rate|mp4_limit_rate_after|perl_modules|perl_require|perl_set|proxy_bind|proxy_buffer_size|proxy_buffering|proxy_buffers|proxy_busy_buffers_size|proxy_cache|proxy_cache_background_update|proxy_cache_bypass|proxy_cache_convert_head|proxy_cache_key|proxy_cache_lock|proxy_cache_lock_age|proxy_cache_lock_timeout|proxy_cache_max_range_offset|proxy_cache_methods|proxy_cache_min_uses|proxy_cache_path|proxy_cache_purge|proxy_cache_revalidate|proxy_cache_use_stale|proxy_cache_valid|proxy_connect_timeout|proxy_cookie_domain|proxy_cookie_path|proxy_force_ranges|proxy_headers_hash_bucket_size|proxy_headers_hash_max_size|proxy_hide_header|proxy_http_version|proxy_ignore_client_abort|proxy_ignore_headers|proxy_intercept_errors|proxy_limit_rate|proxy_max_temp_file_size|proxy_method|proxy_next_upstream|proxy_next_upstream_timeout|proxy_next_upstream_tries|proxy_no_cache|proxy_pass|proxy_pass_header|proxy_pass_request_body|proxy_pass_request_headers|proxy_read_timeout|proxy_redirect|proxy_send_lowat|proxy_send_timeout|proxy_set_body|proxy_set_header|proxy_socket_keepalive|proxy_ssl_certificate|proxy_ssl_certificate_key|proxy_ssl_ciphers|proxy_ssl_crl|proxy_ssl_name|proxy_ssl_password_file|proxy_ssl_protocols|proxy_ssl_server_name|proxy_ssl_session_reuse|proxy_ssl_trusted_certificate|proxy_ssl_verify|proxy_ssl_verify_depth|proxy_store|proxy_store_access|proxy_temp_file_write_size|proxy_temp_path|random_index|set_real_ip_from|real_ip_header|real_ip_recursive|referer_hash_bucket_size|referer_hash_max_size|valid_referers|break|return|rewrite_log|set|uninitialized_variable_warn|scgi_bind|scgi_buffer_size|scgi_buffering|scgi_buffers|scgi_busy_buffers_size|scgi_cache|scgi_cache_background_update|scgi_cache_key|scgi_cache_lock|scgi_cache_lock_age|scgi_cache_lock_timeout|scgi_cache_max_range_offset|scgi_cache_methods|scgi_cache_min_uses|scgi_cache_path|scgi_cache_purge|scgi_cache_revalidate|scgi_cache_use_stale|scgi_cache_valid|scgi_connect_timeout|scgi_force_ranges|scgi_hide_header|scgi_ignore_client_abort|scgi_ignore_headers|scgi_intercept_errors|scgi_limit_rate|scgi_max_temp_file_size|scgi_next_upstream|scgi_next_upstream_timeout|scgi_next_upstream_tries|scgi_no_cache|scgi_param|scgi_pass|scgi_pass_header|scgi_pass_request_body|scgi_pass_request_headers|scgi_read_timeout|scgi_request_buffering|scgi_send_timeout|scgi_socket_keepalive|scgi_store|scgi_store_access|scgi_temp_file_write_size|scgi_temp_path|secure_link|secure_link_md5|secure_link_secret|session_log|session_log_format|session_log_zone|slice|spdy_chunk_size|spdy_headers_comp|ssi|ssi_last_modified|ssi_min_file_chunk|ssi_silent_errors|ssi_types|ssi_value_length|ssl|ssl_buffer_size|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_client_certificate|ssl_crl|ssl_dhparam|ssl_early_data|ssl_ecdh_curve|ssl_password_file|ssl_prefer_server_ciphers|ssl_protocols|ssl_session_cache|ssl_session_ticket_key|ssl_session_tickets|ssl_session_timeout|ssl_stapling|ssl_stapling_file|ssl_stapling_responder|ssl_stapling_verify|ssl_trusted_certificate|ssl_verify_client|ssl_verify_depth|status|status_format|status_zone|stub_status|sub_filter|sub_filter_last_modified|sub_filter_once|sub_filter_types|server|zone|state|hash|ip_hash|keepalive|keepalive_requests|keepalive_timeout|ntlm|least_conn|least_time|queue|random|sticky|sticky_cookie_insert|upstream_conf|health_check|userid|userid_domain|userid_expires|userid_mark|userid_name|userid_p3p|userid_path|userid_service|uwsgi_bind|uwsgi_buffer_size|uwsgi_buffering|uwsgi_buffers|uwsgi_busy_buffers_size|uwsgi_cache|uwsgi_cache_background_update|uwsgi_cache_bypass|uwsgi_cache_key|uwsgi_cache_lock|uwsgi_cache_lock_age|uwsgi_cache_lock_timeout|uwsgi_cache_max_range_offset|uwsgi_cache_methods|uwsgi_cache_min_uses|uwsgi_cache_path|uwsgi_cache_purge|uwsgi_cache_revalidate|uwsgi_cache_use_stale|uwsgi_cache_valid|uwsgi_connect_timeout|uwsgi_force_ranges|uwsgi_hide_header|uwsgi_ignore_client_abort|uwsgi_ignore_headers|uwsgi_intercept_errors|uwsgi_limit_rate|uwsgi_max_temp_file_size|uwsgi_modifier1|uwsgi_modifier2|uwsgi_next_upstream|uwsgi_next_upstream_timeout|uwsgi_next_upstream_tries|uwsgi_no_cache|uwsgi_param|uwsgi_pass|uwsgi_pass_header|uwsgi_pass_request_body|uwsgi_pass_request_headers|uwsgi_read_timeout|uwsgi_request_buffering|uwsgi_send_timeout|uwsgi_socket_keepalive|uwsgi_ssl_certificate|uwsgi_ssl_certificate_key|uwsgi_ssl_ciphers|uwsgi_ssl_crl|uwsgi_ssl_name|uwsgi_ssl_password_file|uwsgi_ssl_protocols|uwsgi_ssl_server_name|uwsgi_ssl_session_reuse|uwsgi_ssl_trusted_certificate|uwsgi_ssl_verify|uwsgi_ssl_verify_depth|uwsgi_store|uwsgi_store_access|uwsgi_temp_file_write_size|uwsgi_temp_path|http2_body_preread_size|http2_chunk_size|http2_idle_timeout|http2_max_concurrent_pushes|http2_max_concurrent_streams|http2_max_field_size|http2_max_header_size|http2_max_requests|http2_push|http2_push_preload|http2_recv_buffer_size|http2_recv_timeout|xml_entities|xslt_last_modified|xslt_param|xslt_string_param|xslt_stylesheet|xslt_types|listen|protocol|resolver|resolver_timeout|timeout|auth_http|auth_http_header|auth_http_pass_client_cert|auth_http_timeout|proxy_buffer|proxy_pass_error_message|proxy_timeout|xclient|starttls|imap_auth|imap_capabilities|imap_client_buffer|pop3_auth|pop3_capabilities|smtp_auth|smtp_capabilities|smtp_client_buffer|smtp_greeting_delay|preread_buffer_size|preread_timeout|proxy_protocol_timeout|js_access|js_filter|js_preread|proxy_download_rate|proxy_requests|proxy_responses|proxy_upload_rate|ssl_handshake_timeout|ssl_preread|health_check_timeout|zone_sync|zone_sync_buffers|zone_sync_connect_retry_interval|zone_sync_connect_timeout|zone_sync_interval|zone_sync_recv_buffer_size|zone_sync_server|zone_sync_ssl|zone_sync_ssl_certificate|zone_sync_ssl_certificate_key|zone_sync_ssl_ciphers|zone_sync_ssl_crl|zone_sync_ssl_name|zone_sync_ssl_password_file|zone_sync_ssl_protocols|zone_sync_ssl_server_name|zone_sync_ssl_trusted_certificate|zone_sync_ssl_verify_depth|zone_sync_timeout|google_perftools_profiles|proxy|perl";
8
+
9
+ this.$rules = {
10
+ "start": [{
11
+ token: ["storage.type", "text", "string.regexp", "paren.lparen"],
12
+ regex: "\\b(location)(\\s+)([\\^]?~[\\*]?\\s+.*?)({)"
13
+ }, {
14
+ token: ["storage.type", "text", "text", "paren.lparen"],
15
+ regex: "\\b(location|match|upstream)(\\s+)(.*?)({)"
16
+ }, {
17
+ token: ["storage.type", "text", "string", "text", "variable", "text", "paren.lparen"],
18
+ regex: '\\b(split_clients|map)(\\s+)(\\".*\\")(\\s+)(\\$[\\w_]+)(\\s*)({)'
19
+ }, {
20
+ token: ["storage.type", "text", "paren.lparen"],
21
+ regex: "\\b(http|events|server|mail|stream)(\\s*)({)"
22
+ }, {
23
+ token: ["storage.type", "text", "variable", "text", "variable", "text", "paren.lparen"],
24
+ regex: '\\b(geo|map)(\\s+)(\\$[\\w_]+)?(\\s*)(\\$[\\w_]+)(\\s*)({)'
25
+ }, {
26
+ token: "paren.rparen",
27
+ regex: "(})"
28
+ }, {
29
+ token: "paren.lparen",
30
+ regex: "({)"
31
+ }, {
32
+ token: ["storage.type", "text", "paren.lparen"],
33
+ regex: "\\b(if)(\\s+)(\\()",
34
+ push: [{
35
+ token: "paren.rparen",
36
+ regex: "\\)|$",
37
+ next: "pop"
38
+ }, {
39
+ include: "lexical"
40
+ }]
41
+ }, {
42
+ token: "keyword",
43
+ regex: "\\b(" + keywords + ")\\b",
44
+ push: [{
45
+ token: "punctuation",
46
+ regex: ";",
47
+ next: "pop"
48
+ }, {
49
+ include: "lexical"
50
+ }]
51
+ }, {
52
+ token: ["keyword", "text", "string.regexp", "text", "punctuation"],
53
+ regex: "\\b(rewrite)(\\s)(\\S*)(\\s.*)(;)"
54
+ }, {
55
+ include: "lexical"
56
+ }, {
57
+ include: "comments"
58
+ }],
59
+ comments: [{
60
+ token: "comment",
61
+ regex: '#.*$'
62
+ }],
63
+ lexical: [{
64
+ token: "string",
65
+ regex: "'",
66
+ push: [{
67
+ token: "string",
68
+ regex: "'",
69
+ next: "pop"
70
+ }, {
71
+ include: "variables"
72
+ }, {
73
+ defaultToken: "string"
74
+ }]
75
+ }, {
76
+ token: "string",
77
+ regex: '"',
78
+ push: [{
79
+ token: "string",
80
+ regex: '"',
81
+ next: "pop"
82
+ }, {
83
+ include: "variables"
84
+ }, {
85
+ defaultToken: "string"
86
+ }]
87
+ }, {
88
+ token: "string.regexp",
89
+ regex: /[!]?[~][*]?\s+.*(?=\))/
90
+ }, {
91
+ token: "string.regexp",
92
+ regex: /[\^]\S*(?=;$)/
93
+ }, {
94
+ token: "string.regexp",
95
+ regex: /[\^]\S*(?=;|\s|$)/
96
+ }, {
97
+ token: "keyword.operator",
98
+ regex: "\\B(\\+|\\-|\\*|\\=|!=)\\B"
99
+ }, {
100
+ token: "constant.language",
101
+ regex: "\\b(true|false|on|off|all|any|main|always)\\b"
102
+ }, {
103
+ token: "text",
104
+ regex: "\\s+"
105
+ }, {
106
+ include: "variables"
107
+ }
108
+ ],
109
+ variables: [{
110
+ token: "variable",
111
+ regex: "\\$[\\w_]+"
112
+ }, {
113
+ token: "variable.language",
114
+ regex: "\\b(GET|POST|HEAD)\\b"
115
+ }]
116
+ };
117
+ this.normalizeRules();
118
+ };
119
+
120
+
121
+ oop.inherits(NginxHighlightRules, TextHighlightRules);
122
+
123
+ exports.NginxHighlightRules = NginxHighlightRules;
124
+ });
125
+
126
+ define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
127
+ "use strict";
128
+
129
+ var oop = require("../../lib/oop");
130
+ var Range = require("../../range").Range;
131
+ var BaseFoldMode = require("./fold_mode").FoldMode;
132
+
133
+ var FoldMode = exports.FoldMode = function(commentRegex) {
134
+ if (commentRegex) {
135
+ this.foldingStartMarker = new RegExp(
136
+ this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
137
+ );
138
+ this.foldingStopMarker = new RegExp(
139
+ this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
140
+ );
141
+ }
142
+ };
143
+ oop.inherits(FoldMode, BaseFoldMode);
144
+
145
+ (function() {
146
+
147
+ this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
148
+ this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
149
+ this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
150
+ this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
151
+ this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
152
+ this._getFoldWidgetBase = this.getFoldWidget;
153
+ this.getFoldWidget = function(session, foldStyle, row) {
154
+ var line = session.getLine(row);
155
+
156
+ if (this.singleLineBlockCommentRe.test(line)) {
157
+ if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
158
+ return "";
159
+ }
160
+
161
+ var fw = this._getFoldWidgetBase(session, foldStyle, row);
162
+
163
+ if (!fw && this.startRegionRe.test(line))
164
+ return "start"; // lineCommentRegionStart
165
+
166
+ return fw;
167
+ };
168
+
169
+ this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
170
+ var line = session.getLine(row);
171
+
172
+ if (this.startRegionRe.test(line))
173
+ return this.getCommentRegionBlock(session, line, row);
174
+
175
+ var match = line.match(this.foldingStartMarker);
176
+ if (match) {
177
+ var i = match.index;
178
+
179
+ if (match[1])
180
+ return this.openingBracketBlock(session, match[1], row, i);
181
+
182
+ var range = session.getCommentFoldRange(row, i + match[0].length, 1);
183
+
184
+ if (range && !range.isMultiLine()) {
185
+ if (forceMultiline) {
186
+ range = this.getSectionRange(session, row);
187
+ } else if (foldStyle != "all")
188
+ range = null;
189
+ }
190
+
191
+ return range;
192
+ }
193
+
194
+ if (foldStyle === "markbegin")
195
+ return;
196
+
197
+ var match = line.match(this.foldingStopMarker);
198
+ if (match) {
199
+ var i = match.index + match[0].length;
200
+
201
+ if (match[1])
202
+ return this.closingBracketBlock(session, match[1], row, i);
203
+
204
+ return session.getCommentFoldRange(row, i, -1);
205
+ }
206
+ };
207
+
208
+ this.getSectionRange = function(session, row) {
209
+ var line = session.getLine(row);
210
+ var startIndent = line.search(/\S/);
211
+ var startRow = row;
212
+ var startColumn = line.length;
213
+ row = row + 1;
214
+ var endRow = row;
215
+ var maxRow = session.getLength();
216
+ while (++row < maxRow) {
217
+ line = session.getLine(row);
218
+ var indent = line.search(/\S/);
219
+ if (indent === -1)
220
+ continue;
221
+ if (startIndent > indent)
222
+ break;
223
+ var subRange = this.getFoldWidgetRange(session, "all", row);
224
+
225
+ if (subRange) {
226
+ if (subRange.start.row <= startRow) {
227
+ break;
228
+ } else if (subRange.isMultiLine()) {
229
+ row = subRange.end.row;
230
+ } else if (startIndent == indent) {
231
+ break;
232
+ }
233
+ }
234
+ endRow = row;
235
+ }
236
+
237
+ return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
238
+ };
239
+ this.getCommentRegionBlock = function(session, line, row) {
240
+ var startColumn = line.search(/\s*$/);
241
+ var maxRow = session.getLength();
242
+ var startRow = row;
243
+
244
+ var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
245
+ var depth = 1;
246
+ while (++row < maxRow) {
247
+ line = session.getLine(row);
248
+ var m = re.exec(line);
249
+ if (!m) continue;
250
+ if (m[1]) depth--;
251
+ else depth++;
252
+
253
+ if (!depth) break;
254
+ }
255
+
256
+ var endRow = row;
257
+ if (endRow > startRow) {
258
+ return new Range(startRow, startColumn, endRow, line.length);
259
+ }
260
+ };
261
+
262
+ }).call(FoldMode.prototype);
263
+
264
+ });
265
+
266
+ define("ace/mode/nginx",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/nginx_highlight_rules","ace/mode/folding/cstyle"], function (require, exports, module) {
267
+ "use strict";
268
+
269
+ var oop = require("../lib/oop");
270
+ var TextMode = require("./text").Mode;
271
+ var NginxHighlightRules = require("./nginx_highlight_rules").NginxHighlightRules;
272
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
273
+
274
+ var Mode = function () {
275
+ TextMode.call(this);
276
+ this.HighlightRules = NginxHighlightRules;
277
+ this.foldingRules = new CStyleFoldMode();
278
+ this.$behaviour = this.$defaultBehaviour;
279
+ };
280
+
281
+ oop.inherits(Mode, TextMode);
282
+
283
+
284
+ (function () {
285
+ this.lineCommentStart = "#";
286
+
287
+ this.$id = "ace/mode/nginx";
288
+ }).call(Mode.prototype);
289
+
290
+ exports.Mode = Mode;
291
+ }); (function() {
292
+ window.require(["ace/mode/nginx"], function(m) {
293
+ if (typeof module == "object" && typeof exports == "object" && module) {
294
+ module.exports = m;
295
+ }
296
+ });
297
+ })();
298
+