From df94066e3af02ff02d5ab4d033a3d603f743234c Mon Sep 17 00:00:00 2001 From: bjculkin Date: Mon, 12 Feb 2018 22:45:04 -0500 Subject: Formatting pass --- .../java/bjc/utils/parserutils/TokenTransformer.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'base/src/main/java/bjc/utils/parserutils/TokenTransformer.java') diff --git a/base/src/main/java/bjc/utils/parserutils/TokenTransformer.java b/base/src/main/java/bjc/utils/parserutils/TokenTransformer.java index 30ccc5a..5a37596 100644 --- a/base/src/main/java/bjc/utils/parserutils/TokenTransformer.java +++ b/base/src/main/java/bjc/utils/parserutils/TokenTransformer.java @@ -30,7 +30,8 @@ final class TokenTransformer implements Consumer { @Override public ConstructorState apply(final ConstructorState pair) { /* - * Replace the current AST with the result of handling an operator + * Replace the current AST with the result of handling + * an operator */ return new ConstructorState<>(pair.bindLeft(queuedASTs -> { return handleOperator(queuedASTs); @@ -46,13 +47,14 @@ final class TokenTransformer implements Consumer { /* * Handle special operators */ - if (isSpecialOperator.test(element)) { + if(isSpecialOperator.test(element)) { newAST = handleSpecialOperator.apply(element).apply(queuedASTs); } else { /* - * Error if we don't have enough for a binary operator + * Error if we don't have enough for a binary + * operator */ - if (queuedASTs.size() < 2) { + if(queuedASTs.size() < 2) { final String msg = String.format( "Attempted to parse binary operator without enough operands\n\tProblem operator is: %s\n\tPossible operand is: %s", element.toString(), queuedASTs.peek().toString()); @@ -108,7 +110,7 @@ final class TokenTransformer implements Consumer { /* * Handle operators */ - if (operatorPredicate.test(element)) { + if(operatorPredicate.test(element)) { initialState.transform(new OperatorHandler(element)); } else { final ITree newAST = new Tree<>(element); @@ -118,7 +120,9 @@ final class TokenTransformer implements Consumer { */ initialState.transform(pair -> { /* - * Transform the pair, ignoring the current AST in favor of the one consisting of the current element + * Transform the pair, ignoring the current AST + * in favor of the one consisting of the current + * element */ return new ConstructorState<>(pair.bindLeft(queue -> { queue.push(newAST); -- cgit v1.2.3