Proper comment rules in js syntax.
This commit is contained in:
parent
969f94d98c
commit
ca97c230f0
1 changed files with 8 additions and 3 deletions
|
|
@ -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" : [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue