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) {
|
function string(state) {
|
||||||
return [{
|
return [{
|
||||||
token : "string",
|
token : "string",
|
||||||
regex : '".*?"'
|
regex : '"',
|
||||||
}, {
|
|
||||||
token : "string", // multi line string start
|
|
||||||
merge : true,
|
|
||||||
regex : '["].*',
|
|
||||||
next : state + "_qqstring"
|
next : state + "_qqstring"
|
||||||
}, {
|
}, {
|
||||||
token : "string",
|
token : "string",
|
||||||
regex : "'.*?'"
|
regex : "'",
|
||||||
}, {
|
|
||||||
token : "string", // multi line string start
|
|
||||||
merge : true,
|
|
||||||
regex : "['].*",
|
|
||||||
next : state + "_qstring"
|
next : state + "_qstring"
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
function multiLineString(quote, state) {
|
function multiLineString(quote, state) {
|
||||||
return [{
|
return [
|
||||||
token : "string",
|
{token : "string", regex : quote, next : state},
|
||||||
merge : true,
|
{
|
||||||
regex : ".*?" + quote,
|
token : "constant.language.escape",
|
||||||
next : state
|
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
|
||||||
}, {
|
},
|
||||||
token : "string",
|
{token : "string", merge : true, regex : '\\w+|.|\\s+'}
|
||||||
merge : true,
|
];
|
||||||
regex : '.+'
|
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.tag = function(states, name, nextState, tagMap) {
|
exports.tag = function(states, name, nextState, tagMap) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue