fix highlighting of /0|1{,10}/ in javascript

This commit is contained in:
nightwing 2012-09-28 12:31:53 +04:00
commit 21805efa88
5 changed files with 34 additions and 11 deletions

View file

@ -4,6 +4,8 @@ function foo(items, nada) {
} // Real Tab.
}
regexp = /p|p/ // ends here
r = /d{1,2}?f{e}++r*?\d+?[]r[^r-o\f\f[\f]?r{7}+r\{7}+rr--rr$^(?:d|s)(?=a|)(?!y)[]|$?|^*/ o
a=/a/ jk = / / / / /
/************************************/

View file

@ -20,9 +20,9 @@
{
"state": "start",
"data": [
[ "keyword", "using" ],
[ "keyword.control", "using" ],
[ "text", " " ],
[ "keyword", "namespace" ],
[ "keyword.operator", "namespace" ],
[ "text", " " ],
[ "identifier", "std" ],
[ "punctuation.operator", ";" ]
@ -35,9 +35,9 @@
{
"state": "start",
"data": [
[ "keyword", "int" ],
[ "storage.type", "int" ],
[ "text", " " ],
[ "identifier", "main" ],
[ "entity.name.function", "main" ],
[ "text", " " ],
[ "paren.lparen", "(" ],
[ "paren.rparen", ")" ]
@ -53,7 +53,7 @@
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "int" ],
[ "storage.type", "int" ],
[ "text", " " ],
[ "identifier", "a" ],
[ "punctuation.operator", "," ],
@ -109,7 +109,7 @@
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "return" ],
[ "keyword.control", "return" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "punctuation.operator", ";" ]

View file

@ -41,7 +41,7 @@
"data": [
[ "keyword", "void" ],
[ "text", " " ],
[ "identifier", "main" ],
[ "entity.name.function", "main" ],
[ "paren.lparen", "(" ],
[ "paren.rparen", ")" ],
[ "text", " " ],

View file

@ -81,6 +81,24 @@
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "identifier", "regexp" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "string.regexp", "/p" ],
[ "constant.language.escape", "|" ],
[ "string.regexp", "p/" ],
[ "text", " " ],
[ "comment", "// ends here" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
@ -118,10 +136,13 @@
[ "constant.language.escape", "$" ],
[ "constant.language.escape", "^" ],
[ "constant.language.escape", "(?:" ],
[ "string.regexp", "d|s" ],
[ "string.regexp", "d" ],
[ "constant.language.escape", "|" ],
[ "string.regexp", "s" ],
[ "constant.language.escape", ")" ],
[ "constant.language.escape", "(?=" ],
[ "string.regexp", "a|" ],
[ "string.regexp", "a" ],
[ "constant.language.escape", "|" ],
[ "constant.language.escape", ")" ],
[ "constant.language.escape", "(?!" ],
[ "string.regexp", "y" ],

View file

@ -259,10 +259,10 @@ var JavaScriptHighlightRules = function() {
}, {
// operators
token : "constant.language.escape",
regex: /\(\?[:=!]|\)|\{\d+,?(?:\d+)?}|[+*]\?|[(|)$^+*?]/
regex: /\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[(|)$^+*?]/
}, {
token: "string.regexp",
regex: /{|[^\[\\{()$^+*?\/]+/,
regex: /{|[^{\[\/\\(|)$^+*?]+/,
merge: true
}, {
token: "constant.language.escape",