758c22ddcb0f7f798a0977e45b44e905.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. ace.define("ace/mode/lucene_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  2. var oop = require("../lib/oop");
  3. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  4. var LuceneHighlightRules = function () {
  5. this.$rules = {
  6. "start": [
  7. {
  8. token: "constant.language.escape",
  9. regex: /\\[\-+&|!(){}\[\]^"~*?:\\]/
  10. }, {
  11. token: "constant.character.negation",
  12. regex: "\\-"
  13. }, {
  14. token: "constant.character.interro",
  15. regex: "\\?"
  16. }, {
  17. token: "constant.character.required",
  18. regex: "\\+"
  19. }, {
  20. token: "constant.character.asterisk",
  21. regex: "\\*"
  22. }, {
  23. token: 'constant.character.proximity',
  24. regex: '~(?:0\\.[0-9]+|[0-9]+)?'
  25. }, {
  26. token: 'keyword.operator',
  27. regex: '(AND|OR|NOT|TO)\\b'
  28. }, {
  29. token: "paren.lparen",
  30. regex: "[\\(\\{\\[]"
  31. }, {
  32. token: "paren.rparen",
  33. regex: "[\\)\\}\\]]"
  34. }, {
  35. token: "keyword.operator",
  36. regex: /[><=^]/
  37. }, {
  38. token: "constant.numeric",
  39. regex: /\d[\d.-]*/
  40. }, {
  41. token: "string",
  42. regex: /"(?:\\"|[^"])*"/
  43. }, {
  44. token: "keyword",
  45. regex: /(?:\\.|[^\s\-+&|!(){}\[\]^"~*?:\\])+:/,
  46. next: "maybeRegex"
  47. }, {
  48. token: "term",
  49. regex: /\w+/
  50. }, {
  51. token: "text",
  52. regex: /\s+/
  53. }
  54. ],
  55. "maybeRegex": [{
  56. token: "text",
  57. regex: /\s+/
  58. }, {
  59. token: "string.regexp.start",
  60. regex: "/",
  61. next: "regex"
  62. }, {
  63. regex: "",
  64. next: "start"
  65. }],
  66. "regex": [
  67. {
  68. token: "regexp.keyword.operator",
  69. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  70. }, {
  71. token: "string.regexp.end",
  72. regex: "/[sxngimy]*",
  73. next: "no_regex"
  74. }, {
  75. token: "invalid",
  76. regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
  77. }, {
  78. token: "constant.language.escape",
  79. regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
  80. }, {
  81. token: "constant.language.escape",
  82. regex: "<\d+-\d+>|[~&@]"
  83. }, {
  84. token: "constant.language.delimiter",
  85. regex: /\|/
  86. }, {
  87. token: "constant.language.escape",
  88. regex: /\[\^?/,
  89. next: "regex_character_class"
  90. }, {
  91. token: "empty",
  92. regex: "$",
  93. next: "no_regex"
  94. }, {
  95. defaultToken: "string.regexp"
  96. }
  97. ],
  98. "regex_character_class": [
  99. {
  100. token: "regexp.charclass.keyword.operator",
  101. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  102. }, {
  103. token: "constant.language.escape",
  104. regex: "]",
  105. next: "regex"
  106. }, {
  107. token: "constant.language.escape",
  108. regex: "-"
  109. }, {
  110. token: "empty",
  111. regex: "$",
  112. next: "no_regex"
  113. }, {
  114. defaultToken: "string.regexp.charachterclass"
  115. }
  116. ]
  117. };
  118. };
  119. oop.inherits(LuceneHighlightRules, TextHighlightRules);
  120. exports.LuceneHighlightRules = LuceneHighlightRules;
  121. });
  122. ace.define("ace/mode/lucene",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/lucene_highlight_rules"], function(require, exports, module){'use strict';
  123. var oop = require("../lib/oop");
  124. var TextMode = require("./text").Mode;
  125. var LuceneHighlightRules = require("./lucene_highlight_rules").LuceneHighlightRules;
  126. var Mode = function () {
  127. this.HighlightRules = LuceneHighlightRules;
  128. this.$behaviour = this.$defaultBehaviour;
  129. };
  130. oop.inherits(Mode, TextMode);
  131. (function () {
  132. this.$id = "ace/mode/lucene";
  133. }).call(Mode.prototype);
  134. exports.Mode = Mode;
  135. }); (function() {
  136. ace.require(["ace/mode/lucene"], function(m) {
  137. if (typeof module == "object" && typeof exports == "object" && module) {
  138. module.exports = m;
  139. }
  140. });
  141. })();