diff --git a/src/token/RightParenthesis.java b/src/token/RightParenthesis.java index 99829c5..8c15054 100644 --- a/src/token/RightParenthesis.java +++ b/src/token/RightParenthesis.java @@ -22,7 +22,7 @@ public class RightParenthesis extends Token { } @Override - public TailCall parseListBackwards(Cons accumulator, Supplier getNextToken) { + public TailCall parseListBackwards(Cons accumulator, Supplier getNextToken) { return done(accumulator); } diff --git a/src/token/Token.java b/src/token/Token.java index b5808d8..0f7c833 100644 --- a/src/token/Token.java +++ b/src/token/Token.java @@ -40,12 +40,12 @@ public abstract class Token { public abstract SExpression parseSExpression(Supplier getNextToken); public SExpression parseSExpressionTail(Supplier getNextToken) { - Cons list = (Cons) parseListBackwards(NIL, getNextToken).invoke(); + Cons list = parseListBackwards(NIL, getNextToken).invoke(); return reverse(NIL, list).invoke(); } - public TailCall parseListBackwards(Cons accumulator, Supplier getNextToken) { + public TailCall parseListBackwards(Cons accumulator, Supplier getNextToken) { Cons nextAccumulator = new Cons(parseSExpression(getNextToken), accumulator); Token next = getNextToken.get();