From 69c72e098701c818d95a91d756b40abf9215d7c2 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Tue, 2 Feb 2021 15:13:49 +0200 Subject: [PATCH] Fixed parenthesis being discarded from compiled calculations in cases where they should not be --- app/imports/parser/parseTree/ParenthesisNode.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/imports/parser/parseTree/ParenthesisNode.js b/app/imports/parser/parseTree/ParenthesisNode.js index cdf6ac8d..abe600b3 100644 --- a/app/imports/parser/parseTree/ParenthesisNode.js +++ b/app/imports/parser/parseTree/ParenthesisNode.js @@ -8,13 +8,12 @@ export default class ParenthesisNode extends ParseNode { resolve(fn, scope, context){ let content = this.content[fn](scope, context); if ( - content.constructor.name === 'IfNode' || - content.constructor.name === 'OperatorNode' || - content.constructor.name === 'RollNode' + content.constructor.name === 'ConstantNode' || + content.constructor.name === 'ErrorNode' ){ - return new ParenthesisNode({content, previousNodes: [this]}); - } else { return content; + } else { + return new ParenthesisNode({content}); } } toString(){