Multiple line commenting highlight fails when contains a single line comment.

fix #426
This commit is contained in:
Fabian Jakobs 2011-09-28 12:20:36 +02:00
commit 314b95eb78
2 changed files with 27 additions and 0 deletions

View file

@ -161,6 +161,11 @@ var JavaScriptHighlightRules = function() {
// makes sure we don't mix up regexps with the divison operator
"regex_allowed": [
{
token : "comment", // multi line comment
merge : true,
regex : "\\/\\*",
next : "comment_regex_allowed"
}, {
token : "comment",
regex : "\\/\\/.*$"
}, {
@ -180,10 +185,23 @@ var JavaScriptHighlightRules = function() {
next: "start"
}
],
"comment_regex_allowed" : [
{
token : "comment", // closing comment
regex : ".*?\\*\\/",
merge : true,
next : "regex_allowed"
}, {
token : "comment", // comment spanning whole line
merge : true,
regex : ".+"
}
],
"comment" : [
{
token : "comment", // closing comment
regex : ".*?\\*\\/",
merge : true,
next : "start"
}, {
token : "comment", // comment spanning whole line