diff --git a/src/error/LineColumnException.java b/src/error/LineColumnException.java index 18aa592..6da696a 100644 --- a/src/error/LineColumnException.java +++ b/src/error/LineColumnException.java @@ -15,7 +15,9 @@ public abstract class LineColumnException extends LispException { @Override public String getMessage() { - return format("{0} - line {1}, column {2}", getMessagePrefix(), position.getLineNumber(), + return format("{0} - line {1}, column {2}", + getMessagePrefix(), + position.getLineNumber(), position.getColumnNumber()); } diff --git a/src/function/ArgumentValidator.java b/src/function/ArgumentValidator.java index 7d1cfc8..9752f8b 100644 --- a/src/function/ArgumentValidator.java +++ b/src/function/ArgumentValidator.java @@ -219,7 +219,9 @@ public class ArgumentValidator { @Override public String getMessage() { - return format("{0}: {1} is not the expected type of ''{2}''", functionName, argument, + return format("{0}: {1} is not the expected type of ''{2}''", + functionName, + argument, getExpectedTypeName()); } diff --git a/src/function/UserDefinedFunction.java b/src/function/UserDefinedFunction.java index 2e6f413..11fd605 100644 --- a/src/function/UserDefinedFunction.java +++ b/src/function/UserDefinedFunction.java @@ -143,7 +143,8 @@ public class UserDefinedFunction extends LispFunction { @Override public String getMessage() { - return format("unexpected parameters following ''&rest'' in definition of {0}: {1}", functionName, + return format("unexpected parameters following ''&rest'' in definition of {0}: {1}", + functionName, parameters); } } diff --git a/src/recursion/tail/TailCall.java b/src/recursion/tail/TailCall.java index 0f8f7ef..2c2edf7 100644 --- a/src/recursion/tail/TailCall.java +++ b/src/recursion/tail/TailCall.java @@ -16,7 +16,15 @@ public interface TailCall { } default T invoke() { - return Stream.iterate(this, TailCall::apply).filter(TailCall::isComplete).findFirst().get().result(); + // @formatter:off + + return Stream.iterate(this, TailCall::apply) + .filter(TailCall::isComplete) + .findFirst() + .get() + .result(); + + // @formatter:on } -} \ No newline at end of file +} diff --git a/test/function/builtin/BackquoteEvaluatorTest.java b/test/function/builtin/BackquoteEvaluatorTest.java index 401f961..88a3241 100644 --- a/test/function/builtin/BackquoteEvaluatorTest.java +++ b/test/function/builtin/BackquoteEvaluatorTest.java @@ -61,7 +61,8 @@ public class BackquoteEvaluatorTest { @Test public void evaluateListWithComma() { - SExpression input = makeList(new CommaExpression(makeList(new Symbol("+"), new LispNumber("1"), + SExpression input = makeList(new CommaExpression(makeList(new Symbol("+"), + new LispNumber("1"), new LispNumber("9")))); BackquoteEvaluator evaluator = createBackquoteEvaluator(input); @@ -133,11 +134,17 @@ public class BackquoteEvaluatorTest { Cons list2 = makeList(new Symbol("+"), new LispNumber("20"), new LispNumber("5")); Cons list3 = makeList(new Symbol("LIST"), new LispNumber("7"), new LispNumber("6")); - SExpression input = makeList(new LispNumber("78"), new CommaExpression(new AtSignExpression(list1)), - new CommaExpression(list2), new CommaExpression(list3), new LispString("\"sky\"")); + SExpression input = makeList(new LispNumber("78"), + new CommaExpression(new AtSignExpression(list1)), + new CommaExpression(list2), + new CommaExpression(list3), + new LispString("\"sky\"")); - SExpression expected = makeList(new LispNumber("78"), new LispNumber("1"), new LispNumber("9"), - new LispNumber("25"), makeList(new LispNumber("7"), new LispNumber("6")), + SExpression expected = makeList(new LispNumber("78"), + new LispNumber("1"), + new LispNumber("9"), + new LispNumber("25"), + makeList(new LispNumber("7"), new LispNumber("6")), new LispString("\"sky\"")); BackquoteEvaluator evaluator = createBackquoteEvaluator(input);