create tokenizer only when needed
This commit is contained in:
parent
bc4b1324b7
commit
811d190c95
95 changed files with 122 additions and 281 deletions
|
|
@ -39,9 +39,7 @@ var TextMode = require("./text").Mode;
|
|||
var oop = require("../lib/oop");
|
||||
|
||||
function Mode() {
|
||||
var highlighter = new Rules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = new Rules(highlighter.$keywordList);
|
||||
this.HighlightRules = Rules;
|
||||
this.foldingRules = new FoldMode();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,16 +48,14 @@ var ActionScriptHighlightRules = require("./actionscript_highlight_rules").Actio
|
|||
var FoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new ActionScriptHighlightRules();
|
||||
this.HighlightRules = ActionScriptHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "//";
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ var AdaHighlightRules = require("./ada_highlight_rules").AdaHighlightRules;
|
|||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new AdaHighlightRules().getRules());
|
||||
this.HighlightRules = AdaHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -38,9 +38,8 @@ var AsciidocHighlightRules = require("./asciidoc_highlight_rules").AsciidocHighl
|
|||
var AsciidocFoldMode = require("./folding/asciidoc").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new AsciidocHighlightRules();
|
||||
this.HighlightRules = AsciidocHighlightRules;
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.foldingRules = new AsciidocFoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
|
|
|||
|
|
@ -43,15 +43,13 @@ var AssemblyX86HighlightRules = require("./assembly_x86_highlight_rules").Assemb
|
|||
var FoldMode = require("./folding/coffee").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new AssemblyX86HighlightRules();
|
||||
this.HighlightRules = AssemblyX86HighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = ";";
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -48,16 +48,14 @@ var AutoHotKeyHighlightRules = require("./autohotkey_highlight_rules").AutoHotKe
|
|||
var FoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new AutoHotKeyHighlightRules();
|
||||
this.HighlightRules = AutoHotKeyHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "/\\*";
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -47,16 +47,14 @@ var BatchFileHighlightRules = require("./batchfile_highlight_rules").BatchFileHi
|
|||
var FoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new BatchFileHighlightRules();
|
||||
this.HighlightRules = BatchFileHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "::";
|
||||
this.blockComment = "";
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutd
|
|||
var C9StyleFoldMode = require("./folding/c9search").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new C9SearchHighlightRules().getRules());
|
||||
this.HighlightRules = C9SearchHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.foldingRules = new C9StyleFoldMode();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -41,12 +41,10 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
|||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new c_cppHighlightRules();
|
||||
this.HighlightRules = c_cppHighlightRules;
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -39,9 +39,7 @@ var MatchingParensOutdent = require("./matching_parens_outdent").MatchingParensO
|
|||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new ClojureHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.HighlightRules = ClojureHighlightRules;
|
||||
this.$outdent = new MatchingParensOutdent();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ var CobolHighlightRules = require("./cobol_highlight_rules").CobolHighlightRules
|
|||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new CobolHighlightRules().getRules());
|
||||
this.HighlightRules = CobolHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -41,10 +41,8 @@ var WorkerClient = require("../worker/worker_client").WorkerClient;
|
|||
var oop = require("../lib/oop");
|
||||
|
||||
function Mode() {
|
||||
var highlighter = new Rules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.HighlightRules = Rules;
|
||||
this.$outdent = new Outdent();
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.foldingRules = new FoldMode();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,10 +41,8 @@ var ColdfusionHighlightRules = require("./coldfusion_highlight_rules").Coldfusio
|
|||
var Mode = function() {
|
||||
XmlMode.call(this);
|
||||
|
||||
var highlighter = new ColdfusionHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.HighlightRules = ColdfusionHighlightRules;
|
||||
|
||||
this.$embeds = highlighter.getEmbeds();
|
||||
this.createModeDelegates({
|
||||
"js-": JavaScriptMode,
|
||||
"css-": CssMode
|
||||
|
|
|
|||
|
|
@ -10,11 +10,9 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
|||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new CSharpHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.HighlightRules = CSharpHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
|
|
|||
|
|
@ -41,11 +41,9 @@ var CssBehaviour = require("./behaviour/css").CssBehaviour;
|
|||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new CssHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.HighlightRules = CssHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CssBehaviour();
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
|
|
|||
|
|
@ -49,39 +49,14 @@ var HtmlFoldMode = require("./folding/html").FoldMode;
|
|||
var CurlyHighlightRules = require("./curly_highlight_rules").CurlyHighlightRules;
|
||||
|
||||
var Mode = function() {
|
||||
// set everything up
|
||||
var highlighter = new CurlyHighlightRules();
|
||||
HtmlMode.call(this);
|
||||
this.HighlightRules = CurlyHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.foldingRules = new HtmlFoldMode();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, HtmlMode);
|
||||
|
||||
(function() {
|
||||
// Extra logic goes here--we won't be covering all of this
|
||||
|
||||
/* These are all optional pieces of code!
|
||||
this.getNextLineIndent = function(state, line, tab) {
|
||||
var indent = this.$getIndent(line);
|
||||
return indent;
|
||||
};
|
||||
|
||||
this.checkOutdent = function(state, line, input) {
|
||||
return this.$outdent.checkOutdent(line, input);
|
||||
};
|
||||
|
||||
this.autoOutdent = function(state, doc, row) {
|
||||
this.$outdent.autoOutdent(doc, row);
|
||||
};
|
||||
|
||||
this.createWorker = function(session) {
|
||||
var worker = new WorkerClient(["ace"], "ace/mode/mynew_worker", "NewWorker");
|
||||
worker.attachToDocument(session.getDocument());
|
||||
|
||||
return worker;
|
||||
};
|
||||
*/
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -42,16 +42,14 @@ var DHighlightRules = require("./d_highlight_rules").DHighlightRules;
|
|||
var FoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new DHighlightRules();
|
||||
this.HighlightRules = DHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "/\\+";
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -48,16 +48,12 @@ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
|||
|
||||
var Mode = function() {
|
||||
CMode.call(this);
|
||||
var highlighter = new DartHighlightRules();
|
||||
this.HighlightRules = DartHighlightRules;
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
};
|
||||
oop.inherits(Mode, CMode);
|
||||
|
||||
(function() {
|
||||
// Extra logic goes here.
|
||||
(function() {
|
||||
this.lineCommentStart = "//";
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
}).call(Mode.prototype);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ var HighlightRules = require("./diff_highlight_rules").DiffHighlightRules;
|
|||
var FoldMode = require("./folding/diff").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new HighlightRules().getRules());
|
||||
this.HighlightRules = HighlightRules;
|
||||
this.foldingRules = new FoldMode(["diff", "index", "\\+{3}", "@@|\\*{5}"], "i");
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
|
|
|||
|
|
@ -107,9 +107,8 @@ var DjangoHtmlHighlightRules = function() {
|
|||
oop.inherits(DjangoHtmlHighlightRules, HtmlHighlightRules);
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new DjangoHtmlHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$embeds = highlighter.getEmbeds();
|
||||
HtmlMode.call(this);
|
||||
this.HighlightRules = DjangoHtmlHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, HtmlMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,10 +9,9 @@ var DotHighlightRules = require("./dot_highlight_rules").DotHighlightRules;
|
|||
var DotFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new DotHighlightRules();
|
||||
this.HighlightRules = DotHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.foldingRules = new DotFoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -92,9 +92,7 @@ var RubyMode = require("./ruby").Mode;
|
|||
|
||||
var Mode = function() {
|
||||
HtmlMode.call(this);
|
||||
var highlighter = new EjsHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$embeds = highlighter.getEmbeds();
|
||||
this.HighlightRules = EjsHighlightRules;
|
||||
this.createModeDelegates({
|
||||
"js-": JavaScriptMode,
|
||||
"css-": CssMode,
|
||||
|
|
|
|||
|
|
@ -43,16 +43,14 @@ var ErlangHighlightRules = require("./erlang_highlight_rules").ErlangHighlightRu
|
|||
var FoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new ErlangHighlightRules();
|
||||
this.HighlightRules = ErlangHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "%";
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -48,16 +48,14 @@ var ForthHighlightRules = require("./forth_highlight_rules").ForthHighlightRules
|
|||
var FoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new ForthHighlightRules();
|
||||
this.HighlightRules = ForthHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "(?<=^|\\s)\\.?\\( [^)]*\\)";
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -37,8 +37,7 @@ var Tokenizer = require("../tokenizer").Tokenizer;
|
|||
var FtlHighlightRules = require("./ftl_highlight_rules").FtlHighlightRules;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new FtlHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.HighlightRules = FtlHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -41,12 +41,10 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
|||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new glslHighlightRules();
|
||||
this.HighlightRules = glslHighlightRules;
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
};
|
||||
oop.inherits(Mode, CMode);
|
||||
|
|
|
|||
|
|
@ -9,10 +9,7 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
|||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new GolangHighlightRules();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.HighlightRules = GolangHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,9 +8,7 @@ var GroovyHighlightRules = require("./groovy_highlight_rules").GroovyHighlightRu
|
|||
|
||||
var Mode = function() {
|
||||
JavaScriptMode.call(this);
|
||||
var highlighter = new GroovyHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.HighlightRules = GroovyHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, JavaScriptMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -47,10 +47,8 @@ var HamlHighlightRules = require("./haml_highlight_rules").HamlHighlightRules;
|
|||
var FoldMode = require("./folding/coffee").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new HamlHighlightRules();
|
||||
this.foldingRules = new FoldMode();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.HighlightRules = HamlHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,11 +12,9 @@ var HtmlFoldMode = require("./folding/html").FoldMode;
|
|||
|
||||
var Mode = function() {
|
||||
HtmlMode.call(this);
|
||||
var highlighter = new HandlebarsHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.HighlightRules = HandlebarsHighlightRules;
|
||||
this.$behaviour = new HtmlBehaviour();
|
||||
|
||||
this.$embeds = highlighter.getEmbeds();
|
||||
|
||||
this.foldingRules = new HtmlFoldMode();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -48,16 +48,14 @@ var HaskellHighlightRules = require("./haskell_highlight_rules").HaskellHighligh
|
|||
var FoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new HaskellHighlightRules();
|
||||
this.HighlightRules = HaskellHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "--";
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -10,12 +10,10 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
|||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new HaxeHighlightRules();
|
||||
this.HighlightRules = HaxeHighlightRules;
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
|
|
|||
|
|
@ -42,12 +42,10 @@ var HtmlFoldMode = require("./folding/html").FoldMode;
|
|||
var HtmlCompletions = require("./html_completions").HtmlCompletions;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new HtmlHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.HighlightRules = HtmlHighlightRules;
|
||||
this.$behaviour = new HtmlBehaviour();
|
||||
this.$completer = new HtmlCompletions();
|
||||
|
||||
this.$embeds = highlighter.getEmbeds();
|
||||
this.createModeDelegates({
|
||||
"js-": JavaScriptMode,
|
||||
"css-": CssMode
|
||||
|
|
|
|||
|
|
@ -42,9 +42,7 @@ var RubyMode = require("./ruby").Mode;
|
|||
|
||||
var Mode = function() {
|
||||
HtmlMode.call(this);
|
||||
var highlighter = new HtmlRubyHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$embeds = highlighter.getEmbeds();
|
||||
this.HighlightRules = HtmlRubyHighlightRules;
|
||||
this.createModeDelegates({
|
||||
"js-": JavaScriptMode,
|
||||
"css-": CssMode,
|
||||
|
|
|
|||
|
|
@ -48,16 +48,14 @@ var IniHighlightRules = require("./ini_highlight_rules").IniHighlightRules;
|
|||
var FoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new IniHighlightRules();
|
||||
this.HighlightRules = IniHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = ";";
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -43,15 +43,13 @@ var JadeHighlightRules = require("./jade_highlight_rules").JadeHighlightRules;
|
|||
var FoldMode = require("./folding/coffee").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new JadeHighlightRules();
|
||||
this.HighlightRules = JadeHighlightRules;
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.foldingRules = new FoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
// Extra logic goes here.
|
||||
(function() {
|
||||
this.lineCommentStart = "//";
|
||||
}).call(Mode.prototype);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,10 +8,7 @@ var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules;
|
|||
|
||||
var Mode = function() {
|
||||
JavaScriptMode.call(this);
|
||||
var highlighter = new JavaHighlightRules();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.HighlightRules = JavaHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, JavaScriptMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -42,12 +42,10 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
|||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new JavaScriptHighlightRules();
|
||||
this.HighlightRules = JavaScriptHighlightRules;
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
|||
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new HighlightRules().getRules());
|
||||
this.HighlightRules = HighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
|
|
|
|||
|
|
@ -40,8 +40,7 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
|||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new JspHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.HighlightRules = JspHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
|||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
function Mode() {
|
||||
this.$tokenizer = new Tokenizer(new JsxHighlightRules().getRules());
|
||||
this.HighlightRules = JsxHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
|
|
|
|||
|
|
@ -48,16 +48,14 @@ var JuliaHighlightRules = require("./julia_highlight_rules").JuliaHighlightRules
|
|||
var FoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new JuliaHighlightRules();
|
||||
this.HighlightRules = JuliaHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "#";
|
||||
this.blockComment = "";
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ var LatexFoldMode = require("./folding/latex").FoldMode;
|
|||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new LatexHighlightRules().getRules());
|
||||
this.HighlightRules = LatexHighlightRules;
|
||||
this.foldingRules = new LatexFoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ var CssBehaviour = require("./behaviour/css").CssBehaviour;
|
|||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new LessHighlightRules().getRules());
|
||||
this.HighlightRules = LessHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CssBehaviour();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
|
|
|
|||
|
|
@ -38,10 +38,7 @@ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutd
|
|||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new LiquidHighlightRules();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.HighlightRules = LiquidHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
|
|
|||
|
|
@ -42,10 +42,7 @@ var Tokenizer = require("../tokenizer").Tokenizer;
|
|||
var LispHighlightRules = require("./lisp_highlight_rules").LispHighlightRules;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new LispHighlightRules();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.HighlightRules = LispHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -42,9 +42,8 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
|||
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new LogiQLHighlightRules();
|
||||
this.HighlightRules = LogiQLHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
};
|
||||
|
|
@ -134,7 +133,6 @@ oop.inherits(Mode, TextMode);
|
|||
var row = it.getCurrentTokenRow();
|
||||
return new Range(row, col, row, col + tok.value.length);
|
||||
};
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
|||
var oop = require("../lib/oop");
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new Rules().getRules());
|
||||
this.HighlightRules = Rules;
|
||||
this.$outdent = new Outdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
|
|
|
|||
|
|
@ -40,11 +40,9 @@ var Range = require("../range").Range;
|
|||
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new LuaHighlightRules();
|
||||
this.HighlightRules = LuaHighlightRules;
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.foldingRules = new LuaFoldMode();
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,10 +8,9 @@ var Tokenizer = require("../tokenizer").Tokenizer;
|
|||
var LuaPageHighlightRules = require("./luapage_highlight_rules").LuaPageHighlightRules;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new LuaPageHighlightRules();
|
||||
this.HighlightRules = LuaPageHighlightRules;
|
||||
|
||||
this.$tokenizer = new Tokenizer(new LuaPageHighlightRules().getRules());
|
||||
this.$embeds = highlighter.getEmbeds();
|
||||
this.HighlightRules = LuaPageHighlightRules;
|
||||
this.createModeDelegates({
|
||||
"lua-": LuaMode
|
||||
});
|
||||
|
|
|
|||
|
|
@ -47,11 +47,8 @@ var MakefileHighlightRules = require("./makefile_highlight_rules").MakefileHighl
|
|||
var FoldMode = require("./folding/coffee").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new MakefileHighlightRules();
|
||||
this.HighlightRules = MakefileHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -41,10 +41,8 @@ var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighl
|
|||
var MarkdownFoldMode = require("./folding/markdown").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new MarkdownHighlightRules();
|
||||
this.HighlightRules = MarkdownHighlightRules;
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$embeds = highlighter.getEmbeds();
|
||||
this.createModeDelegates({
|
||||
"js-": JavaScriptMode,
|
||||
"xml-": XmlMode,
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ var MatlabHighlightRules = require("./matlab_highlight_rules").MatlabHighlightRu
|
|||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new MatlabHighlightRules().getRules());
|
||||
this.HighlightRules = MatlabHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ var PythonFoldMode = require("./folding/pythonic").FoldMode;
|
|||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new MushCodeRules().getRules());
|
||||
this.HighlightRules = MushCodeRules;
|
||||
this.foldingRules = new PythonFoldMode("\\:");
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ var MysqlHighlightRules = require("./mysql_highlight_rules").MysqlHighlightRules
|
|||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new MysqlHighlightRules().getRules());
|
||||
this.HighlightRules = MysqlHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -48,16 +48,12 @@ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
|||
|
||||
var Mode = function() {
|
||||
CMode.call(this);
|
||||
var highlighter = new NixHighlightRules();
|
||||
this.HighlightRules = NixHighlightRules;
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
};
|
||||
oop.inherits(Mode, CMode);
|
||||
|
||||
(function() {
|
||||
// Extra logic goes here.
|
||||
(function() {
|
||||
this.lineCommentStart = "#";
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
}).call(Mode.prototype);
|
||||
|
|
|
|||
|
|
@ -47,10 +47,8 @@ var ObjectiveCHighlightRules = require("./objectivec_highlight_rules").Objective
|
|||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new ObjectiveCHighlightRules();
|
||||
this.HighlightRules = ObjectiveCHighlightRules;
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -39,11 +39,9 @@ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutd
|
|||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new OcamlHighlightRules();
|
||||
this.HighlightRules = OcamlHighlightRules;
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -48,9 +48,8 @@ var PascalHighlightRules = require("./pascal_highlight_rules").PascalHighlightRu
|
|||
var FoldMode = require("./folding/coffee").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new PascalHighlightRules();
|
||||
this.HighlightRules = PascalHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -40,12 +40,10 @@ var Range = require("../range").Range;
|
|||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new PerlHighlightRules();
|
||||
this.HighlightRules = PerlHighlightRules;
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.foldingRules = new CStyleFoldMode({start: "^=(begin|item)\\b", end: "^=(cut)\\b"});
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -37,10 +37,7 @@ var PgsqlHighlightRules = require("./pgsql_highlight_rules").PgsqlHighlightRules
|
|||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new PgsqlHighlightRules();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.HighlightRules = PgsqlHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ var unicode = require("../unicode");
|
|||
var Mode = function(opts) {
|
||||
var inline = opts && opts.inline;
|
||||
var HighlightRules = inline ? PhpLangHighlightRules : PhpHighlightRules;
|
||||
this.$tokenizer = new Tokenizer(new HighlightRules().getRules());
|
||||
this.HighlightRules = HighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
|||
var Behaviour = require("./behaviour").Behaviour;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new TextHighlightRules().getRules());
|
||||
this.HighlightRules = TextHighlightRules;
|
||||
this.$behaviour = new Behaviour();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,10 +10,7 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
|||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new PowershellHighlightRules();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.HighlightRules = PowershellHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.foldingRules = new CStyleFoldMode({start: "^\\s*(<#)", end: "^[#\\s]>\\s*$"});
|
||||
|
|
|
|||
|
|
@ -48,16 +48,14 @@ var PrologHighlightRules = require("./prolog_highlight_rules").PrologHighlightRu
|
|||
var FoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new PrologHighlightRules();
|
||||
this.HighlightRules = PrologHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "/\\*";
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -37,8 +37,7 @@ var Tokenizer = require("../tokenizer").Tokenizer;
|
|||
var PropertiesHighlightRules = require("./properties_highlight_rules").PropertiesHighlightRules;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new PropertiesHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.HighlightRules = PropertiesHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -39,9 +39,7 @@ var PythonFoldMode = require("./folding/pythonic").FoldMode;
|
|||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new PythonHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.HighlightRules = PythonHighlightRules;
|
||||
this.foldingRules = new PythonFoldMode("\\:");
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ define(function(require, exports, module) {
|
|||
|
||||
var Mode = function()
|
||||
{
|
||||
this.$tokenizer = new Tokenizer(new RHighlightRules().getRules());
|
||||
this.HighlightRules = RHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ var RDocHighlightRules = require("./rdoc_highlight_rules").RDocHighlightRules;
|
|||
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
||||
|
||||
var Mode = function(suppressHighlighting) {
|
||||
this.$tokenizer = new Tokenizer(new RDocHighlightRules().getRules());
|
||||
this.HighlightRules = RDocHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ var RCodeModel = require("mode/r_code_model").RCodeModel;
|
|||
|
||||
var Mode = function(doc, session) {
|
||||
this.$session = session;
|
||||
this.$tokenizer = new Tokenizer(new RHtmlHighlightRules().getRules());
|
||||
this.HighlightRules = RHtmlHighlightRules;
|
||||
|
||||
/* Or these.
|
||||
this.codeModel = new RCodeModel(doc, this.$tokenizer, /^r-/,
|
||||
|
|
|
|||
|
|
@ -40,10 +40,7 @@ var Range = require("../range").Range;
|
|||
var FoldMode = require("./folding/coffee").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new RubyHighlightRules();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.HighlightRules = RubyHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.foldingRules = new FoldMode();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -48,16 +48,14 @@ var RustHighlightRules = require("./rust_highlight_rules").RustHighlightRules;
|
|||
var FoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new RustHighlightRules();
|
||||
this.HighlightRules = RustHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "/\\*";
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ var SassHighlightRules = require("./sass_highlight_rules").SassHighlightRules;
|
|||
var FoldMode = require("./folding/coffee").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new SassHighlightRules().getRules());
|
||||
this.HighlightRules = SassHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
|
|
|||
|
|
@ -41,10 +41,7 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
|||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new scadHighlightRules();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.HighlightRules = scadHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
|
|
|
|||
|
|
@ -9,9 +9,7 @@ var ScalaHighlightRules = require("./scala_highlight_rules").ScalaHighlightRules
|
|||
var Mode = function() {
|
||||
JavaScriptMode.call(this);
|
||||
|
||||
var highlighter = new ScalaHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.HighlightRules = ScalaHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, JavaScriptMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -42,9 +42,7 @@ var Tokenizer = require("../tokenizer").Tokenizer;
|
|||
var SchemeHighlightRules = require("./scheme_highlight_rules").SchemeHighlightRules;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new SchemeHighlightRules();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.HighlightRules = SchemeHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ var CssBehaviour = require("./behaviour/css").CssBehaviour;
|
|||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new ScssHighlightRules().getRules());
|
||||
this.HighlightRules = ScssHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CssBehaviour();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
|
|
|
|||
|
|
@ -38,10 +38,7 @@ var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules;
|
|||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new ShHighlightRules();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.HighlightRules = ShHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -98,9 +98,8 @@ exports.SnippetGroupHighlightRules = SnippetGroupHighlightRules;
|
|||
var FoldMode = require("./folding/coffee").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new SnippetGroupHighlightRules();
|
||||
this.HighlightRules = SnippetGroupHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -47,16 +47,13 @@ var SoyTemplateHighlightRules = require("./soy_template_highlight_rules").SoyTem
|
|||
|
||||
var Mode = function() {
|
||||
HtmlMode.call(this);
|
||||
var highlighter = new SoyTemplateHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.HighlightRules = SoyTemplateHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, HtmlMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "//";
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -38,10 +38,7 @@ var SqlHighlightRules = require("./sql_highlight_rules").SqlHighlightRules;
|
|||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new SqlHighlightRules();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
this.HighlightRules = SqlHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -47,16 +47,12 @@ var StylusHighlightRules = require("./stylus_highlight_rules").StylusHighlightRu
|
|||
var FoldMode = require("./folding/coffee").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new StylusHighlightRules();
|
||||
this.HighlightRules = StylusHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$keywordList = highlighter.$keywordList;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
// Extra logic goes here.
|
||||
(function() {
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -43,10 +43,8 @@ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
|||
var Mode = function() {
|
||||
XmlMode.call(this);
|
||||
|
||||
this.highlighter = new SvgHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(this.highlighter.getRules());
|
||||
this.HighlightRules = SvgHighlightRules;
|
||||
|
||||
this.$embeds = this.highlighter.getEmbeds();
|
||||
this.createModeDelegates({
|
||||
"js-": JavaScriptMode
|
||||
});
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutd
|
|||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new TclHighlightRules().getRules());
|
||||
this.HighlightRules = TclHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutd
|
|||
|
||||
var Mode = function(suppressHighlighting) {
|
||||
if (suppressHighlighting)
|
||||
this.$tokenizer = new Tokenizer(new TextHighlightRules().getRules());
|
||||
this.HighlightRules = TextHighlightRules;
|
||||
else
|
||||
this.$tokenizer = new Tokenizer(new TexHighlightRules().getRules());
|
||||
this.HighlightRules = TexHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ var TokenIterator = require("../token_iterator").TokenIterator;
|
|||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new TextHighlightRules().getRules());
|
||||
this.HighlightRules = TextHighlightRules;
|
||||
this.$behaviour = new Behaviour();
|
||||
};
|
||||
|
||||
|
|
@ -61,6 +61,10 @@ var Mode = function() {
|
|||
);
|
||||
|
||||
this.getTokenizer = function() {
|
||||
if (!this.$tokenizer) {
|
||||
this.$highlightRules = new this.HighlightRules();
|
||||
this.$tokenizer = new Tokenizer(this.$highlightRules.getRules());
|
||||
}
|
||||
return this.$tokenizer;
|
||||
};
|
||||
|
||||
|
|
@ -271,13 +275,12 @@ var Mode = function() {
|
|||
};
|
||||
|
||||
this.createModeDelegates = function (mapping) {
|
||||
if (!this.$embeds) {
|
||||
return;
|
||||
}
|
||||
this.$embeds = [];
|
||||
this.$modes = {};
|
||||
for (var i = 0; i < this.$embeds.length; i++) {
|
||||
if (mapping[this.$embeds[i]]) {
|
||||
this.$modes[this.$embeds[i]] = new mapping[this.$embeds[i]]();
|
||||
for (var i in mapping) {
|
||||
if (mapping[i]) {
|
||||
this.$embeds.push(i);
|
||||
this.$modes[i] = new mapping[i]();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -356,9 +359,15 @@ var Mode = function() {
|
|||
return this.$keywordList;
|
||||
return completionKeywords.concat(this.$keywordList || []);
|
||||
};
|
||||
|
||||
this.$createKeywordList = function() {
|
||||
if (!this.$highlightRules)
|
||||
this.getTokenizer();
|
||||
return this.$keywordList = this.$highlightRules.$keywordList || [];
|
||||
}
|
||||
|
||||
this.getCompletions = function(state, session, pos, prefix) {
|
||||
var keywords = this.$keywordList || [];
|
||||
var keywords = this.$keywordList || this.$createKeywordList();
|
||||
return keywords.map(function(word) {
|
||||
return {
|
||||
name: word,
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ var TextileHighlightRules = require("./textile_highlight_rules").TextileHighligh
|
|||
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new TextileHighlightRules().getRules());
|
||||
this.HighlightRules = TextileHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
|
|
|||
|
|
@ -44,15 +44,13 @@ var TomlHighlightRules = require("./toml_highlight_rules").TomlHighlightRules;
|
|||
var FoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new TomlHighlightRules();
|
||||
this.HighlightRules = TomlHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "#";
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -42,12 +42,10 @@ var HtmlFoldMode = require("./folding/html").FoldMode;
|
|||
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new TwigHighlightRules();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.HighlightRules = TwigHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new HtmlBehaviour();
|
||||
|
||||
this.$embeds = highlighter.getEmbeds();
|
||||
this.createModeDelegates({
|
||||
"js-": JavaScriptMode,
|
||||
"css-": CssMode
|
||||
|
|
|
|||
|
|
@ -44,9 +44,8 @@ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
|||
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new TypeScriptHighlightRules();
|
||||
this.HighlightRules = TypeScriptHighlightRules;
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
|
|
|
|||
|
|
@ -46,9 +46,7 @@ var Tokenizer = require("../tokenizer").Tokenizer;
|
|||
var VBScriptHighlightRules = require("./vbscript_highlight_rules").VBScriptHighlightRules;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new VBScriptHighlightRules();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.HighlightRules = VBScriptHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -44,16 +44,15 @@ var FoldMode = require("./folding/velocity").FoldMode;
|
|||
var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new VelocityHighlightRules();
|
||||
this.HighlightRules = VelocityHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
this.$behaviour = new HtmlBehaviour();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "##";
|
||||
this.blockComment = {start: "#*", end: "*#"};
|
||||
this.lineCommentStart = "##";
|
||||
this.blockComment = {start: "#*", end: "*#"};
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ var VerilogHighlightRules = require("./verilog_highlight_rules").VerilogHighligh
|
|||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new VerilogHighlightRules().getRules());
|
||||
this.HighlightRules = VerilogHighlightRules;
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
|
|||
var XmlFoldMode = require("./folding/xml").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new XmlHighlightRules().getRules());
|
||||
this.HighlightRules = XmlHighlightRules;
|
||||
this.$behaviour = new XmlBehaviour();
|
||||
this.foldingRules = new XmlFoldMode();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutd
|
|||
var FoldMode = require("./folding/coffee").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new YamlHighlightRules().getRules());
|
||||
this.HighlightRules = YamlHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.foldingRules = new FoldMode();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue