make xml strings non greedy to allow better mixed modes

This commit is contained in:
nightwing 2012-12-08 22:16:18 +04:00
commit 0c360f39a6

View file

@ -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) {