overleaf/services/web/public/js/ace/mode-gitignore.js

52 lines
1.4 KiB
JavaScript
Raw Normal View History

2014-07-16 06:07:18 -04:00
ace.define("ace/mode/gitignore_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2014-07-09 12:59:04 -04:00
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var GitignoreHighlightRules = function() {
this.$rules = {
"start" : [
{
token : "comment",
regex : /^\s*#.*$/
}, {
token : "keyword", // negated patterns
regex : /^\s*!.*$/
}
]
};
this.normalizeRules();
};
GitignoreHighlightRules.metaData = {
fileTypes: ['gitignore'],
name: 'Gitignore'
};
oop.inherits(GitignoreHighlightRules, TextHighlightRules);
exports.GitignoreHighlightRules = GitignoreHighlightRules;
});
2014-07-16 06:07:18 -04:00
ace.define("ace/mode/gitignore",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gitignore_highlight_rules"], function(require, exports, module) {
2014-07-09 12:59:04 -04:00
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var GitignoreHighlightRules = require("./gitignore_highlight_rules").GitignoreHighlightRules;
var Mode = function() {
this.HighlightRules = GitignoreHighlightRules;
};
oop.inherits(Mode, TextMode);
(function() {
2015-02-12 05:36:57 -05:00
this.lineCommentStart = "#";
2014-07-09 12:59:04 -04:00
this.$id = "ace/mode/gitignore";
}).call(Mode.prototype);
exports.Mode = Mode;
});