Update formatter settings
This commit is contained in:
parent
6cd5fb66a4
commit
e8e9d2e12d
|
@ -15,7 +15,9 @@ public abstract class LineColumnException extends LispException {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getMessage() {
|
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());
|
position.getColumnNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,9 @@ public class ArgumentValidator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getMessage() {
|
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());
|
getExpectedTypeName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,8 @@ public class UserDefinedFunction extends LispFunction {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getMessage() {
|
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);
|
parameters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,15 @@ public interface TailCall<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
default T invoke() {
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -61,7 +61,8 @@ public class BackquoteEvaluatorTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void evaluateListWithComma() {
|
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"))));
|
new LispNumber("9"))));
|
||||||
BackquoteEvaluator evaluator = createBackquoteEvaluator(input);
|
BackquoteEvaluator evaluator = createBackquoteEvaluator(input);
|
||||||
|
|
||||||
|
@ -133,11 +134,17 @@ public class BackquoteEvaluatorTest {
|
||||||
Cons list2 = makeList(new Symbol("+"), new LispNumber("20"), new LispNumber("5"));
|
Cons list2 = makeList(new Symbol("+"), new LispNumber("20"), new LispNumber("5"));
|
||||||
Cons list3 = makeList(new Symbol("LIST"), new LispNumber("7"), new LispNumber("6"));
|
Cons list3 = makeList(new Symbol("LIST"), new LispNumber("7"), new LispNumber("6"));
|
||||||
|
|
||||||
SExpression input = makeList(new LispNumber("78"), new CommaExpression(new AtSignExpression(list1)),
|
SExpression input = makeList(new LispNumber("78"),
|
||||||
new CommaExpression(list2), new CommaExpression(list3), new LispString("\"sky\""));
|
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"),
|
SExpression expected = makeList(new LispNumber("78"),
|
||||||
new LispNumber("25"), makeList(new LispNumber("7"), new LispNumber("6")),
|
new LispNumber("1"),
|
||||||
|
new LispNumber("9"),
|
||||||
|
new LispNumber("25"),
|
||||||
|
makeList(new LispNumber("7"), new LispNumber("6")),
|
||||||
new LispString("\"sky\""));
|
new LispString("\"sky\""));
|
||||||
|
|
||||||
BackquoteEvaluator evaluator = createBackquoteEvaluator(input);
|
BackquoteEvaluator evaluator = createBackquoteEvaluator(input);
|
||||||
|
|
Loading…
Reference in New Issue