make getStartRule getEndRule static
This commit is contained in:
parent
e8a5c0dc2f
commit
68d0799554
10 changed files with 34 additions and 37 deletions
|
|
@ -72,7 +72,7 @@ var c_cppHighlightRules = function() {
|
||||||
token : "comment",
|
token : "comment",
|
||||||
regex : "\\/\\/.*$"
|
regex : "\\/\\/.*$"
|
||||||
},
|
},
|
||||||
new DocCommentHighlightRules().getStartRule("doc-start"),
|
DocCommentHighlightRules.getStartRule("doc-start"),
|
||||||
{
|
{
|
||||||
token : "comment", // multi line comment
|
token : "comment", // multi line comment
|
||||||
merge : true,
|
merge : true,
|
||||||
|
|
@ -171,7 +171,7 @@ var c_cppHighlightRules = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.embedRules(DocCommentHighlightRules, "doc-",
|
this.embedRules(DocCommentHighlightRules, "doc-",
|
||||||
[ new DocCommentHighlightRules().getEndRule("start") ]);
|
[ DocCommentHighlightRules.getEndRule("start") ]);
|
||||||
};
|
};
|
||||||
|
|
||||||
oop.inherits(c_cppHighlightRules, TextHighlightRules);
|
oop.inherits(c_cppHighlightRules, TextHighlightRules);
|
||||||
|
|
|
||||||
|
|
@ -69,27 +69,24 @@ var DocCommentHighlightRules = function() {
|
||||||
|
|
||||||
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
|
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
|
||||||
|
|
||||||
(function() {
|
DocCommentHighlightRules.getStartRule = function(start) {
|
||||||
|
return {
|
||||||
this.getStartRule = function(start) {
|
token : "comment.doc", // doc comment
|
||||||
return {
|
merge : true,
|
||||||
token : "comment.doc", // doc comment
|
regex : "\\/\\*(?=\\*)",
|
||||||
merge : true,
|
next : start
|
||||||
regex : "\\/\\*(?=\\*)",
|
|
||||||
next : start
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getEndRule = function (start) {
|
|
||||||
return {
|
|
||||||
token : "comment.doc", // closing comment
|
|
||||||
merge : true,
|
|
||||||
regex : "\\*\\/",
|
|
||||||
next : start
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
DocCommentHighlightRules.getEndRule = function (start) {
|
||||||
|
return {
|
||||||
|
token : "comment.doc", // closing comment
|
||||||
|
merge : true,
|
||||||
|
regex : "\\*\\/",
|
||||||
|
next : start
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
}).call(DocCommentHighlightRules.prototype);
|
|
||||||
|
|
||||||
exports.DocCommentHighlightRules = DocCommentHighlightRules;
|
exports.DocCommentHighlightRules = DocCommentHighlightRules;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ var GroovyHighlightRules = function() {
|
||||||
token : "comment",
|
token : "comment",
|
||||||
regex : "\\/\\/.*$"
|
regex : "\\/\\/.*$"
|
||||||
},
|
},
|
||||||
new DocCommentHighlightRules().getStartRule("doc-start"),
|
DocCommentHighlightRules.getStartRule("doc-start"),
|
||||||
{
|
{
|
||||||
token : "comment", // multi line comment
|
token : "comment", // multi line comment
|
||||||
merge : true,
|
merge : true,
|
||||||
|
|
@ -134,7 +134,7 @@ var GroovyHighlightRules = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.embedRules(DocCommentHighlightRules, "doc-",
|
this.embedRules(DocCommentHighlightRules, "doc-",
|
||||||
[ new DocCommentHighlightRules().getEndRule("start") ]);
|
[ DocCommentHighlightRules.getEndRule("start") ]);
|
||||||
};
|
};
|
||||||
|
|
||||||
oop.inherits(GroovyHighlightRules, TextHighlightRules);
|
oop.inherits(GroovyHighlightRules, TextHighlightRules);
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ var HaxeHighlightRules = function() {
|
||||||
token : "comment",
|
token : "comment",
|
||||||
regex : "\\/\\/.*$"
|
regex : "\\/\\/.*$"
|
||||||
},
|
},
|
||||||
new DocCommentHighlightRules().getStartRule("doc-start"),
|
DocCommentHighlightRules.getStartRule("doc-start"),
|
||||||
{
|
{
|
||||||
token : "comment", // multi line comment
|
token : "comment", // multi line comment
|
||||||
regex : "\\/\\*",
|
regex : "\\/\\*",
|
||||||
|
|
@ -95,7 +95,7 @@ var HaxeHighlightRules = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.embedRules(DocCommentHighlightRules, "doc-",
|
this.embedRules(DocCommentHighlightRules, "doc-",
|
||||||
[ new DocCommentHighlightRules().getEndRule("start") ]);
|
[ DocCommentHighlightRules.getEndRule("start") ]);
|
||||||
};
|
};
|
||||||
|
|
||||||
oop.inherits(HaxeHighlightRules, TextHighlightRules);
|
oop.inherits(HaxeHighlightRules, TextHighlightRules);
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ var JavaHighlightRules = function() {
|
||||||
token : "comment",
|
token : "comment",
|
||||||
regex : "\\/\\/.*$"
|
regex : "\\/\\/.*$"
|
||||||
},
|
},
|
||||||
new DocCommentHighlightRules().getStartRule("doc-start"),
|
DocCommentHighlightRules.getStartRule("doc-start"),
|
||||||
{
|
{
|
||||||
token : "comment", // multi line comment
|
token : "comment", // multi line comment
|
||||||
merge : true,
|
merge : true,
|
||||||
|
|
@ -135,7 +135,7 @@ var JavaHighlightRules = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.embedRules(DocCommentHighlightRules, "doc-",
|
this.embedRules(DocCommentHighlightRules, "doc-",
|
||||||
[ new DocCommentHighlightRules().getEndRule("start") ]);
|
[ DocCommentHighlightRules.getEndRule("start") ]);
|
||||||
};
|
};
|
||||||
|
|
||||||
oop.inherits(JavaHighlightRules, TextHighlightRules);
|
oop.inherits(JavaHighlightRules, TextHighlightRules);
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ var JavaScriptHighlightRules = function() {
|
||||||
token : "comment",
|
token : "comment",
|
||||||
regex : /\/\/.*$/
|
regex : /\/\/.*$/
|
||||||
},
|
},
|
||||||
new DocCommentHighlightRules().getStartRule("doc-start"),
|
DocCommentHighlightRules.getStartRule("doc-start"),
|
||||||
{
|
{
|
||||||
token : "comment", // multi line comment
|
token : "comment", // multi line comment
|
||||||
merge : true,
|
merge : true,
|
||||||
|
|
@ -445,7 +445,7 @@ var JavaScriptHighlightRules = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.embedRules(DocCommentHighlightRules, "doc-",
|
this.embedRules(DocCommentHighlightRules, "doc-",
|
||||||
[ new DocCommentHighlightRules().getEndRule("start") ]);
|
[ DocCommentHighlightRules.getEndRule("start") ]);
|
||||||
};
|
};
|
||||||
|
|
||||||
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
|
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
|
||||||
|
|
|
||||||
|
|
@ -442,7 +442,7 @@ var PgsqlHighlightRules = function() {
|
||||||
token : "comment",
|
token : "comment",
|
||||||
regex : "--.*$"
|
regex : "--.*$"
|
||||||
},
|
},
|
||||||
new DocCommentHighlightRules().getStartRule("doc-start"),
|
DocCommentHighlightRules.getStartRule("doc-start"),
|
||||||
{
|
{
|
||||||
token : "comment", // multi-line comment
|
token : "comment", // multi-line comment
|
||||||
merge : true,
|
merge : true,
|
||||||
|
|
@ -571,7 +571,7 @@ var PgsqlHighlightRules = function() {
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
this.embedRules(DocCommentHighlightRules, "doc-", [ new DocCommentHighlightRules().getEndRule("start") ]);
|
this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]);
|
||||||
this.embedRules(PerlHighlightRules, "perl-", [{token : "string", regex : "\\$perl\\$", next : "statement"}]);
|
this.embedRules(PerlHighlightRules, "perl-", [{token : "string", regex : "\\$perl\\$", next : "statement"}]);
|
||||||
this.embedRules(PythonHighlightRules, "python-", [{token : "string", regex : "\\$python\\$", next : "statement"}]);
|
this.embedRules(PythonHighlightRules, "python-", [{token : "string", regex : "\\$python\\$", next : "statement"}]);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocComme
|
||||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||||
|
|
||||||
var PhpHighlightRules = function() {
|
var PhpHighlightRules = function() {
|
||||||
var docComment = new DocCommentHighlightRules();
|
var docComment = DocCommentHighlightRules;
|
||||||
// http://php.net/quickref.php
|
// http://php.net/quickref.php
|
||||||
var builtinFunctions = lang.arrayToMap(
|
var builtinFunctions = lang.arrayToMap(
|
||||||
('abs|acos|acosh|addcslashes|addslashes|aggregate|aggregate_info|aggregate_methods|aggregate_methods_by_list|aggregate_methods_by_regexp|' +
|
('abs|acos|acosh|addcslashes|addslashes|aggregate|aggregate_info|aggregate_methods|aggregate_methods_by_list|aggregate_methods_by_regexp|' +
|
||||||
|
|
@ -1150,7 +1150,7 @@ var PhpHighlightRules = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.embedRules(DocCommentHighlightRules, "doc-",
|
this.embedRules(DocCommentHighlightRules, "doc-",
|
||||||
[ new DocCommentHighlightRules().getEndRule("start") ]);
|
[ DocCommentHighlightRules.getEndRule("start") ]);
|
||||||
};
|
};
|
||||||
|
|
||||||
oop.inherits(PhpHighlightRules, TextHighlightRules);
|
oop.inherits(PhpHighlightRules, TextHighlightRules);
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ var scadHighlightRules = function() {
|
||||||
token : "comment",
|
token : "comment",
|
||||||
regex : "\\/\\/.*$"
|
regex : "\\/\\/.*$"
|
||||||
},
|
},
|
||||||
new DocCommentHighlightRules().getStartRule("start"),
|
DocCommentHighlightRules.getStartRule("start"),
|
||||||
{
|
{
|
||||||
token : "comment", // multi line comment
|
token : "comment", // multi line comment
|
||||||
merge : true,
|
merge : true,
|
||||||
|
|
@ -159,7 +159,7 @@ var scadHighlightRules = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.embedRules(DocCommentHighlightRules, "doc-",
|
this.embedRules(DocCommentHighlightRules, "doc-",
|
||||||
[ new DocCommentHighlightRules().getEndRule("start") ]);
|
[ DocCommentHighlightRules.getEndRule("start") ]);
|
||||||
};
|
};
|
||||||
|
|
||||||
oop.inherits(scadHighlightRules, TextHighlightRules);
|
oop.inherits(scadHighlightRules, TextHighlightRules);
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ var ScalaHighlightRules = function() {
|
||||||
token : "comment",
|
token : "comment",
|
||||||
regex : "\\/\\/.*$"
|
regex : "\\/\\/.*$"
|
||||||
},
|
},
|
||||||
new DocCommentHighlightRules().getStartRule("doc-start"),
|
DocCommentHighlightRules.getStartRule("doc-start"),
|
||||||
{
|
{
|
||||||
token : "comment", // multi line comment
|
token : "comment", // multi line comment
|
||||||
merge : true,
|
merge : true,
|
||||||
|
|
@ -135,7 +135,7 @@ var ScalaHighlightRules = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.embedRules(DocCommentHighlightRules, "doc-",
|
this.embedRules(DocCommentHighlightRules, "doc-",
|
||||||
[ new DocCommentHighlightRules().getEndRule("start") ]);
|
[ DocCommentHighlightRules.getEndRule("start") ]);
|
||||||
};
|
};
|
||||||
|
|
||||||
oop.inherits(ScalaHighlightRules, TextHighlightRules);
|
oop.inherits(ScalaHighlightRules, TextHighlightRules);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue