Proper comment rules in js syntax.

This commit is contained in:
DanyaPostfactum 2013-06-29 17:41:16 +10:00
commit ca97c230f0

View file

@ -86,7 +86,8 @@ var JavaScriptHighlightRules = function() {
"no_regex" : [ "no_regex" : [
{ {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : "\\/\\/",
next : "line_comment"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), DocCommentHighlightRules.getStartRule("doc-start"),
{ {
@ -216,7 +217,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token : "comment", token : "comment",
regex : "\\/\\/", regex : "\\/\\/",
next : "line_comment" next : "line_comment_regex_allowed"
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "\\/", regex: "\\/",
@ -309,8 +310,12 @@ var JavaScriptHighlightRules = function() {
{token : "comment", regex : "\\*\\/", next : "no_regex"}, {token : "comment", regex : "\\*\\/", next : "no_regex"},
{defaultToken : "comment"} {defaultToken : "comment"}
], ],
"line_comment_regex_allowed" : [
{token : "comment", regex : "$|^", next : "start"},
{defaultToken : "comment"}
],
"line_comment" : [ "line_comment" : [
{token : "comment", regex : "$", next : "start"}, {token : "comment", regex : "$|^", next : "no_regex"},
{defaultToken : "comment"} {defaultToken : "comment"}
], ],
"qqstring" : [ "qqstring" : [