Added not operator to the parser

This commit is contained in:
Stefan Zermatten
2020-11-05 15:32:01 +02:00
parent 4dad2c41e5
commit 1f0678b50b
4 changed files with 39 additions and 2 deletions

View File

@@ -13,7 +13,7 @@ export default class OperatorNode extends ParseNode {
let leftNode = this.left[fn](scope, context);
let rightNode = this.right[fn](scope, context);
let left, right;
if (leftNode.type !== 'number' || rightNode.type !== 'number'){
if (!(leftNode instanceof ConstantNode) || !(rightNode instanceof ConstantNode)){
return new OperatorNode({
left: leftNode,
right: rightNode,