added not() expression

This commit is contained in:
zadam
2020-05-27 00:09:19 +02:00
parent dc2d5a0a79
commit 55b210d7c5
4 changed files with 32 additions and 1 deletions

View File

@@ -255,6 +255,16 @@ function getExpression(tokens, parsingContext, level = 0) {
return exp;
}
else if (token === 'not') {
i += 1;
if (!Array.isArray(tokens[i])) {
parsingContext.addError(`not keyword should be followed by sub-expression in parenthesis, got ${tokens[i]} instead`);
continue;
}
expressions.push(new NotExp(getExpression(tokens[i], parsingContext, level++)));
}
else if (token === 'note') {
i++;