Report unclosed strings as well. Fixes #188"

This commit is contained in:
Tom MacWright 2012-10-08 18:03:18 -04:00
parent 896b247fe9
commit 67f007064a

View File

@ -273,11 +273,19 @@ carto.Parser = function Parser(env) {
}
}
if (level > 0) {
// TODO: make invalid instead
throw makeError({
message: 'Missing closing `}`',
index: i
});
if (inString) {
// TODO: make invalid instead
throw makeError({
message: 'Missing closing ' + inString,
index: i
});
} else {
// TODO: make invalid instead
throw makeError({
message: 'Missing closing `}`',
index: i
});
}
}
return chunks.map(function(c) { return c.join(''); });