Report unclosed strings as well. Fixes #188"
This commit is contained in:
parent
896b247fe9
commit
67f007064a
@ -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(''); });
|
||||
|
Loading…
Reference in New Issue
Block a user