Highlight regular expressions

This commit is contained in:
Fabian Jakobs 2010-10-25 18:35:25 +02:00
commit 05cd13b45e
7 changed files with 20 additions and 2 deletions

View file

@ -46,7 +46,7 @@ JavaScriptHighlightRules = function() {
regex : "\\/\\*",
next : "comment"
}, {
token : "regex",
token : "string.regexp",
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).;]|$)"
}, {
token : "string", // single line

View file

@ -127,6 +127,10 @@ color:#B52A1D;\
color:#0B6125;\
}\
\
.ace-dawn .ace_string.ace_regexp {\
color:#CF5628;\
}\
\
.ace-dawn .ace_comment {\
font-style:italic;\
color:#5A525F;\

View file

@ -123,6 +123,10 @@ background-color:#FF0000;\
color:#A5C261;\
}\
\
.ace-idle-fingers .ace_string.ace_regexp {\
color:#CCCC33;\
}\
\
.ace-idle-fingers .ace_comment {\
font-style:italic;\
color:#BC9458;\

View file

@ -125,6 +125,10 @@ color:#D2A8A1;\
color:#8F9D6A;\
}\
\
.ace-twilight .ace_string.ace_regexp {\
color:#E9C062;\
}\
\
.ace-twilight .ace_comment {\
font-style:italic;\
color:#5F5A60;\

View file

@ -114,6 +114,6 @@
background: rgb(232, 242, 254);
}
.ace-tm .ace_regex {
.ace-tm .ace_string.ace_regex {
color: rgb(255, 0, 0)
}

View file

@ -119,6 +119,10 @@
%string%
}
.%cssClass% .ace_string.ace_regexp {
%string.regexp%
}
.%cssClass% .ace_comment {
%comment%
}

View file

@ -74,6 +74,8 @@ var supportedScopes = {
"invalid.deprecated": "invalid.deprecated",
"string": "string",
"string.regexp": "string.regexp",
"comment": "comment",
"comment.documentation": "comment.doc",
"comment.documentation.tag": "comment.doc.tag",