ace-rails-ap 3.0.2 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ace/rails/version.rb +1 -1
  3. data/vendor/assets/javascripts/ace/ace.js +403 -326
  4. data/vendor/assets/javascripts/ace/ext-language_tools.js +56 -40
  5. data/vendor/assets/javascripts/ace/ext-modelist.js +7 -3
  6. data/vendor/assets/javascripts/ace/ext-settings_menu.js +8 -4
  7. data/vendor/assets/javascripts/ace/ext-static_highlight.js +12 -5
  8. data/vendor/assets/javascripts/ace/keybinding-vim.js +5234 -1558
  9. data/vendor/assets/javascripts/ace/mode-abap.js +1 -1
  10. data/vendor/assets/javascripts/ace/mode-abc.js +261 -0
  11. data/vendor/assets/javascripts/ace/mode-actionscript.js +47 -1
  12. data/vendor/assets/javascripts/ace/mode-apache_conf.js +47 -1
  13. data/vendor/assets/javascripts/ace/mode-applescript.js +47 -1
  14. data/vendor/assets/javascripts/ace/mode-autohotkey.js +47 -1
  15. data/vendor/assets/javascripts/ace/mode-batchfile.js +47 -1
  16. data/vendor/assets/javascripts/ace/mode-c_cpp.js +101 -56
  17. data/vendor/assets/javascripts/ace/mode-coffee.js +3 -3
  18. data/vendor/assets/javascripts/ace/mode-coldfusion.js +114 -63
  19. data/vendor/assets/javascripts/ace/mode-csharp.js +99 -55
  20. data/vendor/assets/javascripts/ace/mode-css.js +98 -53
  21. data/vendor/assets/javascripts/ace/mode-curly.js +114 -63
  22. data/vendor/assets/javascripts/ace/mode-d.js +47 -1
  23. data/vendor/assets/javascripts/ace/mode-dart.js +103 -58
  24. data/vendor/assets/javascripts/ace/mode-diff.js +85 -85
  25. data/vendor/assets/javascripts/ace/mode-django.js +114 -63
  26. data/vendor/assets/javascripts/ace/mode-dockerfile.js +97 -52
  27. data/vendor/assets/javascripts/ace/mode-dot.js +47 -1
  28. data/vendor/assets/javascripts/ace/mode-eiffel.js +30 -37
  29. data/vendor/assets/javascripts/ace/mode-ejs.js +117 -63
  30. data/vendor/assets/javascripts/ace/mode-elm.js +47 -1
  31. data/vendor/assets/javascripts/ace/mode-erlang.js +47 -1
  32. data/vendor/assets/javascripts/ace/mode-forth.js +47 -1
  33. data/vendor/assets/javascripts/ace/mode-ftl.js +10 -7
  34. data/vendor/assets/javascripts/ace/mode-glsl.js +101 -56
  35. data/vendor/assets/javascripts/ace/mode-golang.js +96 -51
  36. data/vendor/assets/javascripts/ace/mode-groovy.js +98 -53
  37. data/vendor/assets/javascripts/ace/mode-haml.js +3 -0
  38. data/vendor/assets/javascripts/ace/mode-handlebars.js +114 -63
  39. data/vendor/assets/javascripts/ace/mode-haskell.js +49 -3
  40. data/vendor/assets/javascripts/ace/mode-haxe.js +96 -51
  41. data/vendor/assets/javascripts/ace/mode-html.js +114 -63
  42. data/vendor/assets/javascripts/ace/mode-html_ruby.js +117 -63
  43. data/vendor/assets/javascripts/ace/mode-io.js +47 -1
  44. data/vendor/assets/javascripts/ace/mode-jack.js +96 -51
  45. data/vendor/assets/javascripts/ace/mode-jade.js +10 -7
  46. data/vendor/assets/javascripts/ace/mode-java.js +98 -53
  47. data/vendor/assets/javascripts/ace/mode-javascript.js +98 -53
  48. data/vendor/assets/javascripts/ace/mode-json.js +99 -54
  49. data/vendor/assets/javascripts/ace/mode-jsoniq.js +98 -51
  50. data/vendor/assets/javascripts/ace/mode-jsp.js +106 -58
  51. data/vendor/assets/javascripts/ace/mode-jsx.js +96 -51
  52. data/vendor/assets/javascripts/ace/mode-julia.js +47 -1
  53. data/vendor/assets/javascripts/ace/mode-latex.js +1 -1
  54. data/vendor/assets/javascripts/ace/mode-lean.js +281 -0
  55. data/vendor/assets/javascripts/ace/mode-less.js +96 -51
  56. data/vendor/assets/javascripts/ace/mode-liquid.js +10 -7
  57. data/vendor/assets/javascripts/ace/mode-live_script.js +481 -0
  58. data/vendor/assets/javascripts/ace/mode-livescript.js +5 -8
  59. data/vendor/assets/javascripts/ace/mode-logiql.js +49 -50
  60. data/vendor/assets/javascripts/ace/mode-lsl.js +96 -51
  61. data/vendor/assets/javascripts/ace/mode-lua.js +3 -3
  62. data/vendor/assets/javascripts/ace/mode-luapage.js +117 -66
  63. data/vendor/assets/javascripts/ace/mode-makefile.js +1 -1
  64. data/vendor/assets/javascripts/ace/mode-markdown.js +134 -67
  65. data/vendor/assets/javascripts/ace/mode-mask.js +1985 -0
  66. data/vendor/assets/javascripts/ace/mode-mel.js +96 -51
  67. data/vendor/assets/javascripts/ace/mode-mips_assembler.js +235 -0
  68. data/vendor/assets/javascripts/ace/mode-mipsassembler.js +196 -0
  69. data/vendor/assets/javascripts/ace/mode-nix.js +101 -56
  70. data/vendor/assets/javascripts/ace/mode-objectivec.js +52 -6
  71. data/vendor/assets/javascripts/ace/mode-perl.js +47 -1
  72. data/vendor/assets/javascripts/ace/mode-pgsql.js +1 -1
  73. data/vendor/assets/javascripts/ace/mode-php.js +139 -85
  74. data/vendor/assets/javascripts/ace/mode-powershell.js +96 -51
  75. data/vendor/assets/javascripts/ace/mode-praat.js +47 -1
  76. data/vendor/assets/javascripts/ace/mode-prolog.js +47 -1
  77. data/vendor/assets/javascripts/ace/mode-protobuf.js +101 -56
  78. data/vendor/assets/javascripts/ace/mode-rdoc.js +1 -1
  79. data/vendor/assets/javascripts/ace/mode-rhtml.js +114 -63
  80. data/vendor/assets/javascripts/ace/mode-ruby.js +52 -50
  81. data/vendor/assets/javascripts/ace/mode-rust.js +57 -18
  82. data/vendor/assets/javascripts/ace/mode-scad.js +96 -51
  83. data/vendor/assets/javascripts/ace/mode-scala.js +98 -53
  84. data/vendor/assets/javascripts/ace/mode-scss.js +96 -51
  85. data/vendor/assets/javascripts/ace/mode-sh.js +97 -52
  86. data/vendor/assets/javascripts/ace/mode-sjs.js +98 -53
  87. data/vendor/assets/javascripts/ace/mode-smarty.js +114 -63
  88. data/vendor/assets/javascripts/ace/mode-soy_template.js +114 -63
  89. data/vendor/assets/javascripts/ace/mode-stylus.js +1 -1
  90. data/vendor/assets/javascripts/ace/mode-svg.js +132 -65
  91. data/vendor/assets/javascripts/ace/mode-tcl.js +47 -1
  92. data/vendor/assets/javascripts/ace/mode-twig.js +114 -63
  93. data/vendor/assets/javascripts/ace/mode-typescript.js +98 -53
  94. data/vendor/assets/javascripts/ace/mode-vala.js +96 -51
  95. data/vendor/assets/javascripts/ace/mode-velocity.js +114 -63
  96. data/vendor/assets/javascripts/ace/mode-vhdl.js +21 -21
  97. data/vendor/assets/javascripts/ace/mode-xml.js +34 -12
  98. data/vendor/assets/javascripts/ace/mode-xquery.js +98 -51
  99. data/vendor/assets/javascripts/ace/snippets/abc.js +38 -0
  100. data/vendor/assets/javascripts/ace/snippets/elixir.js +7 -0
  101. data/vendor/assets/javascripts/ace/snippets/elm.js +7 -0
  102. data/vendor/assets/javascripts/ace/snippets/lean.js +7 -0
  103. data/vendor/assets/javascripts/ace/snippets/live_script.js +7 -0
  104. data/vendor/assets/javascripts/ace/snippets/mask.js +7 -0
  105. data/vendor/assets/javascripts/ace/snippets/mips_assembler.js +7 -0
  106. data/vendor/assets/javascripts/ace/snippets/mipsassembler.js +7 -0
  107. data/vendor/assets/javascripts/ace/snippets/r.js +1 -1
  108. data/vendor/assets/javascripts/ace/theme-clouds_midnight.js +1 -1
  109. data/vendor/assets/javascripts/ace/theme-github.js +7 -1
  110. data/vendor/assets/javascripts/ace/theme-katzenmilch.js +3 -0
  111. data/vendor/assets/javascripts/ace/theme-kuroir.js +3 -0
  112. data/vendor/assets/javascripts/ace/worker-coffee.js +6 -7
  113. data/vendor/assets/javascripts/ace/worker-css.js +5 -5
  114. data/vendor/assets/javascripts/ace/worker-html.js +4354 -4354
  115. data/vendor/assets/javascripts/ace/worker-javascript.js +2435 -1397
  116. data/vendor/assets/javascripts/ace/worker-json.js +6 -7
  117. data/vendor/assets/javascripts/ace/worker-lua.js +11 -11
  118. data/vendor/assets/javascripts/ace/worker-php.js +4 -8
  119. data/vendor/assets/javascripts/ace/worker-xml.js +3809 -0
  120. data/vendor/assets/javascripts/ace/worker-xquery.js +38 -47
  121. metadata +18 -9
  122. data/vendor/assets/javascripts/ace/ext-options.js +0 -252
  123. data/vendor/assets/javascripts/ace/mode-html_completions.js +0 -309
  124. data/vendor/assets/javascripts/ace/mode-luahtml.js +0 -2415
  125. data/vendor/assets/javascripts/ace/mode-mushcode_high_rules.js +0 -569
  126. data/vendor/assets/javascripts/ace/mode-tmsnippet.js +0 -200
  127. data/vendor/assets/javascripts/ace/theme-kr.js +0 -105
@@ -302,6 +302,19 @@ var initContext = function(editor) {
302
302
  };
303
303
  };
304
304
 
305
+ var getWrapped = function(selection, selected, opening, closing) {
306
+ var rowDiff = selection.end.row - selection.start.row;
307
+ return {
308
+ text: opening + selected + closing,
309
+ selection: [
310
+ 0,
311
+ selection.start.column + 1,
312
+ rowDiff,
313
+ selection.end.column + (rowDiff ? 0 : 1)
314
+ ]
315
+ };
316
+ };
317
+
305
318
  var CstyleBehaviour = function() {
306
319
  this.add("braces", "insertion", function(state, action, editor, session, text) {
307
320
  var cursor = editor.getCursorPosition();
@@ -311,10 +324,7 @@ var CstyleBehaviour = function() {
311
324
  var selection = editor.getSelectionRange();
312
325
  var selected = session.doc.getTextRange(selection);
313
326
  if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
314
- return {
315
- text: '{' + selected + '}',
316
- selection: false
317
- };
327
+ return getWrapped(selection, selected, '{', '}');
318
328
  } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
319
329
  if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) {
320
330
  CstyleBehaviour.recordAutoInsert(editor, session, "}");
@@ -394,10 +404,7 @@ var CstyleBehaviour = function() {
394
404
  var selection = editor.getSelectionRange();
395
405
  var selected = session.doc.getTextRange(selection);
396
406
  if (selected !== "" && editor.getWrapBehavioursEnabled()) {
397
- return {
398
- text: '(' + selected + ')',
399
- selection: false
400
- };
407
+ return getWrapped(selection, selected, '(', ')');
401
408
  } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
402
409
  CstyleBehaviour.recordAutoInsert(editor, session, ")");
403
410
  return {
@@ -442,10 +449,7 @@ var CstyleBehaviour = function() {
442
449
  var selection = editor.getSelectionRange();
443
450
  var selected = session.doc.getTextRange(selection);
444
451
  if (selected !== "" && editor.getWrapBehavioursEnabled()) {
445
- return {
446
- text: '[' + selected + ']',
447
- selection: false
448
- };
452
+ return getWrapped(selection, selected, '[', ']');
449
453
  } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
450
454
  CstyleBehaviour.recordAutoInsert(editor, session, "]");
451
455
  return {
@@ -491,49 +495,44 @@ var CstyleBehaviour = function() {
491
495
  var selection = editor.getSelectionRange();
492
496
  var selected = session.doc.getTextRange(selection);
493
497
  if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
494
- return {
495
- text: quote + selected + quote,
496
- selection: false
497
- };
498
- } else {
498
+ return getWrapped(selection, selected, quote, quote);
499
+ } else if (!selected) {
499
500
  var cursor = editor.getCursorPosition();
500
501
  var line = session.doc.getLine(cursor.row);
501
502
  var leftChar = line.substring(cursor.column-1, cursor.column);
502
- if (leftChar == '\\') {
503
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
504
+
505
+ var token = session.getTokenAt(cursor.row, cursor.column);
506
+ var rightToken = session.getTokenAt(cursor.row, cursor.column + 1);
507
+ if (leftChar == "\\" && token && /escape/.test(token.type))
503
508
  return null;
509
+
510
+ var stringBefore = token && /string/.test(token.type);
511
+ var stringAfter = !rightToken || /string/.test(rightToken.type);
512
+
513
+ var pair;
514
+ if (rightChar == quote) {
515
+ pair = stringBefore !== stringAfter;
516
+ } else {
517
+ if (stringBefore && !stringAfter)
518
+ return null; // wrap string with different quote
519
+ if (stringBefore && stringAfter)
520
+ return null; // do not pair quotes inside strings
521
+ var wordRe = session.$mode.tokenRe;
522
+ wordRe.lastIndex = 0;
523
+ var isWordBefore = wordRe.test(leftChar);
524
+ wordRe.lastIndex = 0;
525
+ var isWordAfter = wordRe.test(leftChar);
526
+ if (isWordBefore || isWordAfter)
527
+ return null; // before or after alphanumeric
528
+ if (rightChar && !/[\s;,.})\]\\]/.test(rightChar))
529
+ return null; // there is rightChar and it isn't closing
530
+ pair = true;
504
531
  }
505
- var tokens = session.getTokens(selection.start.row);
506
- var col = 0, token;
507
- var quotepos = -1; // Track whether we're inside an open quote.
508
-
509
- for (var x = 0; x < tokens.length; x++) {
510
- token = tokens[x];
511
- if (token.type == "string") {
512
- quotepos = -1;
513
- } else if (quotepos < 0) {
514
- quotepos = token.value.indexOf(quote);
515
- }
516
- if ((token.value.length + col) > selection.start.column) {
517
- break;
518
- }
519
- col += tokens[x].value.length;
520
- }
521
- if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
522
- if (!CstyleBehaviour.isSaneInsertion(editor, session))
523
- return;
524
- return {
525
- text: quote + quote,
526
- selection: [1,1]
527
- };
528
- } else if (token && token.type === "string") {
529
- var rightChar = line.substring(cursor.column, cursor.column + 1);
530
- if (rightChar == quote) {
531
- return {
532
- text: '',
533
- selection: [1, 1]
534
- };
535
- }
536
- }
532
+ return {
533
+ text: pair ? quote + quote : "",
534
+ selection: [1,1]
535
+ };
537
536
  }
538
537
  }
539
538
  });
@@ -724,12 +723,35 @@ var FoldMode = exports.FoldMode = function(commentRegex) {
724
723
  oop.inherits(FoldMode, BaseFoldMode);
725
724
 
726
725
  (function() {
727
-
726
+
728
727
  this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
729
728
  this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
729
+ this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
730
+ this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
731
+ this.startRegionRe = /^\s*(\/\*|\/\/)#region\b/;
732
+ this._getFoldWidgetBase = this.getFoldWidget;
733
+ this.getFoldWidget = function(session, foldStyle, row) {
734
+ var line = session.getLine(row);
735
+
736
+ if (this.singleLineBlockCommentRe.test(line)) {
737
+ if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
738
+ return "";
739
+ }
740
+
741
+ var fw = this._getFoldWidgetBase(session, foldStyle, row);
742
+
743
+ if (!fw && this.startRegionRe.test(line))
744
+ return "start"; // lineCommentRegionStart
745
+
746
+ return fw;
747
+ };
730
748
 
731
749
  this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
732
750
  var line = session.getLine(row);
751
+
752
+ if (this.startRegionRe.test(line))
753
+ return this.getCommentRegionBlock(session, line, row);
754
+
733
755
  var match = line.match(this.foldingStartMarker);
734
756
  if (match) {
735
757
  var i = match.index;
@@ -794,6 +816,29 @@ oop.inherits(FoldMode, BaseFoldMode);
794
816
 
795
817
  return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
796
818
  };
819
+
820
+ this.getCommentRegionBlock = function(session, line, row) {
821
+ var startColumn = line.search(/\s*$/);
822
+ var maxRow = session.getLength();
823
+ var startRow = row;
824
+
825
+ var re = /^\s*(?:\/\*|\/\/)#(end)?region\b/;
826
+ var depth = 1;
827
+ while (++row < maxRow) {
828
+ line = session.getLine(row);
829
+ var m = re.exec(line);
830
+ if (!m) continue;
831
+ if (m[1]) depth--;
832
+ else depth++;
833
+
834
+ if (!depth) break;
835
+ }
836
+
837
+ var endRow = row;
838
+ if (endRow > startRow) {
839
+ return new Range(startRow, startColumn, endRow, line.length);
840
+ }
841
+ };
797
842
 
798
843
  }).call(FoldMode.prototype);
799
844
 
@@ -8,7 +8,7 @@ var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|al
8
8
  var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
9
9
  var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero";
10
10
  var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
11
- var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
11
+ var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
12
12
 
13
13
  var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
14
14
  var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
@@ -320,7 +320,7 @@ var JavaScriptHighlightRules = function(options) {
320
320
  regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
321
321
  }, {
322
322
  token : ["punctuation.operator", "support.function.dom"],
323
- regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
323
+ regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
324
324
  }, {
325
325
  token : ["punctuation.operator", "support.constant"],
326
326
  regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
@@ -551,6 +551,9 @@ var oop = require("../lib/oop");
551
551
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
552
552
 
553
553
  var XmlHighlightRules = function(normalize) {
554
+
555
+ var tagRegex = "[a-zA-Z][-_a-zA-Z0-9]*";
556
+
554
557
  this.$rules = {
555
558
  start : [
556
559
  {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
@@ -560,7 +563,7 @@ var XmlHighlightRules = function(normalize) {
560
563
  },
561
564
  {
562
565
  token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
563
- regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "processing_instruction",
566
+ regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction",
564
567
  },
565
568
  {token : "comment.xml", regex : "<\\!--", next : "comment"},
566
569
  {
@@ -576,7 +579,7 @@ var XmlHighlightRules = function(normalize) {
576
579
 
577
580
  xml_decl : [{
578
581
  token : "entity.other.attribute-name.decl-attribute-name.xml",
579
- regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
582
+ regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
580
583
  }, {
581
584
  token : "keyword.operator.decl-attribute-equals.xml",
582
585
  regex : "="
@@ -612,7 +615,7 @@ var XmlHighlightRules = function(normalize) {
612
615
  next: "pop"
613
616
  }, {
614
617
  token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
615
- regex : "(<\\!)([-_a-zA-Z0-9]+)",
618
+ regex : "(<\\!)(" + tagRegex + ")",
616
619
  push : [{
617
620
  token : "text",
618
621
  regex : "\\s+"
@@ -648,7 +651,7 @@ var XmlHighlightRules = function(normalize) {
648
651
 
649
652
  tag : [{
650
653
  token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
651
- regex : "(?:(<)|(</))((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
654
+ regex : "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
652
655
  next: [
653
656
  {include : "attributes"},
654
657
  {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
@@ -679,7 +682,7 @@ var XmlHighlightRules = function(normalize) {
679
682
 
680
683
  attributes: [{
681
684
  token : "entity.other.attribute-name.xml",
682
- regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
685
+ regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
683
686
  }, {
684
687
  token : "keyword.operator.attribute-equals.xml",
685
688
  regex : "="
@@ -0,0 +1,481 @@
1
+ define("ace/mode/live_script_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
+
7
+ var LiveScriptHighlightRules = function() {
8
+
9
+ this.$rules = { start:
10
+ [ { token: 'punctuation.definition.comment.livescript',
11
+ regex: '\\/\\*',
12
+ push:
13
+ [ { token: 'punctuation.definition.comment.livescript',
14
+ regex: '\\*\\/',
15
+ next: 'pop' },
16
+ { token: 'storage.type.annotation.livescriptscript',
17
+ regex: '@\\w*' },
18
+ { defaultToken: 'comment.block.livescript' } ] },
19
+ { token:
20
+ [ 'punctuation.definition.comment.livescript',
21
+ 'comment.line.number-sign.livescript' ],
22
+ regex: '(#)(?!\\{)(.*$)' },
23
+ { token:
24
+ [ 'variable.parameter.function.livescript',
25
+ 'meta.inline.function.livescript',
26
+ 'storage.type.function.livescript',
27
+ 'meta.inline.function.livescript',
28
+ 'variable.parameter.function.livescript',
29
+ 'meta.inline.function.livescript',
30
+ 'storage.type.function.livescript' ],
31
+ regex: '(\\s*\\!?\\(\\s*[^()]*?\\))(\\s*)(!?[~-]{1,2}>)|(\\s*\\!?)(\\(?[^()]*?\\)?)(\\s*)(<[~-]{1,2}!?)',
32
+ comment: 'match stuff like: a -> … ' },
33
+ { token:
34
+ [ 'keyword.operator.new.livescript',
35
+ 'meta.class.instance.constructor',
36
+ 'entity.name.type.instance.livescript' ],
37
+ regex: '(new)(\\s+)(\\w+(?:\\.\\w*)*)' },
38
+ { token: 'keyword.illegal.livescript',
39
+ regex: '\\bp(?:ackage|r(?:ivate|otected)|ublic)|interface|enum|static|yield\\b' },
40
+ { token: 'punctuation.definition.string.begin.livescript',
41
+ regex: '\'\'\'',
42
+ push:
43
+ [ { token: 'punctuation.definition.string.end.livescript',
44
+ regex: '\'\'\'',
45
+ next: 'pop' },
46
+ { defaultToken: 'string.quoted.heredoc.livescript' } ] },
47
+ { token: 'punctuation.definition.string.begin.livescript',
48
+ regex: '"""',
49
+ push:
50
+ [ { token: 'punctuation.definition.string.end.livescript',
51
+ regex: '"""',
52
+ next: 'pop' },
53
+ { token: 'constant.character.escape.livescript',
54
+ regex: '\\\\.' },
55
+ { include: '#interpolated_livescript' },
56
+ { defaultToken: 'string.quoted.double.heredoc.livescript' } ] },
57
+ { token: 'punctuation.definition.string.begin.livescript',
58
+ regex: '``',
59
+ push:
60
+ [ { token: 'punctuation.definition.string.end.livescript',
61
+ regex: '``',
62
+ next: 'pop' },
63
+ { token: 'constant.character.escape.livescript',
64
+ regex: '\\\\(?:x[\\da-fA-F]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)' },
65
+ { defaultToken: 'string.quoted.script.livescript' } ] },
66
+ { token: 'string.array-literal.livescript',
67
+ regex: '<\\[',
68
+ push:
69
+ [ { token: 'string.array-literal.livescript',
70
+ regex: '\\]>',
71
+ next: 'pop' },
72
+ { defaultToken: 'string.array-literal.livescript' } ] },
73
+ { token: 'string.regexp.livescript',
74
+ regex: '/{2}(?![\\s=/*+{}?]).*?[^\\\\]/[igmy]{0,4}(?![a-zA-Z0-9])/{2}' },
75
+ { token: 'string.regexp.livescript',
76
+ regex: '/{2}$',
77
+ push:
78
+ [ { token: 'string.regexp.livescript',
79
+ regex: '/{2}[imgy]{0,4}',
80
+ next: 'pop' },
81
+ { include: '#embedded_spaced_comment' },
82
+ { include: '#interpolated_livescript' },
83
+ { defaultToken: 'string.regexp.livescript' } ] },
84
+ { token: 'string.regexp.livescript',
85
+ regex: '/{2}',
86
+ push:
87
+ [ { token: 'string.regexp.livescript',
88
+ regex: '/{2}[imgy]{0,4}',
89
+ next: 'pop' },
90
+ { token: 'constant.character.escape.livescript',
91
+ regex: '\\\\(?:x[\\da-fA-F]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)' },
92
+ { include: '#interpolated_livescript' },
93
+ { defaultToken: 'string.regexp.livescript' } ] },
94
+ { token: 'string.regexp.livescript',
95
+ regex: '/(?![\\s=/*+{}?]).*?[^\\\\]/[igmy]{0,4}(?![a-zA-Z0-9])' },
96
+ { token: 'keyword.control.livescript',
97
+ regex: '\\b(?<![\\.\\$\\-])(?:t(?:h(?:is|row|en)|ry|ypeof!?|il|o)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction|rom|allthrough)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith|hen)|o(?:f|r|therwise)|return|break|let|var|loop|match|by)(?!\\-|\\s*:)\\b',
98
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
99
+ originalRegex: '(?x)\n\t\t\t\t\\b(?<![\\.\\$\\-])(?:\n\t\t t(?:h(?:is|row|en)|ry|ypeof!?|il|o)\n\t\t |c(?:on(?:tinue|st)|a(?:se|tch)|lass)\n\t\t |i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])\n\t\t |d(?:e(?:fault|lete|bugger)|o)\n\t\t |f(?:or(?:\\s+own)?|inally|unction|rom|allthrough)\n\t\t |s(?:uper|witch)\n\t\t |e(?:lse|x(?:tends|port)|val)\n\t\t |a(?:nd|rguments)\n\t\t |n(?:ew|ot)\n\t\t |un(?:less|til)\n\t\t |w(?:hile|ith|hen)\n\t\t |o(?:f|r|therwise)\n\t\t |return|break|let|var|loop\n\t\t |match\n\t\t |by\n\t\t\t\t)(?!\\-|\\s*:)\\b\n\t\t\t' },
100
+ { token: 'keyword.operator.livescript',
101
+ regex: '\\b(?<![\\.\\$\\-])(?:instanceof|new|delete|typeof|and|or|is|isnt|not)(?!\\-|\\s*:)\\b',
102
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
103
+ originalRegex: '(?x)\n\t\t\t\t\\b(?<![\\.\\$\\-])(\n\t\t\t\t\tinstanceof|new|delete|typeof|and|or|is|isnt|not\n\t\t\t\t)(?!\\-|\\s*:)\\b\n\t\t\t' },
104
+ { token: 'keyword.operator.livescript',
105
+ regex: 'and=|or=|%|&|\\^|\\*|\\/|(?<![a-zA-Z$_])(?:\\-)?\\-(?!\\-?>)|\\+\\+|\\+|~(?!~?>)|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<(?!\\[)|(?<!\\])>|(?<!\\w)!(?!(?:[~\\-]+)?>)|&&|\\.\\.(?:\\.)?|\\s\\.\\s|\\?|\\||\\|\\||\\:|\\*=|(?<!\\()/=|%=|\\+=|\\-=|\\.=|&=|\\(\\.|\\.\\)|\\^=',
106
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
107
+ originalRegex: '(?x)\n\t\t\t\tand=|or=|%|&|\\^|\\*|\\/|(?<![a-zA-Z$_])(\\-)?\\-(?!\\-?>)|\\+\\+|\\+|\n\t\t\t\t~(?!~?>)|==|=|!=|<=|>=|<<=|>>=|\n\t\t\t\t>>>=|<>|<(?!\\[)|(?<!\\])>|(?<!\\w)!(?!([~\\-]+)?>)|&&|\\.\\.(\\.)?|\\s\\.\\s|\\?|\\||\\|\\||\\:|\\*=|(?<!\\()/=|%=|\\+=|\\-=|\\.=|&=|\\(\\.|\\.\\)|\n\t\t\t\t\\^=\n\t\t\t' },
108
+ { token:
109
+ [ 'variable.assignment.livescript',
110
+ 'variable.assignment.livescript',
111
+ 'variable.assignment.livescript',
112
+ 'punctuation.separator.key-value',
113
+ 'keyword.operator.livescript',
114
+ 'variable.assignment.livescript' ],
115
+ regex: '([a-zA-Z\\$_])((?:[\\w$.-])*)(\\s*)(?!\\::)(?:(:)|(=))(\\s*)(?!(?:\\s*!?\\s*\\(.*\\))?\\s*!?[~-]{1,2}>)' },
116
+ { token: 'keyword.operator.livescript',
117
+ regex: '(?<=\\s|^)[\\[\\{](?=.*?[\\]\\}]\\s+[:=])',
118
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
119
+ originalRegex: '(?<=\\s|^)([\\[\\{])(?=.*?[\\]\\}]\\s+[:=])',
120
+ push:
121
+ [ { token: 'keyword.operator.livescript',
122
+ regex: '[\\]\\}]\\s*[:=]',
123
+ next: 'pop' },
124
+ { include: '#variable_name' },
125
+ { include: '#instance_variable' },
126
+ { include: '#single_quoted_string' },
127
+ { include: '#double_quoted_string' },
128
+ { include: '#numeric' },
129
+ { defaultToken: 'meta.variable.assignment.destructured.livescript' } ] },
130
+ { token:
131
+ [ 'meta.function.livescript',
132
+ 'entity.name.function.livescript',
133
+ 'entity.name.function.livescript',
134
+ 'entity.name.function.livescript',
135
+ 'entity.name.function.livescript',
136
+ 'variable.parameter.function.livescript',
137
+ 'entity.name.function.livescript',
138
+ 'storage.type.function.livescript' ],
139
+ regex: '(\\s*)(?=[a-zA-Z\\$_])([a-zA-Z\\$_])((?:[\\w$.:-])*)(\\s*)([:=])((?:\\s*!?\\s*\\(.*\\))?)(\\s*)(!?[~-]{1,2}>)' },
140
+ { token: 'storage.type.function.livescript',
141
+ regex: '!?[~-]{1,2}>' },
142
+ { token: 'constant.language.boolean.true.livescript',
143
+ regex: '\\b(?<!\\.)(?:true|on|yes)(?!\\s*[:=])\\b',
144
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
145
+ originalRegex: '\\b(?<!\\.)(true|on|yes)(?!\\s*[:=])\\b' },
146
+ { token: 'constant.language.boolean.false.livescript',
147
+ regex: '\\b(?<!\\.)(?:false|off|no)(?!\\s*[:=])\\b',
148
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
149
+ originalRegex: '\\b(?<!\\.)(false|off|no)(?!\\s*[:=])\\b' },
150
+ { token: 'constant.language.null.livescript',
151
+ regex: '\\b(?<!\\.)(?:null|void)(?!\\s*[:=])\\b',
152
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
153
+ originalRegex: '\\b(?<!\\.)(null|void)(?!\\s*[:=])\\b' },
154
+ { token: 'variable.language.livescript',
155
+ regex: '\\b(?<!\\.)(?:super|this|extends)(?!\\s*[:=])\\b',
156
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
157
+ originalRegex: '\\b(?<!\\.)(super|this|extends)(?!\\s*[:=])\\b' },
158
+ { token:
159
+ [ 'storage.type.class.livescript',
160
+ 'meta.class.livescript',
161
+ 'entity.name.type.class.livescript',
162
+ 'meta.class.livescript',
163
+ 'keyword.control.inheritance.livescript',
164
+ 'meta.class.livescript',
165
+ 'entity.other.inherited-class.livescript' ],
166
+ regex: '(class\\b)(\\s+)((?:@?[a-zA-Z$_][\\w$.-]*)?)(?:(\\s+)(extends)(\\s+)(@?[a-zA-Z$_][\\w$.-]*))?' },
167
+ { token: 'keyword.other.livescript',
168
+ regex: '\\b(?:debugger|\\\\)\\b' },
169
+ { token: 'support.class.livescript',
170
+ regex: '\\b(?:Array|ArrayBuffer|Blob|Boolean|Date|document|event|Function|Int(?:8|16|32|64)Array|Math|Map|Number|Object|Proxy|RegExp|Set|String|WeakMap|window|Uint(?:8|16|32|64)Array|XMLHttpRequest)\\b' },
171
+ { token: 'entity.name.type.object.livescript',
172
+ regex: '\\bconsole\\b' },
173
+ { token: 'support.function.console.livescript',
174
+ regex: '(?<=console\\.)(?:debug|warn|info|log|error|time(?:End|-end)|assert)\\b',
175
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
176
+ originalRegex: '((?<=console\\.)(debug|warn|info|log|error|time(End|-end)|assert))\\b' },
177
+ { token: 'support.function.livescript',
178
+ regex: '\\b(?:decodeURI(?:Component)?|encodeURI(?:Component)?|eval|parse(?:Float|Int)|require)\\b' },
179
+ { token: 'support.function.prelude.livescript',
180
+ regex: '(?<![.-])\\b(?:map|filter|reject|partition|find|each|head|tail|last|initial|empty|values|keys|length|cons|append|join|reverse|fold(?:l|r)?1?|unfoldr|and(?:List|-list)|or(?:List|-list)|any|all|unique|sum|product|mean|compact|concat(?:Map|-map)?|maximum|minimum|scan(?:l|r)?1?|replicate|slice|apply|split(?:At|-at)?|take(?:While|-while)?|drop(?:While|-while)?|span|first|break(?:It|-it)|list(?:ToObj|-to-obj)|obj(?:ToFunc|-to-func)|pairs(?:ToObj|-to-obj)|obj(?:ToPairs|-to-pairs|ToLists|-to-lists)|zip(?:All|-all)?(?:With|-with)?|compose|curry|partial|flip|fix|sort(?:With|-with|By|-by)?|group(?:By|-by)|break(?:List|-list|Str|-str)|difference|intersection|union|average|flatten|chars|unchars|repeat|lines|unlines|words|unwords|max|min|negate|abs|signum|quot|rem|div|mod|recip|pi|tau|exp|sqrt|ln|pow|sin|cos|tan|asin|acos|atan|atan2|truncate|round|ceiling|floor|is(?:It|-it)NaN|even|odd|gcd|lcm|disabled__id)\\b(?![.-])',
181
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
182
+ originalRegex: '(?x)(?<![.-])\\b(\n\t\t\t\tmap|filter|reject|partition|find|each|head|tail|last|initial|empty|\n\t\t\t\tvalues|keys|length|cons|append|join|reverse|fold(l|r)?1?|unfoldr|\n\t\t\t\tand(List|-list)|or(List|-list)|any|all|unique|sum|product|mean|compact|\n\t\t\t\tconcat(Map|-map)?|maximum|minimum|scan(l|r)?1?|replicate|slice|apply|\n\t\t\t\tsplit(At|-at)?|take(While|-while)?|drop(While|-while)?|span|first|\n\t\t\t\tbreak(It|-it)|list(ToObj|-to-obj)|obj(ToFunc|-to-func)|\n\t\t\t\tpairs(ToObj|-to-obj)|obj(ToPairs|-to-pairs|ToLists|-to-lists)|\n\t\t\t\tzip(All|-all)?(With|-with)?|compose|curry|partial|flip|fix|\n\t\t\t\tsort(With|-with|By|-by)?|group(By|-by)|break(List|-list|Str|-str)|\n\t\t\t\tdifference|intersection|union|average|flatten|chars|unchars|repeat|\n\t\t\t\tlines|unlines|words|unwords|max|min|negate|abs|signum|quot|rem|div|mod|\n\t\t\t\trecip|pi|tau|exp|sqrt|ln|pow|sin|cos|tan|asin|acos|atan|atan2|truncate|\n\t\t\t\tround|ceiling|floor|is(It|-it)NaN|even|odd|gcd|lcm|disabled__id\n\t\t\t)\\b(?![.-])',
183
+ comment: 'Generated by DOM query from http://gkz.github.com/prelude-ls/:\n\t [].slice\n\t .call(document.querySelectorAll(".nav-pills li a"))\n\t .map(function(_) {return _.innerText})\n\t .filter(function(_) {return _.trim() !== \'})\n\t .slice(2)\n\t .join("|")\n \t\t' },
184
+ { token: 'support.function.semireserved.livescript',
185
+ regex: '(?<![.-])\\b(?:that|it|e)\\b',
186
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
187
+ originalRegex: '(?x)(?<![.-])\\b(that|it|e)\\b' },
188
+ { token: 'support.function.method.array.livescript',
189
+ regex: '(?<=(?:\\.|\\]|\\)))(?:apply|call|concat|every|filter|for(?:Each|-each)|from|has(?:Own|-own)(?:Property|-property)|index(?:Of|-of)|is(?:Prototype|-prototype)(?:Of|-of)|join|last(?:Index|-index)(?:Of|-of)|map|of|pop|property(?:Is|-is)(?:Enumerable|-enumerable)|push|reduce(?:Right|-right)?|reverse|shift|slice|some|sort|splice|to(?:Locale|-locale)?(?:String|-string)|unshift|valueOf)\\b(?!-)',
190
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
191
+ originalRegex: '(?x)((?<=(\\.|\\]|\\)))(\n\t\t\t\tapply|call|concat|every|filter|for(Each|-each)|\n\t\t\t\tfrom|has(Own|-own)(Property|-property)|index(Of|-of)|\n\t\t\t\tis(Prototype|-prototype)(Of|-of)|join|last(Index|-index)(Of|-of)|\n\t\t\t\tmap|of|pop|property(Is|-is)(Enumerable|-enumerable)|push|\n\t\t\t\treduce(Right|-right)?|reverse|shift|slice|some|sort|\n\t\t\t\tsplice|to(Locale|-locale)?(String|-string)|unshift|valueOf\n\t\t\t))\\b(?!-) ' },
192
+ { token: 'support.function.static.array.livescript',
193
+ regex: '(?<=Array\\.)isArray\\b',
194
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
195
+ originalRegex: '(?x)((?<=Array\\.)(\n\t\t\t\tisArray\n\t\t\t))\\b' },
196
+ { token: 'support.function.static.object.livescript',
197
+ regex: '(?<=Object\\.)(?:create|define(?:Propert|-propert)(?:ies|y)|freeze|get(?:Own|-own)(?:Property|-property)(?:Descriptors?|Names)|get(?:Property|-property)(?:Descriptor|Names)|getPrototypeOf|is(?:(?:Extensible|-extensible)|(?:Frozen|-frozen)|(?:Sealed|-sealed))?|keys|prevent(?:Extensions|-extensions)|seal)\\b',
198
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
199
+ originalRegex: '(?x)((?<=Object\\.)(\n\t\t\t\tcreate|define(Propert|-propert)(ies|y)|freeze|\n\t\t\t\tget(Own|-own)(Property|-property)(Descriptors?|Names)|\n\t\t\t\tget(Property|-property)(Descriptor|Names)|getPrototypeOf|\n\t\t\t\tis((Extensible|-extensible)|(Frozen|-frozen)|(Sealed|-sealed))?|\n\t\t\t\tkeys|prevent(Extensions|-extensions)|seal\n\t\t\t))\\b' },
200
+ { token: 'support.function.static.math.livescript',
201
+ regex: '(?<=Math\\.)(?:abs|acos|acosh|asin|asinh|atan|atan2|atanh|ceil|cos|cosh|exp|expm1|floor|hypot|log|log10|log1p|log2|max|min|pow|random|round|sign|sin|sinh|sqrt|tan|tanh|trunc)\\b',
202
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
203
+ originalRegex: '(?x)((?<=Math\\.)(\n\t\t\t\tabs|acos|acosh|asin|asinh|atan|atan2|atanh|ceil|cos|cosh|exp|expm1|floor|\n\t\t\t\thypot|log|log10|log1p|log2|max|min|pow|random|round|sign|sin|sinh|sqrt|\n\t\t\t\ttan|tanh|trunc\n\t\t\t))\\b' },
204
+ { token: 'support.function.static.number.livescript',
205
+ regex: '(?<=Number\\.)(?:is(?:Finite|Integer|NaN)|to(?:Integer|-integer))\\b',
206
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
207
+ originalRegex: '(?x)((?<=Number\\.)(\n\t\t\t\tis(Finite|Integer|NaN)|to(Integer|-integer)\n\t\t\t))\\b' },
208
+ { token: 'constant.language.livescript',
209
+ regex: '\\b(?:Infinity|NaN|undefined)\\b' },
210
+ { token: 'punctuation.terminator.statement.livescript',
211
+ regex: '\\;' },
212
+ { token: 'meta.delimiter.object.comma.livescript',
213
+ regex: ',[ |\\t]*' },
214
+ { token: 'meta.delimiter.method.period.livescript',
215
+ regex: '\\.' },
216
+ { token: 'meta.brace.curly.livescript', regex: '\\{|\\}' },
217
+ { token: 'meta.brace.round.livescript', regex: '\\(|\\)' },
218
+ { token: 'meta.brace.square.livescript', regex: '\\[|\\]\\s*' },
219
+ { include: '#instance_variable' },
220
+ { include: '#backslash_string' },
221
+ { include: '#single_quoted_string' },
222
+ { include: '#double_quoted_string' },
223
+ { include: '#numeric' } ],
224
+ '#backslash_string':
225
+ [ { token: 'string.quoted.single.livescript',
226
+ regex: '\\\\(?:[\\\\)\\s,\\};\\]])?',
227
+ push:
228
+ [ { token: 'punctuation.definition.string.end.livescript',
229
+ regex: '[\\\\)\\s,\\};\\]]',
230
+ next: 'pop' },
231
+ { defaultToken: 'string.quoted.single.livescript' } ] } ],
232
+ '#double_quoted_string':
233
+ [ { token: 'punctuation.definition.string.begin.livescript',
234
+ regex: '"',
235
+ push:
236
+ [ { token: 'punctuation.definition.string.end.livescript',
237
+ regex: '"',
238
+ next: 'pop' },
239
+ { token: 'constant.character.escape.livescript',
240
+ regex: '\\\\(?:x[\\da-fA-F]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)' },
241
+ { include: '#interpolated_livescript' },
242
+ { defaultToken: 'string.quoted.double.livescript' } ] } ],
243
+ '#embedded_comment':
244
+ [ { token:
245
+ [ 'punctuation.definition.comment.livescript',
246
+ 'comment.line.number-sign.livescript' ],
247
+ regex: '(?<!\\\\)(#)(.*$)',
248
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
249
+ originalRegex: '(?<!\\\\)(#).*$\\n' } ],
250
+ '#embedded_spaced_comment':
251
+ [ { token:
252
+ [ 'punctuation.definition.comment.livescript',
253
+ 'comment.line.number-sign.livescript' ],
254
+ regex: '(?<!\\\\)(#\\s)(.*$)',
255
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
256
+ originalRegex: '(?<!\\\\)(#\\s).*$\\n' } ],
257
+ '#constructor_variable':
258
+ [ { token: 'variable.other.readwrite.constructor.livescript',
259
+ regex: '[a-zA-Z$_][\\w$-]*@{2}(?:[a-zA-Z$_][\\w$-]*)?' } ],
260
+ '#instance_variable':
261
+ [ { token: 'variable.other.readwrite.instance.livescript',
262
+ regex: '(?<!\\S)@(?:[a-zA-Z$_][\\w$-]*)?',
263
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
264
+ originalRegex: '(?<!\\S)(@)([a-zA-Z$_][\\w$-]*)?' } ],
265
+ '#interpolated_livescript':
266
+ [ { todo:
267
+ { token: 'punctuation.section.embedded.livescript',
268
+ regex: '\\#\\{',
269
+ push:
270
+ [ { token: 'punctuation.section.embedded.livescript',
271
+ regex: '\\}',
272
+ next: 'pop' },
273
+ { include: '$self' },
274
+ { defaultToken: 'source.livescript.embedded.source' } ] } },
275
+ { todo:
276
+ { token: 'source.livescript.embedded.source.simple',
277
+ regex: '\\#',
278
+ push:
279
+ [ { token: 'source.livescript.embedded.source.simple',
280
+ regex: '',
281
+ next: 'pop' },
282
+ { include: '$self' },
283
+ { defaultToken: 'source.livescript.embedded.source.simple' } ] } } ],
284
+ '#numeric':
285
+ [ { token: 'constant.numeric.livescript',
286
+ regex: '(?<![\\$@a-zA-Z_])(?:[0-9]+r[0-9_]+|(?:16r|0[xX])[0-9a-fA-F_]+|[0-9]+(?:\\.[0-9_]+)?(?:e[+\\-]?[0-9_]+)?[_a-zA-Z]*)',
287
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
288
+ originalRegex: '(?<![\\$@a-zA-Z_])(([0-9]+r[0-9_]+)|((16r|0[xX])[0-9a-fA-F_]+)|([0-9]+(\\.[0-9_]+)?(e[+\\-]?[0-9_]+)?)[_a-zA-Z]*)' } ],
289
+ '#single_quoted_string':
290
+ [ { token: 'punctuation.definition.string.begin.livescript',
291
+ regex: '\'',
292
+ push:
293
+ [ { token: 'punctuation.definition.string.end.livescript',
294
+ regex: '\'',
295
+ next: 'pop' },
296
+ { token: 'constant.character.escape.livescript',
297
+ regex: '\\\\(?:x[\\da-fA-F]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)' },
298
+ { defaultToken: 'string.quoted.single.livescript' } ] } ],
299
+ '#variable_name':
300
+ [ { token: 'variable.assignment.livescript',
301
+ regex: '[a-zA-Z\\$_][\\w$-]*(?:\\.\\w+)*(?!\\-)' } ] }
302
+
303
+ this.normalizeRules();
304
+ };
305
+
306
+ LiveScriptHighlightRules.metaData = { comment: 'LiveScript Syntax: version 1',
307
+ fileTypes: [ 'ls', 'Slakefile', 'ls.erb' ],
308
+ firstLineMatch: '^#!.*\\bls',
309
+ foldingStartMarker: '^\\s*class\\s+\\S.*$|.*(->|=>)\\s*$|.*[\\[{]\\s*$',
310
+ foldingStopMarker: '^\\s*$|^\\s*[}\\]]\\s*$',
311
+ keyEquivalent: '^~C',
312
+ name: 'LiveScript',
313
+ scopeName: 'source.livescript' }
314
+
315
+
316
+ oop.inherits(LiveScriptHighlightRules, TextHighlightRules);
317
+
318
+ exports.LiveScriptHighlightRules = LiveScriptHighlightRules;
319
+ });
320
+
321
+ define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
322
+ "use strict";
323
+
324
+ var oop = require("../../lib/oop");
325
+ var Range = require("../../range").Range;
326
+ var BaseFoldMode = require("./fold_mode").FoldMode;
327
+
328
+ var FoldMode = exports.FoldMode = function(commentRegex) {
329
+ if (commentRegex) {
330
+ this.foldingStartMarker = new RegExp(
331
+ this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
332
+ );
333
+ this.foldingStopMarker = new RegExp(
334
+ this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
335
+ );
336
+ }
337
+ };
338
+ oop.inherits(FoldMode, BaseFoldMode);
339
+
340
+ (function() {
341
+
342
+ this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
343
+ this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
344
+ this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
345
+ this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
346
+ this.startRegionRe = /^\s*(\/\*|\/\/)#region\b/;
347
+ this._getFoldWidgetBase = this.getFoldWidget;
348
+ this.getFoldWidget = function(session, foldStyle, row) {
349
+ var line = session.getLine(row);
350
+
351
+ if (this.singleLineBlockCommentRe.test(line)) {
352
+ if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
353
+ return "";
354
+ }
355
+
356
+ var fw = this._getFoldWidgetBase(session, foldStyle, row);
357
+
358
+ if (!fw && this.startRegionRe.test(line))
359
+ return "start"; // lineCommentRegionStart
360
+
361
+ return fw;
362
+ };
363
+
364
+ this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
365
+ var line = session.getLine(row);
366
+
367
+ if (this.startRegionRe.test(line))
368
+ return this.getCommentRegionBlock(session, line, row);
369
+
370
+ var match = line.match(this.foldingStartMarker);
371
+ if (match) {
372
+ var i = match.index;
373
+
374
+ if (match[1])
375
+ return this.openingBracketBlock(session, match[1], row, i);
376
+
377
+ var range = session.getCommentFoldRange(row, i + match[0].length, 1);
378
+
379
+ if (range && !range.isMultiLine()) {
380
+ if (forceMultiline) {
381
+ range = this.getSectionRange(session, row);
382
+ } else if (foldStyle != "all")
383
+ range = null;
384
+ }
385
+
386
+ return range;
387
+ }
388
+
389
+ if (foldStyle === "markbegin")
390
+ return;
391
+
392
+ var match = line.match(this.foldingStopMarker);
393
+ if (match) {
394
+ var i = match.index + match[0].length;
395
+
396
+ if (match[1])
397
+ return this.closingBracketBlock(session, match[1], row, i);
398
+
399
+ return session.getCommentFoldRange(row, i, -1);
400
+ }
401
+ };
402
+
403
+ this.getSectionRange = function(session, row) {
404
+ var line = session.getLine(row);
405
+ var startIndent = line.search(/\S/);
406
+ var startRow = row;
407
+ var startColumn = line.length;
408
+ row = row + 1;
409
+ var endRow = row;
410
+ var maxRow = session.getLength();
411
+ while (++row < maxRow) {
412
+ line = session.getLine(row);
413
+ var indent = line.search(/\S/);
414
+ if (indent === -1)
415
+ continue;
416
+ if (startIndent > indent)
417
+ break;
418
+ var subRange = this.getFoldWidgetRange(session, "all", row);
419
+
420
+ if (subRange) {
421
+ if (subRange.start.row <= startRow) {
422
+ break;
423
+ } else if (subRange.isMultiLine()) {
424
+ row = subRange.end.row;
425
+ } else if (startIndent == indent) {
426
+ break;
427
+ }
428
+ }
429
+ endRow = row;
430
+ }
431
+
432
+ return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
433
+ };
434
+
435
+ this.getCommentRegionBlock = function(session, line, row) {
436
+ var startColumn = line.search(/\s*$/);
437
+ var maxRow = session.getLength();
438
+ var startRow = row;
439
+
440
+ var re = /^\s*(?:\/\*|\/\/)#(end)?region\b/;
441
+ var depth = 1;
442
+ while (++row < maxRow) {
443
+ line = session.getLine(row);
444
+ var m = re.exec(line);
445
+ if (!m) continue;
446
+ if (m[1]) depth--;
447
+ else depth++;
448
+
449
+ if (!depth) break;
450
+ }
451
+
452
+ var endRow = row;
453
+ if (endRow > startRow) {
454
+ return new Range(startRow, startColumn, endRow, line.length);
455
+ }
456
+ };
457
+
458
+ }).call(FoldMode.prototype);
459
+
460
+ });
461
+
462
+ define("ace/mode/live_script",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/live_script_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) {
463
+ "use strict";
464
+
465
+ var oop = require("../lib/oop");
466
+ var TextMode = require("./text").Mode;
467
+ var LiveScriptHighlightRules = require("./live_script_highlight_rules").LiveScriptHighlightRules;
468
+ var FoldMode = require("./folding/cstyle").FoldMode;
469
+
470
+ var Mode = function() {
471
+ this.HighlightRules = LiveScriptHighlightRules;
472
+ this.foldingRules = new FoldMode();
473
+ };
474
+ oop.inherits(Mode, TextMode);
475
+
476
+ (function() {
477
+ this.$id = "ace/mode/live_script"
478
+ }).call(Mode.prototype);
479
+
480
+ exports.Mode = Mode;
481
+ });