Revert "* Build ACE"

This reverts commit fe33a6e598.
This commit is contained in:
Ruben Daniels 2012-04-26 23:44:27 -07:00
commit 10eb938895
239 changed files with 3868 additions and 6322 deletions

File diff suppressed because it is too large Load diff

View file

@ -204,7 +204,7 @@ var c_cppHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -303,7 +303,7 @@ var c_cppHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(c_cppHighlightRules, TextHighlightRules);
@ -381,24 +381,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -1360,7 +1360,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -1368,11 +1368,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -1392,10 +1392,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -1407,8 +1408,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -1419,10 +1419,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -1431,20 +1432,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -1453,20 +1456,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -1536,7 +1541,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -1564,9 +1568,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -1574,6 +1579,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -1589,7 +1595,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -1598,24 +1605,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -1653,18 +1643,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -1673,24 +1656,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -1768,24 +1744,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -231,24 +231,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -304,7 +304,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -312,11 +312,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -336,10 +336,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -351,8 +352,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -363,10 +363,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -375,20 +376,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -397,20 +400,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -480,7 +485,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -508,9 +512,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -518,6 +523,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -533,7 +539,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -542,24 +549,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -597,18 +587,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -617,24 +600,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -712,24 +688,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1478,7 +1457,7 @@ var GroovyHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -1548,7 +1527,7 @@ var GroovyHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(GroovyHighlightRules, TextHighlightRules);

View file

@ -84,7 +84,7 @@ var HaxeHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
regex : "\\/\\*",
@ -153,7 +153,7 @@ var HaxeHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(HaxeHighlightRules, TextHighlightRules);
@ -231,24 +231,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -363,7 +363,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -371,11 +371,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -395,10 +395,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -410,8 +411,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -422,10 +422,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -434,20 +435,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -456,20 +459,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -539,7 +544,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -567,9 +571,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -577,6 +582,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -592,7 +598,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -601,24 +608,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -656,18 +646,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -676,24 +659,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -771,24 +747,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -305,7 +305,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -313,11 +313,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -337,10 +337,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -352,8 +353,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -364,10 +364,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -376,20 +377,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -398,20 +401,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -481,7 +486,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -509,9 +513,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -519,6 +524,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -534,7 +540,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -543,24 +550,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -598,18 +588,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -618,24 +601,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -713,24 +689,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1480,7 +1459,7 @@ var JavaHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -1550,7 +1529,7 @@ var JavaHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaHighlightRules, TextHighlightRules);

View file

@ -280,7 +280,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -288,11 +288,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -312,10 +312,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -327,8 +328,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -339,10 +339,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -351,20 +352,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -373,20 +376,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -456,7 +461,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -484,9 +488,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -494,6 +499,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -509,7 +515,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -518,24 +525,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -573,18 +563,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -593,24 +576,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -688,24 +664,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -694,7 +694,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -702,11 +702,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -726,10 +726,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -741,8 +742,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -753,10 +753,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -765,20 +766,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -787,20 +790,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -870,7 +875,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -898,9 +902,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -908,6 +913,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -923,7 +929,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -932,24 +939,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -987,18 +977,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -1007,24 +990,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -1102,24 +1078,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -360,7 +360,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -368,11 +368,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -392,10 +392,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -407,8 +408,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -419,10 +419,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -431,20 +432,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -453,20 +456,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -536,7 +541,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -564,9 +568,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -574,6 +579,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -589,7 +595,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -598,24 +605,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -653,18 +643,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -673,24 +656,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -768,24 +744,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -520,7 +520,7 @@ var PgsqlHighlightRules = function() {
token : "comment",
regex : "--.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi-line comment
merge : true,
@ -649,7 +649,7 @@ var PgsqlHighlightRules = function() {
]
};
this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]);
this.embedRules(DocCommentHighlightRules, "doc-", [ new DocCommentHighlightRules().getEndRule("start") ]);
this.embedRules(PerlHighlightRules, "perl-", [{token : "string", regex : "\\$perl\\$", next : "statement"}]);
this.embedRules(PythonHighlightRules, "python-", [{token : "string", regex : "\\$python\\$", next : "statement"}]);
};
@ -730,24 +730,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -164,7 +164,7 @@ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocComme
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var PhpHighlightRules = function() {
var docComment = DocCommentHighlightRules;
var docComment = new 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|' +
@ -1269,7 +1269,7 @@ var PhpHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(PhpHighlightRules, TextHighlightRules);
@ -1347,24 +1347,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -197,7 +197,7 @@ var scadHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("start"),
new DocCommentHighlightRules().getStartRule("start"),
{
token : "comment", // multi line comment
merge : true,
@ -291,7 +291,7 @@ var scadHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(scadHighlightRules, TextHighlightRules);
@ -369,24 +369,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -305,7 +305,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -313,11 +313,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -337,10 +337,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -352,8 +353,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -364,10 +364,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -376,20 +377,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -398,20 +401,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -481,7 +486,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -509,9 +513,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -519,6 +524,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -534,7 +540,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -543,24 +550,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -598,18 +588,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -618,24 +601,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -713,24 +689,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1480,7 +1459,7 @@ var ScalaHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -1550,7 +1529,7 @@ var ScalaHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(ScalaHighlightRules, TextHighlightRules);

View file

@ -164,8 +164,6 @@ exports.Mode = Mode;
*
* Contributor(s):
* Rich Healey <richo AT psych0tik DOT net>
* Javier Perez-Griffo <javier AT besol DOT es>
* James Tan <jamestyj AT gmail DOT com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@ -193,20 +191,14 @@ var ShHighlightRules = function() {
var reservedKeywords = lang.arrayToMap(
('!|{|}|case|do|done|elif|else|'+
'esac|fi|for|if|in|then|until|while|'+
'&|;|export|local|read|typeset|unset|'+
'elif|select|set'
'&|;'
).split('|')
);
var languageConstructs = lang.arrayToMap(
('[|]|alias|bg|bind|break|builtin|'+
'cd|command|compgen|complete|continue|'+
'dirs|disown|echo|enable|eval|exec|'+
'exit|fc|fg|getopts|hash|help|history|'+
'jobs|kill|let|logout|popd|printf|pushd|'+
'pwd|return|set|shift|shopt|source|'+
'suspend|test|times|trap|type|ulimit|'+
'umask|unalias|wait'
// TODO
('echo|exit|eval|source|[|]|test|'+
'true|false|read'
).split('|')
);

View file

@ -1367,7 +1367,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -1375,11 +1375,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -1399,10 +1399,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -1414,8 +1415,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -1426,10 +1426,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -1438,20 +1439,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -1460,20 +1463,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -1543,7 +1548,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -1571,9 +1575,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -1581,6 +1586,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -1596,7 +1602,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -1605,24 +1612,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -1660,18 +1650,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -1680,24 +1663,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -1775,24 +1751,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -1,5 +1,3 @@
@import url(//fonts.googleapis.com/css?family=Droid+Sans+Mono);
html {
height: 100%;
width: 100%;

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-clouds .ace_cursor {\
border-left: 2px solid #000000;\
border-left: 1px solid #000000;\
}\
\
.ace-clouds .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: #BDD5FC;\
}\
\
.ace-clouds.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #FFFFFF;\
border-radius: 2px;\
}\
\
.ace-clouds .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-clouds-midnight .ace_cursor {\
border-left: 2px solid #7DA5DC;\
border-left: 1px solid #7DA5DC;\
}\
\
.ace-clouds-midnight .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: #000000;\
}\
\
.ace-clouds-midnight.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #191919;\
border-radius: 2px;\
}\
\
.ace-clouds-midnight .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-cobalt .ace_cursor {\
border-left: 2px solid #FFFFFF;\
border-left: 1px solid #FFFFFF;\
}\
\
.ace-cobalt .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: rgba(179, 101, 57, 0.75);\
}\
\
.ace-cobalt.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #002240;\
border-radius: 2px;\
}\
\
.ace-cobalt .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-dawn .ace_cursor {\
border-left: 2px solid #000000;\
border-left: 1px solid #000000;\
}\
\
.ace-dawn .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: rgba(39, 95, 255, 0.30);\
}\
\
.ace-dawn.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #F9F9F9;\
border-radius: 2px;\
}\
\
.ace-dawn .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -67,7 +67,7 @@ exports.cssText = ".ace-eclipse .ace_editor {\
}\
\
.ace-eclipse .ace_cursor {\
border-left: 2px solid black;\
border-left: 1px solid black;\
}\
\
.ace-eclipse .ace_line .ace_storage,\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-idle-fingers .ace_cursor {\
border-left: 2px solid #91FF00;\
border-left: 1px solid #91FF00;\
}\
\
.ace-idle-fingers .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: rgba(90, 100, 126, 0.88);\
}\
\
.ace-idle-fingers.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #323232;\
border-radius: 2px;\
}\
\
.ace-idle-fingers .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-kr-theme .ace_cursor {\
border-left: 2px solid #FF9900;\
border-left: 1px solid #FF9900;\
}\
\
.ace-kr-theme .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: rgba(170, 0, 255, 0.45);\
}\
\
.ace-kr-theme.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #0B0A09;\
border-radius: 2px;\
}\
\
.ace-kr-theme .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-merbivore .ace_cursor {\
border-left: 2px solid #FFFFFF;\
border-left: 1px solid #FFFFFF;\
}\
\
.ace-merbivore .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: #454545;\
}\
\
.ace-merbivore.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #161616;\
border-radius: 2px;\
}\
\
.ace-merbivore .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-merbivore-soft .ace_cursor {\
border-left: 2px solid #FFFFFF;\
border-left: 1px solid #FFFFFF;\
}\
\
.ace-merbivore-soft .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: #494949;\
}\
\
.ace-merbivore-soft.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #1C1C1C;\
border-radius: 2px;\
}\
\
.ace-merbivore-soft .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-mono-industrial .ace_cursor {\
border-left: 2px solid #FFFFFF;\
border-left: 1px solid #FFFFFF;\
}\
\
.ace-mono-industrial .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: rgba(145, 153, 148, 0.40);\
}\
\
.ace-mono-industrial.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #222C28;\
border-radius: 2px;\
}\
\
.ace-mono-industrial .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-monokai .ace_cursor {\
border-left: 2px solid #F8F8F0;\
border-left: 1px solid #F8F8F0;\
}\
\
.ace-monokai .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: #49483E;\
}\
\
.ace-monokai.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #272822;\
border-radius: 2px;\
}\
\
.ace-monokai .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-pastel-on-dark .ace_cursor {\
border-left: 2px solid #A7A7A7;\
border-left: 1px solid #A7A7A7;\
}\
\
.ace-pastel-on-dark .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: rgba(221, 240, 255, 0.20);\
}\
\
.ace-pastel-on-dark.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #2C2828;\
border-radius: 2px;\
}\
\
.ace-pastel-on-dark .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-solarized-dark .ace_cursor {\
border-left: 2px solid #D30102;\
border-left: 1px solid #D30102;\
}\
\
.ace-solarized-dark .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: #073642;\
}\
\
.ace-solarized-dark.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #002B36;\
border-radius: 2px;\
}\
\
.ace-solarized-dark .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-solarized-light .ace_cursor {\
border-left: 2px solid #000000;\
border-left: 1px solid #000000;\
}\
\
.ace-solarized-light .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: #073642;\
}\
\
.ace-solarized-light.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #FDF6E3;\
border-radius: 2px;\
}\
\
.ace-solarized-light .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-tomorrow .ace_cursor {\
border-left: 2px solid #AEAFAD;\
border-left: 1px solid #AEAFAD;\
}\
\
.ace-tomorrow .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: #D6D6D6;\
}\
\
.ace-tomorrow.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #FFFFFF;\
border-radius: 2px;\
}\
\
.ace-tomorrow .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-tomorrow-night .ace_cursor {\
border-left: 2px solid #AEAFAD;\
border-left: 1px solid #AEAFAD;\
}\
\
.ace-tomorrow-night .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: #373B41;\
}\
\
.ace-tomorrow-night.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #1D1F21;\
border-radius: 2px;\
}\
\
.ace-tomorrow-night .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-tomorrow-night-blue .ace_cursor {\
border-left: 2px solid #FFFFFF;\
border-left: 1px solid #FFFFFF;\
}\
\
.ace-tomorrow-night-blue .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: #003F8E;\
}\
\
.ace-tomorrow-night-blue.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #002451;\
border-radius: 2px;\
}\
\
.ace-tomorrow-night-blue .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-tomorrow-night-bright .ace_cursor {\
border-left: 2px solid #9F9F9F;\
border-left: 1px solid #9F9F9F;\
}\
\
.ace-tomorrow-night-bright .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: #424242;\
}\
\
.ace-tomorrow-night-bright.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #000000;\
border-radius: 2px;\
}\
\
.ace-tomorrow-night-bright .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-tomorrow-night-eighties .ace_cursor {\
border-left: 2px solid #CCCCCC;\
border-left: 1px solid #CCCCCC;\
}\
\
.ace-tomorrow-night-eighties .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: #515151;\
}\
\
.ace-tomorrow-night-eighties.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #2D2D2D;\
border-radius: 2px;\
}\
\
.ace-tomorrow-night-eighties .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-twilight .ace_cursor {\
border-left: 2px solid #A7A7A7;\
border-left: 1px solid #A7A7A7;\
}\
\
.ace-twilight .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: rgba(221, 240, 255, 0.20);\
}\
\
.ace-twilight.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #141414;\
border-radius: 2px;\
}\
\
.ace-twilight .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -68,7 +68,7 @@ exports.cssText = "\
}\
\
.ace-vibrant-ink .ace_cursor {\
border-left: 2px solid #FFFFFF;\
border-left: 1px solid #FFFFFF;\
}\
\
.ace-vibrant-ink .ace_cursor.ace_overwrite {\
@ -80,11 +80,6 @@ exports.cssText = "\
background: #6699CC;\
}\
\
.ace-vibrant-ink.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #0F0F0F;\
border-radius: 2px;\
}\
\
.ace-vibrant-ink .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\

View file

@ -1399,7 +1399,7 @@ EventEmitter._dispatchEvent = function(eventName, e) {
}
if (defaultHandler && !e.defaultPrevented)
return defaultHandler(e);
defaultHandler(e);
};
EventEmitter.setDefaultHandler = function(eventName, callback) {
@ -1793,9 +1793,10 @@ var Document = function(text) {
range.end.column);
}
else {
var lines = this.getLines(range.start.row+1, range.end.row-1);
lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column));
lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column));
var lines = [];
lines.push(this.$lines[range.start.row].substring(range.start.column));
lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1));
lines.push(this.$lines[range.end.row].substring(0, range.end.column));
return lines.join(this.getNewLineCharacter());
}
};
@ -2161,7 +2162,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
}
this.intersects = function(range) {
this.intersectsRange = function(range) {
var cmp = this.compareRange(range);
return (cmp == -1 || cmp == 0 || cmp == 1);
}

View file

@ -1399,7 +1399,7 @@ EventEmitter._dispatchEvent = function(eventName, e) {
}
if (defaultHandler && !e.defaultPrevented)
return defaultHandler(e);
defaultHandler(e);
};
EventEmitter.setDefaultHandler = function(eventName, callback) {
@ -1767,9 +1767,10 @@ var Document = function(text) {
range.end.column);
}
else {
var lines = this.getLines(range.start.row+1, range.end.row-1);
lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column));
lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column));
var lines = [];
lines.push(this.$lines[range.start.row].substring(range.start.column));
lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1));
lines.push(this.$lines[range.end.row].substring(0, range.end.column));
return lines.join(this.getNewLineCharacter());
}
};
@ -2135,7 +2136,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
}
this.intersects = function(range) {
this.intersectsRange = function(range) {
var cmp = this.compareRange(range);
return (cmp == -1 || cmp == 0 || cmp == 1);
}

View file

@ -1399,7 +1399,7 @@ EventEmitter._dispatchEvent = function(eventName, e) {
}
if (defaultHandler && !e.defaultPrevented)
return defaultHandler(e);
defaultHandler(e);
};
EventEmitter.setDefaultHandler = function(eventName, callback) {
@ -1789,9 +1789,10 @@ var Document = function(text) {
range.end.column);
}
else {
var lines = this.getLines(range.start.row+1, range.end.row-1);
lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column));
lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column));
var lines = [];
lines.push(this.$lines[range.start.row].substring(range.start.column));
lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1));
lines.push(this.$lines[range.end.row].substring(0, range.end.column));
return lines.join(this.getNewLineCharacter());
}
};
@ -2157,7 +2158,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
}
this.intersects = function(range) {
this.intersectsRange = function(range) {
var cmp = this.compareRange(range);
return (cmp == -1 || cmp == 0 || cmp == 1);
}

View file

@ -1399,7 +1399,7 @@ EventEmitter._dispatchEvent = function(eventName, e) {
}
if (defaultHandler && !e.defaultPrevented)
return defaultHandler(e);
defaultHandler(e);
};
EventEmitter.setDefaultHandler = function(eventName, callback) {
@ -1804,9 +1804,10 @@ var Document = function(text) {
range.end.column);
}
else {
var lines = this.getLines(range.start.row+1, range.end.row-1);
lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column));
lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column));
var lines = [];
lines.push(this.$lines[range.start.row].substring(range.start.column));
lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1));
lines.push(this.$lines[range.end.row].substring(0, range.end.column));
return lines.join(this.getNewLineCharacter());
}
};
@ -2172,7 +2173,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
}
this.intersects = function(range) {
this.intersectsRange = function(range) {
var cmp = this.compareRange(range);
return (cmp == -1 || cmp == 0 || cmp == 1);
}

View file

@ -11,7 +11,7 @@
Ace
version 0.2.0
commit e34fb3668a85d3ceb283340d97cee1d410f6b190
commit 2a30f0f50ff8c0dfde21759113b57e113bc84d90
-->
@ -201,14 +201,6 @@
<input type="checkbox" id="enable_behaviours">
</td>
</tr>
<tr>
<td >
<label for="fade_fold_widgets">Fade Fold Widgets</label>
</td>
<td>
<input type="checkbox" id="fade_fold_widgets" checked>
</td>
</tr>
</table>
<div id="editor">

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -204,7 +204,7 @@ var c_cppHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -303,7 +303,7 @@ var c_cppHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(c_cppHighlightRules, TextHighlightRules);
@ -381,24 +381,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -204,7 +204,7 @@ var c_cppHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -303,7 +303,7 @@ var c_cppHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(c_cppHighlightRules, TextHighlightRules);
@ -381,24 +381,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1360,7 +1360,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -1368,11 +1368,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -1392,10 +1392,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -1407,8 +1408,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -1419,10 +1419,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -1431,20 +1432,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -1453,20 +1456,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -1536,7 +1541,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -1564,9 +1568,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -1574,6 +1579,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -1589,7 +1595,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -1598,24 +1605,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -1653,18 +1643,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -1673,24 +1656,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -1768,24 +1744,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -1360,7 +1360,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -1368,11 +1368,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -1392,10 +1392,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -1407,8 +1408,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -1419,10 +1419,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -1431,20 +1432,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -1453,20 +1456,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -1536,7 +1541,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -1564,9 +1568,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -1574,6 +1579,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -1589,7 +1595,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -1598,24 +1605,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -1653,18 +1643,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -1673,24 +1656,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -1768,24 +1744,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -231,24 +231,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -231,24 +231,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -304,7 +304,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -312,11 +312,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -336,10 +336,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -351,8 +352,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -363,10 +363,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -375,20 +376,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -397,20 +400,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -480,7 +485,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -508,9 +512,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -518,6 +523,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -533,7 +539,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -542,24 +549,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -597,18 +587,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -617,24 +600,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -712,24 +688,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1312,7 +1291,7 @@ var GroovyHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -1382,7 +1361,7 @@ var GroovyHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(GroovyHighlightRules, TextHighlightRules);

View file

@ -304,7 +304,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -312,11 +312,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -336,10 +336,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -351,8 +352,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -363,10 +363,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -375,20 +376,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -397,20 +400,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -480,7 +485,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -508,9 +512,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -518,6 +523,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -533,7 +539,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -542,24 +549,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -597,18 +587,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -617,24 +600,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -712,24 +688,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1312,7 +1291,7 @@ var GroovyHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -1382,7 +1361,7 @@ var GroovyHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(GroovyHighlightRules, TextHighlightRules);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -84,7 +84,7 @@ var HaxeHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
regex : "\\/\\*",
@ -153,7 +153,7 @@ var HaxeHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(HaxeHighlightRules, TextHighlightRules);
@ -231,24 +231,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -84,7 +84,7 @@ var HaxeHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
regex : "\\/\\*",
@ -153,7 +153,7 @@ var HaxeHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(HaxeHighlightRules, TextHighlightRules);
@ -231,24 +231,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -363,7 +363,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -371,11 +371,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -395,10 +395,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -410,8 +411,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -422,10 +422,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -434,20 +435,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -456,20 +459,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -539,7 +544,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -567,9 +571,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -577,6 +582,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -592,7 +598,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -601,24 +608,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -656,18 +646,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -676,24 +659,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -771,24 +747,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -363,7 +363,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -371,11 +371,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -395,10 +395,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -410,8 +411,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -422,10 +422,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -434,20 +435,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -456,20 +459,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -539,7 +544,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -567,9 +571,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -577,6 +582,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -592,7 +598,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -601,24 +608,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -656,18 +646,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -676,24 +659,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -771,24 +747,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -305,7 +305,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -313,11 +313,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -337,10 +337,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -352,8 +353,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -364,10 +364,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -376,20 +377,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -398,20 +401,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -481,7 +486,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -509,9 +513,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -519,6 +524,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -534,7 +540,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -543,24 +550,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -598,18 +588,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -618,24 +601,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -713,24 +689,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1314,7 +1293,7 @@ var JavaHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -1384,7 +1363,7 @@ var JavaHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaHighlightRules, TextHighlightRules);

View file

@ -305,7 +305,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -313,11 +313,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -337,10 +337,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -352,8 +353,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -364,10 +364,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -376,20 +377,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -398,20 +401,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -481,7 +486,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -509,9 +513,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -519,6 +524,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -534,7 +540,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -543,24 +550,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -598,18 +588,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -618,24 +601,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -713,24 +689,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1314,7 +1293,7 @@ var JavaHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -1384,7 +1363,7 @@ var JavaHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaHighlightRules, TextHighlightRules);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -280,7 +280,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -288,11 +288,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -312,10 +312,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -327,8 +328,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -339,10 +339,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -351,20 +352,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -373,20 +376,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -456,7 +461,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -484,9 +488,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -494,6 +499,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -509,7 +515,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -518,24 +525,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -573,18 +563,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -593,24 +576,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -688,24 +664,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -280,7 +280,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -288,11 +288,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -312,10 +312,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -327,8 +328,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -339,10 +339,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -351,20 +352,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -373,20 +376,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -456,7 +461,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -484,9 +488,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -494,6 +499,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -509,7 +515,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -518,24 +525,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -573,18 +563,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -593,24 +576,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -688,24 +664,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -694,7 +694,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -702,11 +702,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -726,10 +726,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -741,8 +742,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -753,10 +753,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -765,20 +766,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -787,20 +790,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -870,7 +875,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -898,9 +902,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -908,6 +913,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -923,7 +929,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -932,24 +939,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -987,18 +977,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -1007,24 +990,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -1102,24 +1078,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -694,7 +694,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -702,11 +702,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -726,10 +726,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -741,8 +742,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -753,10 +753,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -765,20 +766,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -787,20 +790,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -870,7 +875,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -898,9 +902,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -908,6 +913,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -923,7 +929,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -932,24 +939,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -987,18 +977,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -1007,24 +990,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -1102,24 +1078,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -360,7 +360,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -368,11 +368,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -392,10 +392,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -407,8 +408,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -419,10 +419,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -431,20 +432,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -453,20 +456,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -536,7 +541,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -564,9 +568,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -574,6 +579,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -589,7 +595,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -598,24 +605,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -653,18 +643,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -673,24 +656,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -768,24 +744,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -360,7 +360,7 @@ var JavaScriptHighlightRules = function() {
token : "comment",
regex : /\/\/.*$/
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -368,11 +368,11 @@ var JavaScriptHighlightRules = function() {
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
regex : "'",
next : "qstring"
}, {
token : "string",
regex : '"(?=.)',
regex : '"',
next : "qqstring"
}, {
token : "constant.numeric", // hex
@ -392,10 +392,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: Sound.prototype.play = myfunc
token : [
"storage.type",
@ -407,8 +408,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator",
"text"
],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
}, { // match stuff like: Sound.play = function() { }
token : [
"storage.type",
@ -419,10 +419,11 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: play = function() { }
token : [
"entity.name.function",
@ -431,20 +432,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // match regular function like: function myFunc(arg) { }
token : [
"storage.type",
"text",
"entity.name.function",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
}, { // match stuff like: foobar: function() { }
token : [
"entity.name.function",
@ -453,20 +456,22 @@ var JavaScriptHighlightRules = function() {
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [
"text",
"text",
"storage.type",
"text",
"paren.lparen"
"paren.lparen",
"variable.parameter",
"paren.rparen"
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
}, {
token : "constant.language.boolean",
regex : /(?:true|false)\b/
@ -536,7 +541,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
merge : true,
@ -564,9 +568,10 @@ var JavaScriptHighlightRules = function() {
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
@ -574,6 +579,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
@ -589,7 +595,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
@ -598,24 +605,7 @@ var JavaScriptHighlightRules = function() {
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
next: "regex_character_class",
merge: true
}, {
token: "empty",
@ -653,18 +643,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
regex : '[^"\\\\]+'
}, {
token : "string",
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
regex : '"',
next : "start"
}
],
"qstring" : [
@ -673,24 +656,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe
}, {
token : "string",
regex : "[^'\\\\]+",
merge : true
regex : "[^'\\\\]+"
}, {
token : "string",
regex : "\\\\$",
next : "qstring",
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
regex : "'",
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -768,24 +744,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -520,7 +520,7 @@ var PgsqlHighlightRules = function() {
token : "comment",
regex : "--.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi-line comment
merge : true,
@ -649,7 +649,7 @@ var PgsqlHighlightRules = function() {
]
};
this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]);
this.embedRules(DocCommentHighlightRules, "doc-", [ new DocCommentHighlightRules().getEndRule("start") ]);
this.embedRules(PerlHighlightRules, "perl-", [{token : "string", regex : "\\$perl\\$", next : "statement"}]);
this.embedRules(PythonHighlightRules, "python-", [{token : "string", regex : "\\$python\\$", next : "statement"}]);
};
@ -730,24 +730,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -520,7 +520,7 @@ var PgsqlHighlightRules = function() {
token : "comment",
regex : "--.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
new DocCommentHighlightRules().getStartRule("doc-start"),
{
token : "comment", // multi-line comment
merge : true,
@ -649,7 +649,7 @@ var PgsqlHighlightRules = function() {
]
};
this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]);
this.embedRules(DocCommentHighlightRules, "doc-", [ new DocCommentHighlightRules().getEndRule("start") ]);
this.embedRules(PerlHighlightRules, "perl-", [{token : "string", regex : "\\$perl\\$", next : "statement"}]);
this.embedRules(PythonHighlightRules, "python-", [{token : "string", regex : "\\$python\\$", next : "statement"}]);
};
@ -730,24 +730,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -164,7 +164,7 @@ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocComme
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var PhpHighlightRules = function() {
var docComment = DocCommentHighlightRules;
var docComment = new 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|' +
@ -1269,7 +1269,7 @@ var PhpHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(PhpHighlightRules, TextHighlightRules);
@ -1347,24 +1347,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -164,7 +164,7 @@ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocComme
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var PhpHighlightRules = function() {
var docComment = DocCommentHighlightRules;
var docComment = new 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|' +
@ -1269,7 +1269,7 @@ var PhpHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(PhpHighlightRules, TextHighlightRules);
@ -1347,24 +1347,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -197,7 +197,7 @@ var scadHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("start"),
new DocCommentHighlightRules().getStartRule("start"),
{
token : "comment", // multi line comment
merge : true,
@ -291,7 +291,7 @@ var scadHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(scadHighlightRules, TextHighlightRules);
@ -369,24 +369,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -197,7 +197,7 @@ var scadHighlightRules = function() {
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("start"),
new DocCommentHighlightRules().getStartRule("start"),
{
token : "comment", // multi line comment
merge : true,
@ -291,7 +291,7 @@ var scadHighlightRules = function() {
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
[ new DocCommentHighlightRules().getEndRule("start") ]);
};
oop.inherits(scadHighlightRules, TextHighlightRules);
@ -369,24 +369,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
(function() {
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
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
};
};
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules;

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show more