fix highlighting of /0|1{,10}/ in javascript
This commit is contained in:
parent
3b911019f1
commit
21805efa88
5 changed files with 34 additions and 11 deletions
|
|
@ -4,6 +4,8 @@ function foo(items, nada) {
|
||||||
} // Real Tab.
|
} // 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
|
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 = / / / / /
|
a=/a/ jk = / / / / /
|
||||||
/************************************/
|
/************************************/
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,9 @@
|
||||||
{
|
{
|
||||||
"state": "start",
|
"state": "start",
|
||||||
"data": [
|
"data": [
|
||||||
[ "keyword", "using" ],
|
[ "keyword.control", "using" ],
|
||||||
[ "text", " " ],
|
[ "text", " " ],
|
||||||
[ "keyword", "namespace" ],
|
[ "keyword.operator", "namespace" ],
|
||||||
[ "text", " " ],
|
[ "text", " " ],
|
||||||
[ "identifier", "std" ],
|
[ "identifier", "std" ],
|
||||||
[ "punctuation.operator", ";" ]
|
[ "punctuation.operator", ";" ]
|
||||||
|
|
@ -35,9 +35,9 @@
|
||||||
{
|
{
|
||||||
"state": "start",
|
"state": "start",
|
||||||
"data": [
|
"data": [
|
||||||
[ "keyword", "int" ],
|
[ "storage.type", "int" ],
|
||||||
[ "text", " " ],
|
[ "text", " " ],
|
||||||
[ "identifier", "main" ],
|
[ "entity.name.function", "main" ],
|
||||||
[ "text", " " ],
|
[ "text", " " ],
|
||||||
[ "paren.lparen", "(" ],
|
[ "paren.lparen", "(" ],
|
||||||
[ "paren.rparen", ")" ]
|
[ "paren.rparen", ")" ]
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
"state": "start",
|
"state": "start",
|
||||||
"data": [
|
"data": [
|
||||||
[ "text", " " ],
|
[ "text", " " ],
|
||||||
[ "keyword", "int" ],
|
[ "storage.type", "int" ],
|
||||||
[ "text", " " ],
|
[ "text", " " ],
|
||||||
[ "identifier", "a" ],
|
[ "identifier", "a" ],
|
||||||
[ "punctuation.operator", "," ],
|
[ "punctuation.operator", "," ],
|
||||||
|
|
@ -109,7 +109,7 @@
|
||||||
"state": "start",
|
"state": "start",
|
||||||
"data": [
|
"data": [
|
||||||
[ "text", " " ],
|
[ "text", " " ],
|
||||||
[ "keyword", "return" ],
|
[ "keyword.control", "return" ],
|
||||||
[ "text", " " ],
|
[ "text", " " ],
|
||||||
[ "constant.numeric", "0" ],
|
[ "constant.numeric", "0" ],
|
||||||
[ "punctuation.operator", ";" ]
|
[ "punctuation.operator", ";" ]
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
"data": [
|
"data": [
|
||||||
[ "keyword", "void" ],
|
[ "keyword", "void" ],
|
||||||
[ "text", " " ],
|
[ "text", " " ],
|
||||||
[ "identifier", "main" ],
|
[ "entity.name.function", "main" ],
|
||||||
[ "paren.lparen", "(" ],
|
[ "paren.lparen", "(" ],
|
||||||
[ "paren.rparen", ")" ],
|
[ "paren.rparen", ")" ],
|
||||||
[ "text", " " ],
|
[ "text", " " ],
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,24 @@
|
||||||
"state": "start",
|
"state": "start",
|
||||||
"data": []
|
"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",
|
"state": "start",
|
||||||
"data": [
|
"data": [
|
||||||
|
|
@ -118,10 +136,13 @@
|
||||||
[ "constant.language.escape", "$" ],
|
[ "constant.language.escape", "$" ],
|
||||||
[ "constant.language.escape", "^" ],
|
[ "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", ")" ],
|
||||||
[ "constant.language.escape", "(?=" ],
|
[ "constant.language.escape", "(?=" ],
|
||||||
[ "string.regexp", "a|" ],
|
[ "string.regexp", "a" ],
|
||||||
|
[ "constant.language.escape", "|" ],
|
||||||
[ "constant.language.escape", ")" ],
|
[ "constant.language.escape", ")" ],
|
||||||
[ "constant.language.escape", "(?!" ],
|
[ "constant.language.escape", "(?!" ],
|
||||||
[ "string.regexp", "y" ],
|
[ "string.regexp", "y" ],
|
||||||
|
|
|
||||||
|
|
@ -259,10 +259,10 @@ var JavaScriptHighlightRules = function() {
|
||||||
}, {
|
}, {
|
||||||
// operators
|
// operators
|
||||||
token : "constant.language.escape",
|
token : "constant.language.escape",
|
||||||
regex: /\(\?[:=!]|\)|\{\d+,?(?:\d+)?}|[+*]\?|[(|)$^+*?]/
|
regex: /\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[(|)$^+*?]/
|
||||||
}, {
|
}, {
|
||||||
token: "string.regexp",
|
token: "string.regexp",
|
||||||
regex: /{|[^\[\\{()$^+*?\/]+/,
|
regex: /{|[^{\[\/\\(|)$^+*?]+/,
|
||||||
merge: true
|
merge: true
|
||||||
}, {
|
}, {
|
||||||
token: "constant.language.escape",
|
token: "constant.language.escape",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue