From 8212af7c70d1603013da32e0501969ed98431caf Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Wed, 11 May 2016 21:10:53 -0400 Subject: Adapt to upstream changes --- .../java/bjc/dicelang/ast/ArithmeticCollapser.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'dice-lang/src/main/java/bjc/dicelang/ast/ArithmeticCollapser.java') diff --git a/dice-lang/src/main/java/bjc/dicelang/ast/ArithmeticCollapser.java b/dice-lang/src/main/java/bjc/dicelang/ast/ArithmeticCollapser.java index c97471d..ac53c81 100644 --- a/dice-lang/src/main/java/bjc/dicelang/ast/ArithmeticCollapser.java +++ b/dice-lang/src/main/java/bjc/dicelang/ast/ArithmeticCollapser.java @@ -4,7 +4,7 @@ import java.util.function.BinaryOperator; import bjc.utils.data.IPair; import bjc.utils.data.Pair; -import bjc.utils.funcdata.IFunctionalList; +import bjc.utils.funcdata.IList; import bjc.utils.funcdata.ITree; import bjc.utils.funcdata.Tree; @@ -30,7 +30,7 @@ final class ArithmeticCollapser implements IOperatorCollapser { @Override public IPair> apply( - IFunctionalList>> nodes) { + IList>> nodes) { IPair> initState = new Pair<>( new IntegerResult(0), new Tree<>(type)); @@ -49,11 +49,11 @@ final class ArithmeticCollapser implements IOperatorCollapser { return reducedState; } - private IFunctionalList combineArrayResults( + private IList combineArrayResults( IResult accumulatedValue, IResult currentValue) { - IFunctionalList currentList = ((ArrayResult) currentValue) + IList currentList = ((ArrayResult) currentValue) .getValue(); - IFunctionalList accumulatedList = ((ArrayResult) accumulatedValue) + IList accumulatedList = ((ArrayResult) accumulatedValue) .getValue(); if (currentList.getSize() != accumulatedList.getSize()) { @@ -61,7 +61,7 @@ final class ArithmeticCollapser implements IOperatorCollapser { "Can only apply operations to equal-length arrays"); } - IFunctionalList resultList = currentList.combineWith( + IList resultList = currentList.combineWith( accumulatedList, (currentNode, accumulatedNode) -> { boolean currentNotInt = currentNode .getType() != ResultType.INTEGER; @@ -95,21 +95,21 @@ final class ArithmeticCollapser implements IOperatorCollapser { if (!currentIsInt) { if (!accumulatedIsInt) { - IFunctionalList resultList = combineArrayResults( + IList resultList = combineArrayResults( accumulatedValue, currentValue); return new Pair<>(new ArrayResult(resultList), accumulatedTree); } - IFunctionalList resultList = halfCombineLists( + IList resultList = halfCombineLists( ((ArrayResult) currentValue).getValue(), accumulatedValue, true); return new Pair<>(new ArrayResult(resultList), accumulatedTree); } else if (!accumulatedIsInt) { - IFunctionalList resultList = halfCombineLists( + IList resultList = halfCombineLists( ((ArrayResult) accumulatedValue).getValue(), currentValue, false); @@ -126,8 +126,8 @@ final class ArithmeticCollapser implements IOperatorCollapser { accumulatedTree); } - private IFunctionalList halfCombineLists( - IFunctionalList list, IResult scalar, + private IList halfCombineLists( + IList list, IResult scalar, boolean scalarLeft) { if (scalar.getType() != ResultType.INTEGER) { throw new UnsupportedOperationException( -- cgit v1.2.3