make xml strings non greedy to allow better mixed modes
This commit is contained in:
parent
70cd01d858
commit
0c360f39a6
1 changed files with 10 additions and 20 deletions
|
|
@ -34,34 +34,24 @@ define(function(require, exports, module) {
|
|||
function string(state) {
|
||||
return [{
|
||||
token : "string",
|
||||
regex : '".*?"'
|
||||
}, {
|
||||
token : "string", // multi line string start
|
||||
merge : true,
|
||||
regex : '["].*',
|
||||
regex : '"',
|
||||
next : state + "_qqstring"
|
||||
}, {
|
||||
token : "string",
|
||||
regex : "'.*?'"
|
||||
}, {
|
||||
token : "string", // multi line string start
|
||||
merge : true,
|
||||
regex : "['].*",
|
||||
regex : "'",
|
||||
next : state + "_qstring"
|
||||
}];
|
||||
}
|
||||
|
||||
function multiLineString(quote, state) {
|
||||
return [{
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : ".*?" + quote,
|
||||
next : state
|
||||
}, {
|
||||
token : "string",
|
||||
merge : true,
|
||||
regex : '.+'
|
||||
}];
|
||||
return [
|
||||
{token : "string", regex : quote, next : state},
|
||||
{
|
||||
token : "constant.language.escape",
|
||||
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
|
||||
},
|
||||
{token : "string", merge : true, regex : '\\w+|.|\\s+'}
|
||||
];
|
||||
}
|
||||
|
||||
exports.tag = function(states, name, nextState, tagMap) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue