Fix expression parser to require parsing full string
This commit is contained in:
parent
1a46130b1d
commit
21e8d95f98
2 changed files with 27 additions and 15 deletions
src/lib
|
@ -12,6 +12,10 @@ export function Expr({}, argv: TextPiece[]): ProcResult {
|
|||
const parser = new ExpressionParser(expression);
|
||||
const result = parser.parseSubExpression(0);
|
||||
|
||||
if(parser.pos != expression.length) {
|
||||
return {error: "Couldn't parse full expression"}
|
||||
}
|
||||
|
||||
if ("value" in result) {
|
||||
return { text: String(result.value) };
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue