Fixed parenthesis being discarded from compiled calculations in cases where they should not be
This commit is contained in:
@@ -8,13 +8,12 @@ export default class ParenthesisNode extends ParseNode {
|
|||||||
resolve(fn, scope, context){
|
resolve(fn, scope, context){
|
||||||
let content = this.content[fn](scope, context);
|
let content = this.content[fn](scope, context);
|
||||||
if (
|
if (
|
||||||
content.constructor.name === 'IfNode' ||
|
content.constructor.name === 'ConstantNode' ||
|
||||||
content.constructor.name === 'OperatorNode' ||
|
content.constructor.name === 'ErrorNode'
|
||||||
content.constructor.name === 'RollNode'
|
|
||||||
){
|
){
|
||||||
return new ParenthesisNode({content, previousNodes: [this]});
|
|
||||||
} else {
|
|
||||||
return content;
|
return content;
|
||||||
|
} else {
|
||||||
|
return new ParenthesisNode({content});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
toString(){
|
toString(){
|
||||||
|
|||||||
Reference in New Issue
Block a user