Update code formatter

This commit is contained in:
Mike Cifelli 2018-03-17 09:52:53 -04:00
parent 114a3e4309
commit d0cffe7500
193 changed files with 108 additions and 247 deletions

View File

@ -1,8 +1,47 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JavaCodeStyleSettings>
<option name="DO_NOT_WRAP_AFTER_SINGLE_ANNOTATION" value="true" />
<option name="ANNOTATION_PARAMETER_WRAP" value="5" />
<option name="ALIGN_MULTILINE_ANNOTATION_PARAMETERS" value="true" />
</JavaCodeStyleSettings>
<XML>
<option name="XML_SPACE_INSIDE_EMPTY_TAG" value="true" />
</XML>
<codeStyleSettings language="JAVA">
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_CHAINED_METHODS" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION" value="true" />
<option name="SPACE_WITHIN_ARRAY_INITIALIZER_BRACES" value="true" />
<option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="5" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="RESOURCE_LIST_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="5" />
<option name="THROWS_LIST_WRAP" value="5" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="5" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="KEEP_SIMPLE_METHODS_IN_ONE_LINE" value="true" />
<option name="KEEP_SIMPLE_LAMBDAS_IN_ONE_LINE" value="true" />
<option name="KEEP_SIMPLE_CLASSES_IN_ONE_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="5" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="ENUM_CONSTANTS_WRAP" value="5" />
</codeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
<option name="INDENT_SIZE" value="2" />

View File

@ -152,5 +152,4 @@ public class LispMain {
return builder.build();
}
}

View File

@ -151,5 +151,4 @@ public class RuntimeEnvironment {
public String decorateCriticalOutput(String criticalOutput) {
return criticalOutputDecorator.apply(criticalOutput);
}
}

View File

@ -17,5 +17,4 @@ public abstract class CriticalLineColumnException extends LineColumnException {
public Severity getSeverity() {
return CRITICAL;
}
}

View File

@ -12,5 +12,4 @@ public abstract class CriticalLispException extends LispException {
public Severity getSeverity() {
return CRITICAL;
}
}

View File

@ -53,7 +53,6 @@ public class ErrorManager {
public static enum Severity {
WARNING {
@Override
public String decorate(String warningOutput, RuntimeEnvironment environment) {
return environment.decorateWarningOutput(warningOutput);
@ -66,7 +65,6 @@ public class ErrorManager {
},
ERROR {
@Override
public String decorate(String errorOutput, RuntimeEnvironment environment) {
return environment.decorateErrorOutput(errorOutput);
@ -79,7 +77,6 @@ public class ErrorManager {
},
CRITICAL {
@Override
public String decorate(String criticalOutput, RuntimeEnvironment environment) {
return environment.decorateCriticalOutput(criticalOutput);
@ -95,5 +92,4 @@ public class ErrorManager {
public abstract String toDisplayString();
}
}

View File

@ -22,5 +22,4 @@ public abstract class LineColumnException extends LispException {
}
public abstract String getMessagePrefix();
}

View File

@ -11,5 +11,4 @@ public abstract class LispException extends RuntimeException {
public Severity getSeverity() {
return ERROR;
}
}

View File

@ -12,5 +12,4 @@ public abstract class LispWarning extends LispException {
public Severity getSeverity() {
return WARNING;
}
}

View File

@ -29,5 +29,4 @@ public class FilePosition {
public void setColumnNumber(int columnNumber) {
this.columnNumber = columnNumber;
}
}

View File

@ -28,5 +28,4 @@ public class FilePositionTracker {
lineNumber++;
columnNumber = 0;
}
}

View File

@ -231,5 +231,4 @@ public class ArgumentValidator {
return (displayName == null) ? "unknown" : displayName.value();
}
}
}

View File

@ -10,5 +10,4 @@ import java.lang.annotation.Target;
public @interface FunctionNames {
String[] value();
}

View File

@ -14,5 +14,4 @@ public abstract class LispFunction {
public boolean isMacro() {
return false;
}
}

View File

@ -6,5 +6,4 @@ public abstract class LispSpecialFunction extends LispFunction {
public boolean isArgumentListEvaluated() {
return false;
}
}

View File

@ -166,5 +166,4 @@ public class UserDefinedFunction extends LispFunction {
parameters);
}
}
}

View File

@ -12,5 +12,4 @@ public class UserDefinedMacro extends UserDefinedSpecialFunction {
public boolean isMacro() {
return true;
}
}

View File

@ -12,5 +12,4 @@ public class UserDefinedSpecialFunction extends UserDefinedFunction {
public boolean isArgumentListEvaluated() {
return false;
}
}

View File

@ -36,5 +36,4 @@ public class APPLY extends LispFunction {
return applyFunction(function, functionArguments);
}
}

View File

@ -201,5 +201,4 @@ class BackquoteEvaluator {
return "at sign did not evaluate to a list";
}
}
}

View File

@ -228,5 +228,4 @@ public class EVAL extends LispFunction {
return "unmatched at sign";
}
}
}

View File

@ -28,5 +28,4 @@ public class EXIT extends LispFunction {
return NIL;
}
}

View File

@ -26,5 +26,4 @@ public class FUNCALL extends LispFunction {
return apply(applyArgs);
}
}

View File

@ -32,5 +32,4 @@ public class FUSE extends LispFunction {
return new Symbol(left.toString() + SEPARATOR + right.toString());
}
}

View File

@ -39,5 +39,4 @@ public class GENSYM extends LispFunction {
return generateSymbol();
}
}

View File

@ -114,5 +114,4 @@ public class LOAD extends LispFunction {
return format("could not load ''{0}''", fileName);
}
}
}

View File

@ -27,5 +27,4 @@ public class PRINT extends LispFunction {
return argument;
}
}

View File

@ -54,5 +54,4 @@ public class SET extends LispFunction {
private boolean isSymbolInTable(SExpression symbol, SymbolTable table) {
return table.contains(symbol.toString());
}
}

View File

@ -25,5 +25,4 @@ public class SYMBOLS extends LispFunction {
return executionContext.toList();
}
}

View File

@ -60,5 +60,4 @@ public class SYMBOL_FUNCTION extends LispFunction {
return format("SYMBOL-FUNCTION: undefined function: {0}", function);
}
}
}

View File

@ -26,5 +26,4 @@ public class CONS extends LispFunction {
return new Cons(firstArgument, secondArgument);
}
}

View File

@ -24,5 +24,4 @@ public class FIRST extends LispFunction {
return argument.getFirst();
}
}

View File

@ -62,5 +62,4 @@ public class LENGTH extends LispFunction {
private BigInteger increment(BigInteger number) {
return number.add(BigInteger.ONE);
}
}

View File

@ -27,5 +27,4 @@ public class LIST extends LispFunction {
return argumentList;
}
}

View File

@ -24,5 +24,4 @@ public class REST extends LispFunction {
return argument.getRest();
}
}

View File

@ -50,5 +50,4 @@ public class DIVIDE extends LispFunction {
return "divide by zero";
}
}
}

View File

@ -35,5 +35,4 @@ public class MINUS extends LispFunction {
private LispNumber subtract(LispNumber number1, LispNumber number2) {
return new LispNumber(number1.getValue().subtract(number2.getValue()));
}
}

View File

@ -41,5 +41,4 @@ public class MODULO extends LispFunction {
return "modulus not positive";
}
}
}

View File

@ -30,5 +30,4 @@ public class MULTIPLY extends LispFunction {
private LispNumber multiply(LispNumber number1, LispNumber number2) {
return new LispNumber(number1.getValue().multiply(number2.getValue()));
}
}

View File

@ -40,5 +40,4 @@ class MathFunction {
return tailCall(() -> callTailRecursive(new Cons(operationResult, remainingNumbers)));
}
}

View File

@ -30,5 +30,4 @@ public class PLUS extends LispFunction {
private LispNumber add(LispNumber number1, LispNumber number2) {
return new LispNumber(number1.getValue().add(number2.getValue()));
}
}

View File

@ -31,5 +31,4 @@ public class REMAINDER extends LispFunction {
throw new DivideByZeroException();
}
}
}

View File

@ -26,5 +26,4 @@ public class ATOM extends LispFunction {
return argument.isAtom() ? T : NIL;
}
}

View File

@ -52,5 +52,4 @@ public class EQ extends LispFunction {
private SExpression listEq(SExpression firstArgument, SExpression secondArgument) {
return (firstArgument == secondArgument) ? T : NIL;
}
}

View File

@ -37,5 +37,4 @@ public class EQUAL extends LispFunction {
private SExpression equal(SExpression firstArgument, SExpression secondArgument) {
return isEqual(firstArgument, secondArgument) ? T : NIL;
}
}

View File

@ -97,5 +97,4 @@ public class GENSYM_EQUAL extends LispFunction {
return equalizedExpression;
}
}
}

View File

@ -25,5 +25,4 @@ public class LISTP extends LispFunction {
return argumentList.getFirst().isList() ? T : NIL;
}
}

View File

@ -25,5 +25,4 @@ public class NULL extends LispFunction {
return argumentList.getFirst().isNull() ? T : NIL;
}
}

View File

@ -51,5 +51,4 @@ public class NUMERIC_EQUAL extends LispFunction {
private boolean isEqual(LispNumber number1, LispNumber number2) {
return number1.getValue().equals(number2.getValue());
}
}

View File

@ -51,5 +51,4 @@ public class NUMERIC_GREATER extends LispFunction {
private boolean isFirstGreater(LispNumber number1, LispNumber number2) {
return number1.getValue().compareTo(number2.getValue()) > 0;
}
}

View File

@ -51,5 +51,4 @@ public class NUMERIC_LESS extends LispFunction {
private boolean isFirstLesser(LispNumber number1, LispNumber number2) {
return number1.getValue().compareTo(number2.getValue()) < 0;
}
}

View File

@ -40,5 +40,4 @@ public class AND extends LispSpecialFunction {
return tailCall(() -> callTailRecursive(remainingValues, currentValue));
}
}

View File

@ -82,5 +82,4 @@ public class CASE extends LispSpecialFunction {
return lastConsequentValue;
}
}

View File

@ -65,5 +65,4 @@ public class COND extends LispSpecialFunction {
private SExpression getFirst(SExpression knownCons) {
return ((Cons) knownCons).getFirst();
}
}

View File

@ -17,5 +17,4 @@ public class DEFINE_SPECIAL extends Define {
protected UserDefinedFunction createFunction(SExpression functionName, Cons lambdaList, Cons functionBody) {
return new UserDefinedSpecialFunction(functionName.toString(), lambdaList, functionBody);
}
}

View File

@ -17,5 +17,4 @@ public class DEFMACRO extends Define {
protected UserDefinedFunction createFunction(SExpression functionName, Cons lambdaList, Cons functionBody) {
return new UserDefinedMacro(functionName.toString(), lambdaList, functionBody);
}
}

View File

@ -16,5 +16,4 @@ public class DEFUN extends Define {
protected UserDefinedFunction createFunction(SExpression functionName, Cons lambdaList, Cons functionBody) {
return new UserDefinedFunction(functionName.toString(), lambdaList, functionBody);
}
}

View File

@ -74,5 +74,4 @@ public abstract class Define extends LispSpecialFunction {
return format("redefining function {0}", functionName);
}
}
}

View File

@ -49,5 +49,4 @@ public class IF extends LispSpecialFunction {
return getRestOfList(expressions).getFirst();
}
}

View File

@ -66,5 +66,4 @@ public class LAMBDA extends LispSpecialFunction {
private Cons makeOriginalLambdaExpression(Cons argumentList) {
return new Cons(new Symbol("LAMBDA"), argumentList);
}
}

View File

@ -90,5 +90,4 @@ public class LET extends LispSpecialFunction {
private void restorePreviousScope(SymbolTable localScope) {
executionContext.setScope(localScope.getParent());
}
}

View File

@ -19,5 +19,4 @@ public class LET_STAR extends LET {
return localScope;
}
}

View File

@ -36,5 +36,4 @@ public class OR extends LispSpecialFunction {
return tailCall(() -> callTailRecursive(remainingValues));
}
}

View File

@ -37,5 +37,4 @@ public class PROGN extends LispSpecialFunction {
return tailCall(() -> callTailRecursive(remainingValues, currentValue));
}
}

View File

@ -22,5 +22,4 @@ public class QUOTE extends LispSpecialFunction {
return argumentList.getFirst();
}
}

View File

@ -87,5 +87,4 @@ public class RECUR extends LispSpecialFunction {
return "recur not in tail position";
}
}
}

View File

@ -35,5 +35,4 @@ public class SETQ extends LispSpecialFunction {
return new Cons(argumentList.getFirst(), makeList(value));
}
}

View File

@ -25,5 +25,4 @@ public class FileLispInterpreter extends LispInterpreter {
super.applyFinishingTouches();
}
}

View File

@ -21,5 +21,4 @@ public class InteractiveLispInterpreter extends LispInterpreter {
environment.getOutput().println(environment.decoratePrompt(""));
environment.getOutput().flush();
}
}

View File

@ -90,5 +90,4 @@ public class LispInterpreter {
return name;
}
}
}

View File

@ -35,5 +35,4 @@ public interface LispInterpreterBuilder {
LispInterpreter build();
default void reset() {}
}

View File

@ -63,7 +63,6 @@ public class LispInterpreterBuilderImpl implements LispInterpreterBuilder {
@Override
public void setOutput(PrintStream outputStream) {
this.outputStream = outputStream;
}
@Override
@ -115,13 +114,11 @@ public class LispInterpreterBuilderImpl implements LispInterpreterBuilder {
@Override
public void setWarningOutputDecorator(Function<String, String> decorator) {
this.warningOutputDecorator = decorator;
}
@Override
public void setErrorOutputDecorator(Function<String, String> decorator) {
this.errorOutputDecorator = decorator;
}
@Override
@ -217,5 +214,4 @@ public class LispInterpreterBuilderImpl implements LispInterpreterBuilder {
return message;
}
}
}

View File

@ -60,5 +60,4 @@ public class LispParser {
throw exceptionToThrow;
}
}
}

View File

@ -26,5 +26,4 @@ public interface TailCall<T> {
// @formatter:on
}
}

View File

@ -25,5 +25,4 @@ public class TailCalls {
}
};
}
}

View File

@ -80,5 +80,4 @@ public class LispCommentRemovingInputStream implements LispInputStream {
this.rereadLastCharacter = true;
}
}

View File

@ -12,5 +12,4 @@ public interface LispInputStream {
private static final long serialVersionUID = 1L;
}
}

View File

@ -183,5 +183,4 @@ public class LispScanner {
return "unterminated quoted string";
}
}
}

View File

@ -21,5 +21,4 @@ public class AtSignExpression extends SExpression {
public String toString() {
return "@" + expression;
}
}

View File

@ -18,5 +18,4 @@ public abstract class Atom extends SExpression {
public String toString() {
return text;
}
}

View File

@ -21,5 +21,4 @@ public class BackquoteExpression extends SExpression {
public String toString() {
return "`" + expression;
}
}

View File

@ -21,5 +21,4 @@ public class CommaExpression extends SExpression {
public String toString() {
return "," + expression;
}
}

View File

@ -53,5 +53,4 @@ public class Cons extends SExpression {
return done(leadingString.append(" . " + rest.toString() + ")").toString());
}
}

View File

@ -10,5 +10,4 @@ import java.lang.annotation.Target;
public @interface DisplayName {
String value();
}

View File

@ -30,5 +30,4 @@ public class LambdaExpression extends SExpression {
public String toString() {
return lambdaExpression.toString();
}
}

View File

@ -53,5 +53,4 @@ public class LispNumber extends Atom {
return format("{0} is not a valid integer", text);
}
}
}

View File

@ -11,5 +11,4 @@ public class LispString extends Atom {
public boolean isString() {
return true;
}
}

View File

@ -48,5 +48,4 @@ public class Nil extends Cons {
public String toString() {
return "NIL";
}
}

View File

@ -46,5 +46,4 @@ public abstract class SExpression {
public boolean isAtSign() {
return false;
}
}

View File

@ -19,5 +19,4 @@ public class Symbol extends Atom {
public boolean isSymbol() {
return true;
}
}

View File

@ -29,5 +29,4 @@ public class SafeInputStream {
throw new UncheckedIOException(e);
}
}
}

View File

@ -35,5 +35,4 @@ public class SafeOutputStream {
throw new UncheckedIOException(e);
}
}
}

View File

@ -17,5 +17,4 @@ public class UncheckedIOException extends CriticalLispException {
public String getMessage() {
return exception.getMessage();
}
}

View File

@ -197,5 +197,4 @@ public class FunctionTable {
return format("Could not create an instance of ''{0}''", functionName);
}
}
}

View File

@ -63,5 +63,4 @@ public class SymbolTable {
private Cons makeSymbolValuePair(Entry<String, SExpression> binding) {
return new Cons(new Symbol(binding.getKey()), makeList(binding.getValue()));
}
}

View File

@ -57,5 +57,4 @@ class ControlSequenceHandler {
private boolean isPartOfCode() {
return isCharacter() && isDigit((char) currentCharacter);
}
}

View File

@ -31,5 +31,4 @@ public class ControlSequenceLookup {
return codes.getOrDefault(code, new NullControlSequence());
}
}

View File

@ -210,7 +210,8 @@ public class LispTerminal {
TerminalPosition cursorPosition = terminal.getCursorPosition();
terminal.putCharacter(character);
moveCursorToNextRow(cursorPosition);
} else
}
else
terminal.putCharacter(character);
}
@ -393,7 +394,8 @@ public class LispTerminal {
private void takeNap() {
try {
Thread.sleep(1);
} catch (InterruptedException ignored) {}
} catch (InterruptedException ignored) {
}
}
private void writeOutput() {
@ -458,5 +460,4 @@ public class LispTerminal {
isStopped = true;
inputWriter.close();
}
}

View File

@ -6,7 +6,6 @@ import com.googlecode.lanterna.terminal.IOSafeTerminal;
public enum SelectGraphicRendition implements ControlSequence {
RESET {
@Override
public String getCode() {
return "0";
@ -19,7 +18,6 @@ public enum SelectGraphicRendition implements ControlSequence {
},
RED {
@Override
public String getCode() {
return "31";
@ -32,7 +30,6 @@ public enum SelectGraphicRendition implements ControlSequence {
},
GREEN {
@Override
public String getCode() {
return "32";
@ -45,7 +42,6 @@ public enum SelectGraphicRendition implements ControlSequence {
},
YELLOW {
@Override
public String getCode() {
return "33";
@ -58,7 +54,6 @@ public enum SelectGraphicRendition implements ControlSequence {
},
PURPLE {
@Override
public String getCode() {
return "35";

View File

@ -67,5 +67,4 @@ public class TerminalConfiguration {
public IOSafeTerminal getTerminal() {
return terminal;
}
}

Some files were not shown because too many files have changed in this diff Show More