You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.1 KiB

12 months ago
  1. ace.define("ace/mode/lucene_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(acequire, exports, module) {
  2. "use strict";
  3. var oop = acequire("../lib/oop");
  4. var lang = acequire("../lib/lang");
  5. var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules;
  6. var LuceneHighlightRules = function() {
  7. this.$rules = {
  8. "start" : [
  9. {
  10. token : "constant.character.negation",
  11. regex : "[\\-]"
  12. }, {
  13. token : "constant.character.interro",
  14. regex : "[\\?]"
  15. }, {
  16. token : "constant.character.asterisk",
  17. regex : "[\\*]"
  18. }, {
  19. token: 'constant.character.proximity',
  20. regex: '~[0-9]+\\b'
  21. }, {
  22. token : 'keyword.operator',
  23. regex: '(?:AND|OR|NOT)\\b'
  24. }, {
  25. token : "paren.lparen",
  26. regex : "[\\(]"
  27. }, {
  28. token : "paren.rparen",
  29. regex : "[\\)]"
  30. }, {
  31. token : "keyword",
  32. regex : "[\\S]+:"
  33. }, {
  34. token : "string", // " string
  35. regex : '".*?"'
  36. }, {
  37. token : "text",
  38. regex : "\\s+"
  39. }
  40. ]
  41. };
  42. };
  43. oop.inherits(LuceneHighlightRules, TextHighlightRules);
  44. exports.LuceneHighlightRules = LuceneHighlightRules;
  45. });
  46. ace.define("ace/mode/lucene",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/lucene_highlight_rules"], function(acequire, exports, module) {
  47. 'use strict';
  48. var oop = acequire("../lib/oop");
  49. var TextMode = acequire("./text").Mode;
  50. var LuceneHighlightRules = acequire("./lucene_highlight_rules").LuceneHighlightRules;
  51. var Mode = function() {
  52. this.HighlightRules = LuceneHighlightRules;
  53. this.$behaviour = this.$defaultBehaviour;
  54. };
  55. oop.inherits(Mode, TextMode);
  56. (function() {
  57. this.$id = "ace/mode/lucene";
  58. }).call(Mode.prototype);
  59. exports.Mode = Mode;
  60. });