From 01136c6796e21f023713e026674576d8e623462d Mon Sep 17 00:00:00 2001 From: EVE Date: Mon, 13 Mar 2017 16:41:45 -0400 Subject: Formatting --- .../v1/ast/optimization/ArithmeticCollapser.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'dice-lang/src/bjc/dicelang/v1/ast/optimization/ArithmeticCollapser.java') diff --git a/dice-lang/src/bjc/dicelang/v1/ast/optimization/ArithmeticCollapser.java b/dice-lang/src/bjc/dicelang/v1/ast/optimization/ArithmeticCollapser.java index 0d10a07..9fb0a5e 100644 --- a/dice-lang/src/bjc/dicelang/v1/ast/optimization/ArithmeticCollapser.java +++ b/dice-lang/src/bjc/dicelang/v1/ast/optimization/ArithmeticCollapser.java @@ -13,17 +13,15 @@ import bjc.utils.funcdata.IList; import bjc.utils.data.Tree; class ArithmeticCollapser { - private BinaryOperator reducer; - private OperatorDiceNode type; + private BinaryOperator reducer; + private OperatorDiceNode type; - public ArithmeticCollapser(BinaryOperator reducr, - OperatorDiceNode typ) { + public ArithmeticCollapser(BinaryOperator reducr, OperatorDiceNode typ) { reducer = reducr; this.type = typ; } - public ITree collapse( - IList> children) { + public ITree collapse(IList> children) { boolean allConstant = children.allMatch((subtree) -> { return subtree.transformHead((node) -> { if (node.getType() == DiceASTType.LITERAL) { @@ -40,10 +38,8 @@ class ArithmeticCollapser { int initState = DiceASTUtils.literalToInteger(children.first()); - return children.tail().reduceAux(initState, - (currentNode, state) -> { - return reducer.apply(state, - DiceASTUtils.literalToInteger(currentNode)); - }, (state) -> new Tree<>(new IntegerLiteralNode(state))); + return children.tail().reduceAux(initState, (currentNode, state) -> { + return reducer.apply(state, DiceASTUtils.literalToInteger(currentNode)); + }, (state) -> new Tree<>(new IntegerLiteralNode(state))); } } -- cgit v1.2.3