From 0f00e35518b6aca259d67b50a80dfb133b5c9b66 Mon Sep 17 00:00:00 2001 From: Mike Cifelli Date: Sun, 19 Nov 2017 10:54:51 -0500 Subject: [PATCH] Refactor code --- src/token/RightParenthesis.java | 2 +- src/token/Token.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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();