fix python string highlighting
This commit is contained in:
parent
44dae66318
commit
fcf4e764a3
1 changed files with 8 additions and 8 deletions
|
|
@ -72,7 +72,7 @@ PythonHighlightRules = function() {
|
|||
("").split("|")
|
||||
);
|
||||
|
||||
var strPre = "(?:(?:[rubRUB])|(?:[ubUB][rR]))?";
|
||||
var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?";
|
||||
|
||||
var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
|
||||
var octInteger = "(?:0[oO]?[0-7]+)";
|
||||
|
|
@ -93,24 +93,24 @@ PythonHighlightRules = function() {
|
|||
regex : "#.*$"
|
||||
}, {
|
||||
token : "string", // """ string
|
||||
regex : strPre + '"{3}(?:(?:.)|(?:^"{3}))*?"{3}'
|
||||
regex : strPre + '"{3}(?:[^\\\\]|\\\\.)*?"{3}'
|
||||
}, {
|
||||
token : "string", // multi line """ string start
|
||||
regex : strPre + '"{3}.*$',
|
||||
next : "qqstring"
|
||||
}, {
|
||||
token : "string", // " string
|
||||
regex : strPre + '"(?:(?:\\\\.)|(?:[^"\\\\]))*?"'
|
||||
regex : strPre + '"(?:[^\\\\]|\\\\.)*?"'
|
||||
}, {
|
||||
token : "string", // ''' string
|
||||
regex : strPre + "'{3}(?:(?:.)|(?:^'{3}))*?'{3}"
|
||||
regex : strPre + "'{3}(?:[^\\\\]|\\\\.)*?'{3}"
|
||||
}, {
|
||||
token : "string", // multi line ''' string start
|
||||
regex : strPre + "'{3}.*$",
|
||||
next : "qstring"
|
||||
}, {
|
||||
token : "string", // ' string
|
||||
regex : strPre + "'(?:(?:\\\\.)|(?:[^'\\\\]))*?'"
|
||||
regex : strPre + "'(?:[^\\\\]|\\\\.)*?'"
|
||||
}, {
|
||||
token : "constant.numeric", // imaginary
|
||||
regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b"
|
||||
|
|
@ -153,8 +153,8 @@ PythonHighlightRules = function() {
|
|||
regex : "\\s+"
|
||||
} ],
|
||||
"qqstring" : [ {
|
||||
token : "string", // multi line """ string end
|
||||
regex : '(?:^"{3})*?"{3}',
|
||||
token : "string", // multi line """ string end
|
||||
regex : '(?:[^\\\\]|\\\\.)*?"{3}',
|
||||
next : "start"
|
||||
}, {
|
||||
token : "string",
|
||||
|
|
@ -162,7 +162,7 @@ PythonHighlightRules = function() {
|
|||
} ],
|
||||
"qstring" : [ {
|
||||
token : "string", // multi line ''' string end
|
||||
regex : "(?:^'{3})*?'{3}",
|
||||
regex : "(?:[^\\\\]|\\\\.)*?'{3}",
|
||||
next : "start"
|
||||
}, {
|
||||
token : "string",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue