diff --git a/lib/ace/mode/c_cpp_highlight_rules.js b/lib/ace/mode/c_cpp_highlight_rules.js index f2192803..236b7284 100644 --- a/lib/ace/mode/c_cpp_highlight_rules.js +++ b/lib/ace/mode/c_cpp_highlight_rules.js @@ -72,7 +72,7 @@ var c_cppHighlightRules = function() { token : "comment", regex : "\\/\\/.*$" }, - new DocCommentHighlightRules().getStartRule("doc-start"), + DocCommentHighlightRules.getStartRule("doc-start"), { token : "comment", // multi line comment merge : true, @@ -171,7 +171,7 @@ var c_cppHighlightRules = function() { }; this.embedRules(DocCommentHighlightRules, "doc-", - [ new DocCommentHighlightRules().getEndRule("start") ]); + [ DocCommentHighlightRules.getEndRule("start") ]); }; oop.inherits(c_cppHighlightRules, TextHighlightRules); diff --git a/lib/ace/mode/doc_comment_highlight_rules.js b/lib/ace/mode/doc_comment_highlight_rules.js index 101cfa78..b176ef01 100644 --- a/lib/ace/mode/doc_comment_highlight_rules.js +++ b/lib/ace/mode/doc_comment_highlight_rules.js @@ -69,27 +69,24 @@ var DocCommentHighlightRules = function() { oop.inherits(DocCommentHighlightRules, TextHighlightRules); -(function() { - - this.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - merge : true, - regex : "\\/\\*(?=\\*)", - next : start - }; - }; - - this.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - merge : true, - regex : "\\*\\/", - next : start - }; +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc 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; diff --git a/lib/ace/mode/groovy_highlight_rules.js b/lib/ace/mode/groovy_highlight_rules.js index 6e3802a2..64ed0ab1 100644 --- a/lib/ace/mode/groovy_highlight_rules.js +++ b/lib/ace/mode/groovy_highlight_rules.js @@ -64,7 +64,7 @@ var GroovyHighlightRules = function() { token : "comment", regex : "\\/\\/.*$" }, - new DocCommentHighlightRules().getStartRule("doc-start"), + DocCommentHighlightRules.getStartRule("doc-start"), { token : "comment", // multi line comment merge : true, @@ -134,7 +134,7 @@ var GroovyHighlightRules = function() { }; this.embedRules(DocCommentHighlightRules, "doc-", - [ new DocCommentHighlightRules().getEndRule("start") ]); + [ DocCommentHighlightRules.getEndRule("start") ]); }; oop.inherits(GroovyHighlightRules, TextHighlightRules); diff --git a/lib/ace/mode/haxe_highlight_rules.js b/lib/ace/mode/haxe_highlight_rules.js index afd76659..5b17c650 100644 --- a/lib/ace/mode/haxe_highlight_rules.js +++ b/lib/ace/mode/haxe_highlight_rules.js @@ -26,7 +26,7 @@ var HaxeHighlightRules = function() { token : "comment", regex : "\\/\\/.*$" }, - new DocCommentHighlightRules().getStartRule("doc-start"), + DocCommentHighlightRules.getStartRule("doc-start"), { token : "comment", // multi line comment regex : "\\/\\*", @@ -95,7 +95,7 @@ var HaxeHighlightRules = function() { }; this.embedRules(DocCommentHighlightRules, "doc-", - [ new DocCommentHighlightRules().getEndRule("start") ]); + [ DocCommentHighlightRules.getEndRule("start") ]); }; oop.inherits(HaxeHighlightRules, TextHighlightRules); diff --git a/lib/ace/mode/java_highlight_rules.js b/lib/ace/mode/java_highlight_rules.js index 34aab3bd..77efd672 100644 --- a/lib/ace/mode/java_highlight_rules.js +++ b/lib/ace/mode/java_highlight_rules.js @@ -65,7 +65,7 @@ var JavaHighlightRules = function() { token : "comment", regex : "\\/\\/.*$" }, - new DocCommentHighlightRules().getStartRule("doc-start"), + DocCommentHighlightRules.getStartRule("doc-start"), { token : "comment", // multi line comment merge : true, @@ -135,7 +135,7 @@ var JavaHighlightRules = function() { }; this.embedRules(DocCommentHighlightRules, "doc-", - [ new DocCommentHighlightRules().getEndRule("start") ]); + [ DocCommentHighlightRules.getEndRule("start") ]); }; oop.inherits(JavaHighlightRules, TextHighlightRules); diff --git a/lib/ace/mode/javascript_highlight_rules.js b/lib/ace/mode/javascript_highlight_rules.js index a375d054..416dc3c4 100644 --- a/lib/ace/mode/javascript_highlight_rules.js +++ b/lib/ace/mode/javascript_highlight_rules.js @@ -116,7 +116,7 @@ var JavaScriptHighlightRules = function() { token : "comment", regex : /\/\/.*$/ }, - new DocCommentHighlightRules().getStartRule("doc-start"), + DocCommentHighlightRules.getStartRule("doc-start"), { token : "comment", // multi line comment merge : true, @@ -445,7 +445,7 @@ var JavaScriptHighlightRules = function() { }; this.embedRules(DocCommentHighlightRules, "doc-", - [ new DocCommentHighlightRules().getEndRule("start") ]); + [ DocCommentHighlightRules.getEndRule("start") ]); }; oop.inherits(JavaScriptHighlightRules, TextHighlightRules); diff --git a/lib/ace/mode/pgsql_highlight_rules.js b/lib/ace/mode/pgsql_highlight_rules.js index c5b6849f..d15c94da 100755 --- a/lib/ace/mode/pgsql_highlight_rules.js +++ b/lib/ace/mode/pgsql_highlight_rules.js @@ -442,7 +442,7 @@ var PgsqlHighlightRules = function() { token : "comment", regex : "--.*$" }, - new DocCommentHighlightRules().getStartRule("doc-start"), + DocCommentHighlightRules.getStartRule("doc-start"), { token : "comment", // multi-line comment 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(PythonHighlightRules, "python-", [{token : "string", regex : "\\$python\\$", next : "statement"}]); }; diff --git a/lib/ace/mode/php_highlight_rules.js b/lib/ace/mode/php_highlight_rules.js index d2a76f5c..e25dddc8 100644 --- a/lib/ace/mode/php_highlight_rules.js +++ b/lib/ace/mode/php_highlight_rules.js @@ -45,7 +45,7 @@ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocComme var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var PhpHighlightRules = function() { - var docComment = new DocCommentHighlightRules(); + var docComment = DocCommentHighlightRules; // http://php.net/quickref.php var builtinFunctions = lang.arrayToMap( ('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-", - [ new DocCommentHighlightRules().getEndRule("start") ]); + [ DocCommentHighlightRules.getEndRule("start") ]); }; oop.inherits(PhpHighlightRules, TextHighlightRules); diff --git a/lib/ace/mode/scad_highlight_rules.js b/lib/ace/mode/scad_highlight_rules.js index 79995250..82234750 100644 --- a/lib/ace/mode/scad_highlight_rules.js +++ b/lib/ace/mode/scad_highlight_rules.js @@ -65,7 +65,7 @@ var scadHighlightRules = function() { token : "comment", regex : "\\/\\/.*$" }, - new DocCommentHighlightRules().getStartRule("start"), + DocCommentHighlightRules.getStartRule("start"), { token : "comment", // multi line comment merge : true, @@ -159,7 +159,7 @@ var scadHighlightRules = function() { }; this.embedRules(DocCommentHighlightRules, "doc-", - [ new DocCommentHighlightRules().getEndRule("start") ]); + [ DocCommentHighlightRules.getEndRule("start") ]); }; oop.inherits(scadHighlightRules, TextHighlightRules); diff --git a/lib/ace/mode/scala_highlight_rules.js b/lib/ace/mode/scala_highlight_rules.js index 3664d67e..67f8e1b2 100644 --- a/lib/ace/mode/scala_highlight_rules.js +++ b/lib/ace/mode/scala_highlight_rules.js @@ -65,7 +65,7 @@ var ScalaHighlightRules = function() { token : "comment", regex : "\\/\\/.*$" }, - new DocCommentHighlightRules().getStartRule("doc-start"), + DocCommentHighlightRules.getStartRule("doc-start"), { token : "comment", // multi line comment merge : true, @@ -135,7 +135,7 @@ var ScalaHighlightRules = function() { }; this.embedRules(DocCommentHighlightRules, "doc-", - [ new DocCommentHighlightRules().getEndRule("start") ]); + [ DocCommentHighlightRules.getEndRule("start") ]); }; oop.inherits(ScalaHighlightRules, TextHighlightRules);