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.

52 lines
1.5 KiB

12 months ago
  1. ace.define("ace/mode/gitignore_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(acequire, exports, module) {
  2. "use strict";
  3. var oop = acequire("../lib/oop");
  4. var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules;
  5. var GitignoreHighlightRules = function() {
  6. this.$rules = {
  7. "start" : [
  8. {
  9. token : "comment",
  10. regex : /^\s*#.*$/
  11. }, {
  12. token : "keyword", // negated patterns
  13. regex : /^\s*!.*$/
  14. }
  15. ]
  16. };
  17. this.normalizeRules();
  18. };
  19. GitignoreHighlightRules.metaData = {
  20. fileTypes: ['gitignore'],
  21. name: 'Gitignore'
  22. };
  23. oop.inherits(GitignoreHighlightRules, TextHighlightRules);
  24. exports.GitignoreHighlightRules = GitignoreHighlightRules;
  25. });
  26. ace.define("ace/mode/gitignore",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gitignore_highlight_rules"], function(acequire, exports, module) {
  27. "use strict";
  28. var oop = acequire("../lib/oop");
  29. var TextMode = acequire("./text").Mode;
  30. var GitignoreHighlightRules = acequire("./gitignore_highlight_rules").GitignoreHighlightRules;
  31. var Mode = function() {
  32. this.HighlightRules = GitignoreHighlightRules;
  33. this.$behaviour = this.$defaultBehaviour;
  34. };
  35. oop.inherits(Mode, TextMode);
  36. (function() {
  37. this.lineCommentStart = "#";
  38. this.$id = "ace/mode/gitignore";
  39. }).call(Mode.prototype);
  40. exports.Mode = Mode;
  41. });