From 7de348d759ef48cce462033de3e8c90a636e714e Mon Sep 17 00:00:00 2001 From: Mike Cifelli Date: Sun, 12 Nov 2017 09:42:25 -0500 Subject: [PATCH] Remove wildcard imports --- src/environment/RuntimeEnvironment.java | 3 +- src/error/ErrorManager.java | 3 +- src/function/ArgumentValidator.java | 4 +- src/function/FunctionNames.java | 5 +- src/function/LispFunction.java | 3 +- src/function/UserDefinedFunction.java | 7 ++- src/function/builtin/APPLY.java | 7 ++- src/function/builtin/BackquoteEvaluator.java | 6 ++- src/function/builtin/EVAL.java | 13 +++-- src/function/builtin/EXIT.java | 7 ++- src/function/builtin/FUNCALL.java | 7 ++- src/function/builtin/GENSYM.java | 8 ++- src/function/builtin/LOAD.java | 14 +++-- src/function/builtin/PRINT.java | 7 ++- src/function/builtin/SET.java | 11 ++-- src/function/builtin/SYMBOL_FUNCTION.java | 10 +++- src/function/builtin/cons/CONS.java | 7 ++- src/function/builtin/cons/FIRST.java | 7 ++- src/function/builtin/cons/LENGTH.java | 7 ++- src/function/builtin/cons/LIST.java | 7 ++- src/function/builtin/cons/REST.java | 7 ++- src/function/builtin/math/DIVIDE.java | 7 ++- src/function/builtin/math/MINUS.java | 7 ++- src/function/builtin/math/MULTIPLY.java | 7 ++- src/function/builtin/math/MathFunction.java | 7 ++- src/function/builtin/math/PLUS.java | 7 ++- src/function/builtin/predicate/ATOM.java | 7 ++- src/function/builtin/predicate/EQ.java | 7 ++- src/function/builtin/predicate/EQUAL.java | 7 ++- .../builtin/predicate/GENSYM_EQUAL.java | 13 +++-- src/function/builtin/predicate/LISTP.java | 7 ++- src/function/builtin/predicate/NULL.java | 7 ++- .../builtin/predicate/NUMERIC_EQUAL.java | 8 ++- .../builtin/predicate/NUMERIC_GREATER.java | 8 ++- .../builtin/predicate/NUMERIC_LESS.java | 8 ++- src/function/builtin/special/AND.java | 7 ++- src/function/builtin/special/CASE.java | 8 ++- src/function/builtin/special/COND.java | 8 ++- .../builtin/special/DEFINE_SPECIAL.java | 7 ++- src/function/builtin/special/DEFMACRO.java | 7 ++- src/function/builtin/special/DEFUN.java | 6 ++- src/function/builtin/special/Define.java | 11 ++-- src/function/builtin/special/IF.java | 7 ++- src/function/builtin/special/LAMBDA.java | 10 +++- src/function/builtin/special/LET.java | 11 ++-- src/function/builtin/special/OR.java | 7 ++- src/function/builtin/special/PROGN.java | 7 ++- src/function/builtin/special/QUOTE.java | 7 ++- src/function/builtin/special/SETQ.java | 8 ++- src/interpreter/LispInterpreterBuilder.java | 3 +- .../LispInterpreterBuilderImpl.java | 8 ++- src/main/LispMain.java | 16 ++++-- src/parser/LispParser.java | 3 +- .../LispCommentRemovingInputStream.java | 6 ++- src/scanner/LispScanner.java | 17 ++++-- src/sexpression/DisplayName.java | 5 +- src/stream/SafeInputStream.java | 3 +- src/stream/SafeOutputStream.java | 3 +- src/table/FunctionTable.java | 54 ++++++++++++++++--- src/terminal/ControlSequenceHandler.java | 4 +- src/terminal/ControlSequenceLookup.java | 3 +- src/terminal/LispTerminal.java | 21 ++++++-- src/terminal/TerminalConfiguration.java | 4 +- src/terminal/TerminalHistory.java | 3 +- src/token/AtSign.java | 3 +- src/token/Backquote.java | 3 +- src/token/Comma.java | 3 +- src/token/Identifier.java | 3 +- src/token/Number.java | 3 +- src/token/QuoteMark.java | 4 +- src/token/QuotedString.java | 3 +- src/token/Token.java | 3 +- src/token/TokenFactory.java | 3 +- src/token/TokenFactoryImpl.java | 10 +++- src/util/Characters.java | 3 +- .../fixture/LispInterpreterFixture.java | 10 +++- test/environment/RuntimeEnvironmentTest.java | 12 +++-- test/error/ErrorManagerTest.java | 17 ++++-- test/file/FilePositionTrackerTest.java | 3 +- test/function/ArgumentValidatorTest.java | 18 +++++-- test/function/LispFunctionTest.java | 3 +- test/function/LispSpecialFunctionTest.java | 3 +- test/function/UserDefinedFunctionTest.java | 12 +++-- test/function/builtin/APPLYTest.java | 9 +++- .../builtin/BackquoteEvaluatorTest.java | 18 +++++-- test/function/builtin/EVALTest.java | 14 +++-- test/function/builtin/EXITTest.java | 6 ++- test/function/builtin/FUNCALLTest.java | 4 +- test/function/builtin/GENSYMTest.java | 4 +- test/function/builtin/LOADTest.java | 10 ++-- test/function/builtin/PRINTTest.java | 6 ++- test/function/builtin/SETTest.java | 7 ++- .../function/builtin/SYMBOL_FUNCTIONTest.java | 8 ++- test/function/builtin/cons/CONSTest.java | 10 ++-- test/function/builtin/cons/FIRSTTest.java | 8 ++- test/function/builtin/cons/LENGTHTest.java | 8 ++- test/function/builtin/cons/LISTTest.java | 4 +- test/function/builtin/cons/RESTTest.java | 8 ++- test/function/builtin/math/DIVIDETest.java | 7 ++- test/function/builtin/math/MINUSTest.java | 6 ++- test/function/builtin/math/MULTIPLYTest.java | 3 +- test/function/builtin/math/PLUSTest.java | 3 +- test/function/builtin/predicate/ATOMTest.java | 6 ++- test/function/builtin/predicate/EQTest.java | 6 ++- .../function/builtin/predicate/EQUALTest.java | 6 ++- .../builtin/predicate/GENSYM_EQUALTest.java | 6 ++- .../function/builtin/predicate/LISTPTest.java | 6 ++- test/function/builtin/predicate/NULLTest.java | 6 ++- .../builtin/predicate/NUMERIC_EQUALTest.java | 6 ++- .../predicate/NUMERIC_GREATERTest.java | 6 ++- .../builtin/predicate/NUMERIC_LESSTest.java | 6 ++- test/function/builtin/special/ANDTest.java | 6 ++- test/function/builtin/special/CASETest.java | 7 ++- test/function/builtin/special/CONDTest.java | 7 ++- .../builtin/special/DEFINE_SPECIALTest.java | 12 +++-- .../builtin/special/DEFMACROTest.java | 12 +++-- test/function/builtin/special/DEFUNTest.java | 12 +++-- test/function/builtin/special/IFTest.java | 6 ++- test/function/builtin/special/LAMBDATest.java | 16 ++++-- test/function/builtin/special/LETTest.java | 11 ++-- .../builtin/special/LET_STARTest.java | 11 ++-- test/function/builtin/special/ORTest.java | 6 ++- test/function/builtin/special/PROGNTest.java | 4 +- test/function/builtin/special/QUOTETest.java | 7 ++- test/function/builtin/special/SETQTest.java | 7 ++- test/interpreter/LispInterpreterTest.java | 15 ++++-- test/main/MainTest.java | 20 +++++-- test/parser/LispParserTest.java | 18 +++++-- .../LispCommentRemovingInputStreamTest.java | 7 ++- test/scanner/LispScannerTypeTest.java | 21 ++++++-- test/sexpression/SExpressionTest.java | 7 ++- test/stream/SafeInputStreamTest.java | 6 ++- test/stream/SafeOutputStreamTest.java | 3 +- test/table/ExecutionContextTest.java | 8 ++- test/table/FunctionTableTest.java | 24 ++++++--- test/table/SymbolTableTest.java | 7 ++- test/terminal/ControlSequenceHandlerTest.java | 13 +++-- test/terminal/ControlSequenceTest.java | 18 +++++-- test/terminal/LispTerminalTest.java | 13 ++++- test/terminal/TerminalConfigurationTest.java | 7 ++- test/terminal/TerminalHistoryTest.java | 7 ++- test/terminal/VirtualTerminalInteractor.java | 16 ++++-- test/testutil/SymbolAndFunctionCleaner.java | 3 +- test/testutil/TestUtilities.java | 13 +++-- test/testutil/TypeAssertions.java | 4 +- test/token/TokenFactoryTest.java | 10 ++-- test/util/CharactersTest.java | 3 +- test/util/PathTest.java | 3 +- 148 files changed, 893 insertions(+), 314 deletions(-) diff --git a/src/environment/RuntimeEnvironment.java b/src/environment/RuntimeEnvironment.java index 7b96dde..a0d993e 100644 --- a/src/environment/RuntimeEnvironment.java +++ b/src/environment/RuntimeEnvironment.java @@ -1,6 +1,7 @@ package environment; -import java.io.*; +import java.io.InputStream; +import java.io.PrintStream; import java.util.function.Function; import error.ErrorManager; diff --git a/src/error/ErrorManager.java b/src/error/ErrorManager.java index d609e51..f4f49ff 100644 --- a/src/error/ErrorManager.java +++ b/src/error/ErrorManager.java @@ -1,6 +1,7 @@ package error; -import static error.ErrorManager.Severity.*; +import static error.ErrorManager.Severity.CRITICAL; +import static error.ErrorManager.Severity.WARNING; import static java.text.MessageFormat.format; import java.io.PrintStream; diff --git a/src/function/ArgumentValidator.java b/src/function/ArgumentValidator.java index 0d9df0b..7d1cfc8 100644 --- a/src/function/ArgumentValidator.java +++ b/src/function/ArgumentValidator.java @@ -6,7 +6,9 @@ import static java.text.MessageFormat.format; import java.math.BigInteger; import error.LispException; -import sexpression.*; +import sexpression.Cons; +import sexpression.DisplayName; +import sexpression.SExpression; public class ArgumentValidator { diff --git a/src/function/FunctionNames.java b/src/function/FunctionNames.java index d4b3004..45e173c 100644 --- a/src/function/FunctionNames.java +++ b/src/function/FunctionNames.java @@ -1,6 +1,9 @@ package function; -import java.lang.annotation.*; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/src/function/LispFunction.java b/src/function/LispFunction.java index 2b998f6..4372f3e 100644 --- a/src/function/LispFunction.java +++ b/src/function/LispFunction.java @@ -1,6 +1,7 @@ package function; -import sexpression.*; +import sexpression.Cons; +import sexpression.SExpression; public abstract class LispFunction { diff --git a/src/function/UserDefinedFunction.java b/src/function/UserDefinedFunction.java index 546aa3e..2e6f413 100644 --- a/src/function/UserDefinedFunction.java +++ b/src/function/UserDefinedFunction.java @@ -7,8 +7,11 @@ import static sexpression.Nil.NIL; import java.util.ArrayList; import error.LispException; -import sexpression.*; -import table.*; +import sexpression.Cons; +import sexpression.SExpression; +import sexpression.Symbol; +import table.ExecutionContext; +import table.SymbolTable; public class UserDefinedFunction extends LispFunction { diff --git a/src/function/builtin/APPLY.java b/src/function/builtin/APPLY.java index 72c073f..809e1aa 100644 --- a/src/function/builtin/APPLY.java +++ b/src/function/builtin/APPLY.java @@ -3,8 +3,11 @@ package function.builtin; import static function.builtin.EVAL.lookupFunctionOrLambda; import static table.FunctionTable.lookupFunction; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "APPLY" }) public class APPLY extends LispFunction { diff --git a/src/function/builtin/BackquoteEvaluator.java b/src/function/builtin/BackquoteEvaluator.java index e62738c..4ea1eba 100644 --- a/src/function/builtin/BackquoteEvaluator.java +++ b/src/function/builtin/BackquoteEvaluator.java @@ -5,7 +5,11 @@ import static sexpression.Nil.NIL; import error.LispException; import function.ArgumentValidator; -import sexpression.*; +import sexpression.AtSignExpression; +import sexpression.BackquoteExpression; +import sexpression.CommaExpression; +import sexpression.Cons; +import sexpression.SExpression; class BackquoteEvaluator { diff --git a/src/function/builtin/EVAL.java b/src/function/builtin/EVAL.java index ab1d1aa..d5ec560 100644 --- a/src/function/builtin/EVAL.java +++ b/src/function/builtin/EVAL.java @@ -1,15 +1,22 @@ package function.builtin; import static function.builtin.cons.LIST.makeList; -import static function.builtin.special.LAMBDA.*; +import static function.builtin.special.LAMBDA.createFunction; +import static function.builtin.special.LAMBDA.isLambdaExpression; import static java.text.MessageFormat.format; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; import static table.FunctionTable.lookupFunction; import error.LispException; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.BackquoteExpression; +import sexpression.Cons; +import sexpression.LambdaExpression; +import sexpression.SExpression; +import sexpression.Symbol; import table.ExecutionContext; @FunctionNames({ "EVAL" }) diff --git a/src/function/builtin/EXIT.java b/src/function/builtin/EXIT.java index 204d016..a46be6c 100644 --- a/src/function/builtin/EXIT.java +++ b/src/function/builtin/EXIT.java @@ -3,8 +3,11 @@ package function.builtin; import static sexpression.Nil.NIL; import environment.RuntimeEnvironment; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "EXIT" }) public class EXIT extends LispFunction { diff --git a/src/function/builtin/FUNCALL.java b/src/function/builtin/FUNCALL.java index 86b4029..9db896f 100644 --- a/src/function/builtin/FUNCALL.java +++ b/src/function/builtin/FUNCALL.java @@ -3,8 +3,11 @@ package function.builtin; import static function.builtin.APPLY.apply; import static function.builtin.cons.LIST.makeList; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "FUNCALL", "CALL" }) public class FUNCALL extends LispFunction { diff --git a/src/function/builtin/GENSYM.java b/src/function/builtin/GENSYM.java index bea2bfa..d4e21ab 100644 --- a/src/function/builtin/GENSYM.java +++ b/src/function/builtin/GENSYM.java @@ -2,8 +2,12 @@ package function.builtin; import java.math.BigInteger; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.SExpression; +import sexpression.Symbol; @FunctionNames({ "GENSYM" }) public class GENSYM extends LispFunction { diff --git a/src/function/builtin/LOAD.java b/src/function/builtin/LOAD.java index a3f5352..6ec3903 100644 --- a/src/function/builtin/LOAD.java +++ b/src/function/builtin/LOAD.java @@ -6,14 +6,20 @@ import static sexpression.Nil.NIL; import static sexpression.Symbol.T; import static util.Path.getPathPrefix; -import java.io.*; +import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.util.Stack; import environment.RuntimeEnvironment; -import error.*; -import function.*; +import error.LispException; +import error.LispWarning; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; import parser.LispParser; -import sexpression.*; +import sexpression.Cons; +import sexpression.LispString; +import sexpression.SExpression; @FunctionNames({ "LOAD" }) public class LOAD extends LispFunction { diff --git a/src/function/builtin/PRINT.java b/src/function/builtin/PRINT.java index 2eaff96..7f2a1e6 100644 --- a/src/function/builtin/PRINT.java +++ b/src/function/builtin/PRINT.java @@ -1,8 +1,11 @@ package function.builtin; import environment.RuntimeEnvironment; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "PRINT" }) public class PRINT extends LispFunction { diff --git a/src/function/builtin/SET.java b/src/function/builtin/SET.java index ccb6093..4101945 100644 --- a/src/function/builtin/SET.java +++ b/src/function/builtin/SET.java @@ -2,9 +2,14 @@ package function.builtin; import static table.FunctionTable.lookupFunction; -import function.*; -import sexpression.*; -import table.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.SExpression; +import sexpression.Symbol; +import table.ExecutionContext; +import table.SymbolTable; @FunctionNames({ "SET" }) public class SET extends LispFunction { diff --git a/src/function/builtin/SYMBOL_FUNCTION.java b/src/function/builtin/SYMBOL_FUNCTION.java index a106955..95cb2aa 100644 --- a/src/function/builtin/SYMBOL_FUNCTION.java +++ b/src/function/builtin/SYMBOL_FUNCTION.java @@ -4,8 +4,14 @@ import static java.text.MessageFormat.format; import static table.FunctionTable.lookupFunction; import error.LispException; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import function.LispSpecialFunction; +import function.UserDefinedFunction; +import sexpression.Cons; +import sexpression.SExpression; +import sexpression.Symbol; @FunctionNames({ "SYMBOL-FUNCTION" }) public class SYMBOL_FUNCTION extends LispFunction { diff --git a/src/function/builtin/cons/CONS.java b/src/function/builtin/cons/CONS.java index 641669c..6b0dc6e 100644 --- a/src/function/builtin/cons/CONS.java +++ b/src/function/builtin/cons/CONS.java @@ -1,7 +1,10 @@ package function.builtin.cons; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "CONS" }) public class CONS extends LispFunction { diff --git a/src/function/builtin/cons/FIRST.java b/src/function/builtin/cons/FIRST.java index 404c5cc..83f9fd4 100644 --- a/src/function/builtin/cons/FIRST.java +++ b/src/function/builtin/cons/FIRST.java @@ -1,7 +1,10 @@ package function.builtin.cons; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "FIRST", "CAR" }) public class FIRST extends LispFunction { diff --git a/src/function/builtin/cons/LENGTH.java b/src/function/builtin/cons/LENGTH.java index 1534592..1bcd156 100644 --- a/src/function/builtin/cons/LENGTH.java +++ b/src/function/builtin/cons/LENGTH.java @@ -4,8 +4,11 @@ import static function.builtin.cons.LIST.makeList; import java.math.BigInteger; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.LispNumber; @FunctionNames({ "LENGTH" }) public class LENGTH extends LispFunction { diff --git a/src/function/builtin/cons/LIST.java b/src/function/builtin/cons/LIST.java index 861cdcc..4f39c59 100644 --- a/src/function/builtin/cons/LIST.java +++ b/src/function/builtin/cons/LIST.java @@ -2,8 +2,11 @@ package function.builtin.cons; import static sexpression.Nil.NIL; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "LIST" }) public class LIST extends LispFunction { diff --git a/src/function/builtin/cons/REST.java b/src/function/builtin/cons/REST.java index 04f5a87..77eb943 100644 --- a/src/function/builtin/cons/REST.java +++ b/src/function/builtin/cons/REST.java @@ -1,7 +1,10 @@ package function.builtin.cons; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "REST", "CDR" }) public class REST extends LispFunction { diff --git a/src/function/builtin/math/DIVIDE.java b/src/function/builtin/math/DIVIDE.java index 8d3a642..9e48dbe 100644 --- a/src/function/builtin/math/DIVIDE.java +++ b/src/function/builtin/math/DIVIDE.java @@ -2,8 +2,11 @@ package function.builtin.math; import java.math.BigInteger; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.LispNumber; @FunctionNames({ "/" }) public class DIVIDE extends LispFunction { diff --git a/src/function/builtin/math/MINUS.java b/src/function/builtin/math/MINUS.java index 232f0e4..b55e5ca 100644 --- a/src/function/builtin/math/MINUS.java +++ b/src/function/builtin/math/MINUS.java @@ -2,8 +2,11 @@ package function.builtin.math; import java.math.BigInteger; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.LispNumber; @FunctionNames({ "-" }) public class MINUS extends LispFunction { diff --git a/src/function/builtin/math/MULTIPLY.java b/src/function/builtin/math/MULTIPLY.java index 42e7454..c8fe151 100644 --- a/src/function/builtin/math/MULTIPLY.java +++ b/src/function/builtin/math/MULTIPLY.java @@ -2,8 +2,11 @@ package function.builtin.math; import static sexpression.LispNumber.ONE; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.LispNumber; @FunctionNames({ "*" }) public class MULTIPLY extends LispFunction { diff --git a/src/function/builtin/math/MathFunction.java b/src/function/builtin/math/MathFunction.java index 516ad42..34677e1 100644 --- a/src/function/builtin/math/MathFunction.java +++ b/src/function/builtin/math/MathFunction.java @@ -1,8 +1,11 @@ package function.builtin.math; -import java.util.function.*; +import java.util.function.BiFunction; +import java.util.function.Function; -import sexpression.*; +import sexpression.Cons; +import sexpression.LispNumber; +import sexpression.SExpression; class MathFunction { diff --git a/src/function/builtin/math/PLUS.java b/src/function/builtin/math/PLUS.java index 6b11e75..1e04fa8 100644 --- a/src/function/builtin/math/PLUS.java +++ b/src/function/builtin/math/PLUS.java @@ -2,8 +2,11 @@ package function.builtin.math; import static sexpression.LispNumber.ZERO; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.LispNumber; @FunctionNames({ "+" }) public class PLUS extends LispFunction { diff --git a/src/function/builtin/predicate/ATOM.java b/src/function/builtin/predicate/ATOM.java index e020724..7c0f604 100644 --- a/src/function/builtin/predicate/ATOM.java +++ b/src/function/builtin/predicate/ATOM.java @@ -3,8 +3,11 @@ package function.builtin.predicate; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "ATOM", "ATOM?" }) public class ATOM extends LispFunction { diff --git a/src/function/builtin/predicate/EQ.java b/src/function/builtin/predicate/EQ.java index 48746ce..a659356 100644 --- a/src/function/builtin/predicate/EQ.java +++ b/src/function/builtin/predicate/EQ.java @@ -3,8 +3,11 @@ package function.builtin.predicate; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "EQ", "EQ?" }) public class EQ extends LispFunction { diff --git a/src/function/builtin/predicate/EQUAL.java b/src/function/builtin/predicate/EQUAL.java index 4bc8df4..5038949 100644 --- a/src/function/builtin/predicate/EQUAL.java +++ b/src/function/builtin/predicate/EQUAL.java @@ -3,8 +3,11 @@ package function.builtin.predicate; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "EQUAL", "EQUAL?" }) public class EQUAL extends LispFunction { diff --git a/src/function/builtin/predicate/GENSYM_EQUAL.java b/src/function/builtin/predicate/GENSYM_EQUAL.java index d6f1f29..5ce7214 100644 --- a/src/function/builtin/predicate/GENSYM_EQUAL.java +++ b/src/function/builtin/predicate/GENSYM_EQUAL.java @@ -4,12 +4,17 @@ import static function.builtin.GENSYM.GENSYM_PREFIX; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; -import java.util.*; +import java.util.HashMap; +import java.util.Map; import java.util.Map.Entry; -import java.util.regex.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "GENSYM-EQUAL", "GENSYM-EQUAL?" }) public class GENSYM_EQUAL extends LispFunction { diff --git a/src/function/builtin/predicate/LISTP.java b/src/function/builtin/predicate/LISTP.java index ee3b1a1..32710f2 100644 --- a/src/function/builtin/predicate/LISTP.java +++ b/src/function/builtin/predicate/LISTP.java @@ -3,8 +3,11 @@ package function.builtin.predicate; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "LISTP", "LIST?" }) public class LISTP extends LispFunction { diff --git a/src/function/builtin/predicate/NULL.java b/src/function/builtin/predicate/NULL.java index 7336b85..bd54ee7 100644 --- a/src/function/builtin/predicate/NULL.java +++ b/src/function/builtin/predicate/NULL.java @@ -3,8 +3,11 @@ package function.builtin.predicate; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "NULL", "NULL?" }) public class NULL extends LispFunction { diff --git a/src/function/builtin/predicate/NUMERIC_EQUAL.java b/src/function/builtin/predicate/NUMERIC_EQUAL.java index 22b0c18..07ac521 100644 --- a/src/function/builtin/predicate/NUMERIC_EQUAL.java +++ b/src/function/builtin/predicate/NUMERIC_EQUAL.java @@ -3,8 +3,12 @@ package function.builtin.predicate; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.LispNumber; +import sexpression.SExpression; @FunctionNames({ "=" }) public class NUMERIC_EQUAL extends LispFunction { diff --git a/src/function/builtin/predicate/NUMERIC_GREATER.java b/src/function/builtin/predicate/NUMERIC_GREATER.java index 2fdf76f..2b12a88 100644 --- a/src/function/builtin/predicate/NUMERIC_GREATER.java +++ b/src/function/builtin/predicate/NUMERIC_GREATER.java @@ -3,8 +3,12 @@ package function.builtin.predicate; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.LispNumber; +import sexpression.SExpression; @FunctionNames({ ">" }) public class NUMERIC_GREATER extends LispFunction { diff --git a/src/function/builtin/predicate/NUMERIC_LESS.java b/src/function/builtin/predicate/NUMERIC_LESS.java index 7246098..f47a362 100644 --- a/src/function/builtin/predicate/NUMERIC_LESS.java +++ b/src/function/builtin/predicate/NUMERIC_LESS.java @@ -3,8 +3,12 @@ package function.builtin.predicate; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.LispNumber; +import sexpression.SExpression; @FunctionNames({ "<" }) public class NUMERIC_LESS extends LispFunction { diff --git a/src/function/builtin/special/AND.java b/src/function/builtin/special/AND.java index 513cc56..bccbec5 100644 --- a/src/function/builtin/special/AND.java +++ b/src/function/builtin/special/AND.java @@ -3,8 +3,11 @@ package function.builtin.special; import static function.builtin.EVAL.eval; import static sexpression.Symbol.T; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispSpecialFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "AND" }) public class AND extends LispSpecialFunction { diff --git a/src/function/builtin/special/CASE.java b/src/function/builtin/special/CASE.java index 4f720a1..5828d36 100644 --- a/src/function/builtin/special/CASE.java +++ b/src/function/builtin/special/CASE.java @@ -5,8 +5,12 @@ import static function.builtin.predicate.EQUAL.isEqual; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispSpecialFunction; +import sexpression.Cons; +import sexpression.Nil; +import sexpression.SExpression; @FunctionNames({ "CASE" }) public class CASE extends LispSpecialFunction { diff --git a/src/function/builtin/special/COND.java b/src/function/builtin/special/COND.java index 0dc7684..99ae885 100644 --- a/src/function/builtin/special/COND.java +++ b/src/function/builtin/special/COND.java @@ -3,8 +3,12 @@ package function.builtin.special; import static function.builtin.EVAL.eval; import static sexpression.Nil.NIL; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispSpecialFunction; +import sexpression.Cons; +import sexpression.Nil; +import sexpression.SExpression; @FunctionNames({ "COND" }) public class COND extends LispSpecialFunction { diff --git a/src/function/builtin/special/DEFINE_SPECIAL.java b/src/function/builtin/special/DEFINE_SPECIAL.java index 68c9c1b..18a736e 100644 --- a/src/function/builtin/special/DEFINE_SPECIAL.java +++ b/src/function/builtin/special/DEFINE_SPECIAL.java @@ -1,7 +1,10 @@ package function.builtin.special; -import function.*; -import sexpression.*; +import function.FunctionNames; +import function.UserDefinedFunction; +import function.UserDefinedSpecialFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "DEFINE-SPECIAL" }) public class DEFINE_SPECIAL extends Define { diff --git a/src/function/builtin/special/DEFMACRO.java b/src/function/builtin/special/DEFMACRO.java index 20e2738..f59a33d 100644 --- a/src/function/builtin/special/DEFMACRO.java +++ b/src/function/builtin/special/DEFMACRO.java @@ -1,7 +1,10 @@ package function.builtin.special; -import function.*; -import sexpression.*; +import function.FunctionNames; +import function.UserDefinedFunction; +import function.UserDefinedMacro; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "DEFMACRO" }) public class DEFMACRO extends Define { diff --git a/src/function/builtin/special/DEFUN.java b/src/function/builtin/special/DEFUN.java index 96f3225..d2cf917 100644 --- a/src/function/builtin/special/DEFUN.java +++ b/src/function/builtin/special/DEFUN.java @@ -1,7 +1,9 @@ package function.builtin.special; -import function.*; -import sexpression.*; +import function.FunctionNames; +import function.UserDefinedFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "DEFUN" }) public class DEFUN extends Define { diff --git a/src/function/builtin/special/Define.java b/src/function/builtin/special/Define.java index 211a822..91697a1 100644 --- a/src/function/builtin/special/Define.java +++ b/src/function/builtin/special/Define.java @@ -2,12 +2,17 @@ package function.builtin.special; import static function.builtin.cons.LIST.makeList; import static java.text.MessageFormat.format; -import static table.FunctionTable.*; +import static table.FunctionTable.defineFunction; +import static table.FunctionTable.isAlreadyDefined; import environment.RuntimeEnvironment; import error.LispWarning; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.LispSpecialFunction; +import function.UserDefinedFunction; +import sexpression.Cons; +import sexpression.SExpression; +import sexpression.Symbol; public abstract class Define extends LispSpecialFunction { diff --git a/src/function/builtin/special/IF.java b/src/function/builtin/special/IF.java index a34b7f9..b1b5da9 100644 --- a/src/function/builtin/special/IF.java +++ b/src/function/builtin/special/IF.java @@ -2,8 +2,11 @@ package function.builtin.special; import static function.builtin.EVAL.eval; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispSpecialFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "IF" }) public class IF extends LispSpecialFunction { diff --git a/src/function/builtin/special/LAMBDA.java b/src/function/builtin/special/LAMBDA.java index 7146922..601896b 100644 --- a/src/function/builtin/special/LAMBDA.java +++ b/src/function/builtin/special/LAMBDA.java @@ -2,8 +2,14 @@ package function.builtin.special; import static function.builtin.cons.LIST.makeList; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispSpecialFunction; +import function.UserDefinedFunction; +import sexpression.Cons; +import sexpression.LambdaExpression; +import sexpression.SExpression; +import sexpression.Symbol; @FunctionNames({ "LAMBDA" }) public class LAMBDA extends LispSpecialFunction { diff --git a/src/function/builtin/special/LET.java b/src/function/builtin/special/LET.java index 8b388ad..80324d7 100644 --- a/src/function/builtin/special/LET.java +++ b/src/function/builtin/special/LET.java @@ -3,9 +3,14 @@ package function.builtin.special; import static function.builtin.EVAL.eval; import static sexpression.Nil.NIL; -import function.*; -import sexpression.*; -import table.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispSpecialFunction; +import sexpression.Cons; +import sexpression.SExpression; +import sexpression.Symbol; +import table.ExecutionContext; +import table.SymbolTable; @FunctionNames({ "LET" }) public class LET extends LispSpecialFunction { diff --git a/src/function/builtin/special/OR.java b/src/function/builtin/special/OR.java index 35d27b2..400fb80 100644 --- a/src/function/builtin/special/OR.java +++ b/src/function/builtin/special/OR.java @@ -2,8 +2,11 @@ package function.builtin.special; import static function.builtin.EVAL.eval; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispSpecialFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "OR" }) public class OR extends LispSpecialFunction { diff --git a/src/function/builtin/special/PROGN.java b/src/function/builtin/special/PROGN.java index 64f4373..02f0af9 100644 --- a/src/function/builtin/special/PROGN.java +++ b/src/function/builtin/special/PROGN.java @@ -3,8 +3,11 @@ package function.builtin.special; import static function.builtin.EVAL.eval; import static sexpression.Nil.NIL; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispSpecialFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "PROGN", "BEGIN" }) public class PROGN extends LispSpecialFunction { diff --git a/src/function/builtin/special/QUOTE.java b/src/function/builtin/special/QUOTE.java index 59fea42..7952140 100644 --- a/src/function/builtin/special/QUOTE.java +++ b/src/function/builtin/special/QUOTE.java @@ -1,7 +1,10 @@ package function.builtin.special; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispSpecialFunction; +import sexpression.Cons; +import sexpression.SExpression; @FunctionNames({ "QUOTE" }) public class QUOTE extends LispSpecialFunction { diff --git a/src/function/builtin/special/SETQ.java b/src/function/builtin/special/SETQ.java index 637418d..0dc6229 100644 --- a/src/function/builtin/special/SETQ.java +++ b/src/function/builtin/special/SETQ.java @@ -4,8 +4,12 @@ import static function.builtin.EVAL.eval; import static function.builtin.SET.set; import static function.builtin.cons.LIST.makeList; -import function.*; -import sexpression.*; +import function.ArgumentValidator; +import function.FunctionNames; +import function.LispSpecialFunction; +import sexpression.Cons; +import sexpression.SExpression; +import sexpression.Symbol; @FunctionNames({ "SETQ" }) public class SETQ extends LispSpecialFunction { diff --git a/src/interpreter/LispInterpreterBuilder.java b/src/interpreter/LispInterpreterBuilder.java index f74effd..3a3939d 100644 --- a/src/interpreter/LispInterpreterBuilder.java +++ b/src/interpreter/LispInterpreterBuilder.java @@ -1,6 +1,7 @@ package interpreter; -import java.io.*; +import java.io.InputStream; +import java.io.PrintStream; import java.util.function.Function; public interface LispInterpreterBuilder { diff --git a/src/interpreter/LispInterpreterBuilderImpl.java b/src/interpreter/LispInterpreterBuilderImpl.java index 0f9d01d..f7084dd 100644 --- a/src/interpreter/LispInterpreterBuilderImpl.java +++ b/src/interpreter/LispInterpreterBuilderImpl.java @@ -2,11 +2,15 @@ package interpreter; import static util.Path.getPathPrefix; -import java.io.*; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.io.PrintStream; import java.util.function.Function; import environment.RuntimeEnvironment; -import error.*; +import error.CriticalLispException; +import error.ErrorManager; public class LispInterpreterBuilderImpl implements LispInterpreterBuilder { diff --git a/src/main/LispMain.java b/src/main/LispMain.java index 4259b13..5cb3a54 100644 --- a/src/main/LispMain.java +++ b/src/main/LispMain.java @@ -3,14 +3,22 @@ package main; import static com.googlecode.lanterna.terminal.IOSafeTerminalAdapter.createRuntimeExceptionConvertingAdapter; import static terminal.LispTerminal.END_OF_SEGMENT; -import java.io.*; +import java.io.IOException; +import java.io.PipedInputStream; +import java.io.PipedOutputStream; +import java.io.PrintStream; import java.util.function.Function; -import com.googlecode.lanterna.terminal.*; +import com.googlecode.lanterna.terminal.DefaultTerminalFactory; +import com.googlecode.lanterna.terminal.IOSafeTerminal; +import com.googlecode.lanterna.terminal.Terminal; -import interpreter.*; +import interpreter.LispInterpreter; +import interpreter.LispInterpreterBuilder; +import interpreter.LispInterpreterBuilderImpl; import stream.UncheckedIOException; -import terminal.*; +import terminal.LispTerminal; +import terminal.TerminalConfiguration; public class LispMain { diff --git a/src/parser/LispParser.java b/src/parser/LispParser.java index 803245c..e28ff58 100644 --- a/src/parser/LispParser.java +++ b/src/parser/LispParser.java @@ -5,7 +5,8 @@ import java.io.InputStream; import error.LispException; import scanner.LispScanner; import sexpression.SExpression; -import token.*; +import token.Eof; +import token.Token; /** * Converts a stream of bytes into internal representations of Lisp s-expressions. diff --git a/src/scanner/LispCommentRemovingInputStream.java b/src/scanner/LispCommentRemovingInputStream.java index 1684cfa..084a34d 100644 --- a/src/scanner/LispCommentRemovingInputStream.java +++ b/src/scanner/LispCommentRemovingInputStream.java @@ -1,6 +1,10 @@ package scanner; -import static util.Characters.*; +import static util.Characters.BACKSLASH; +import static util.Characters.DOUBLE_QUOTE; +import static util.Characters.EOF; +import static util.Characters.NEWLINE; +import static util.Characters.SEMICOLON; import java.io.InputStream; diff --git a/src/scanner/LispScanner.java b/src/scanner/LispScanner.java index aee3132..3e58834 100644 --- a/src/scanner/LispScanner.java +++ b/src/scanner/LispScanner.java @@ -1,14 +1,23 @@ package scanner; -import static java.lang.Character.*; -import static util.Characters.*; +import static java.lang.Character.isDigit; +import static java.lang.Character.isWhitespace; +import static util.Characters.BACKSLASH; +import static util.Characters.DOUBLE_QUOTE; +import static util.Characters.EOF; +import static util.Characters.NEWLINE; +import static util.Characters.isLegalIdentifierCharacter; +import static util.Characters.isNumberPrefix; import java.io.InputStream; import java.util.function.Function; import error.LineColumnException; -import file.*; -import token.*; +import file.FilePosition; +import file.FilePositionTracker; +import token.Token; +import token.TokenFactory; +import token.TokenFactoryImpl; import util.Characters; /** diff --git a/src/sexpression/DisplayName.java b/src/sexpression/DisplayName.java index 45e2079..fc97d80 100644 --- a/src/sexpression/DisplayName.java +++ b/src/sexpression/DisplayName.java @@ -1,6 +1,9 @@ package sexpression; -import java.lang.annotation.*; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/src/stream/SafeInputStream.java b/src/stream/SafeInputStream.java index 55953c1..f8f46d6 100644 --- a/src/stream/SafeInputStream.java +++ b/src/stream/SafeInputStream.java @@ -1,6 +1,7 @@ package stream; -import java.io.*; +import java.io.IOException; +import java.io.InputStream; public class SafeInputStream { diff --git a/src/stream/SafeOutputStream.java b/src/stream/SafeOutputStream.java index c40e3c7..e82beae 100644 --- a/src/stream/SafeOutputStream.java +++ b/src/stream/SafeOutputStream.java @@ -1,6 +1,7 @@ package stream; -import java.io.*; +import java.io.IOException; +import java.io.OutputStream; public class SafeOutputStream { diff --git a/src/table/FunctionTable.java b/src/table/FunctionTable.java index efabaad..ee2e026 100644 --- a/src/table/FunctionTable.java +++ b/src/table/FunctionTable.java @@ -2,15 +2,55 @@ package table; import static java.text.MessageFormat.format; -import java.util.*; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; import error.CriticalLispException; -import function.*; -import function.builtin.*; -import function.builtin.cons.*; -import function.builtin.math.*; -import function.builtin.predicate.*; -import function.builtin.special.*; +import function.FunctionNames; +import function.LispFunction; +import function.builtin.APPLY; +import function.builtin.EVAL; +import function.builtin.EXIT; +import function.builtin.FUNCALL; +import function.builtin.GENSYM; +import function.builtin.LOAD; +import function.builtin.PRINT; +import function.builtin.SET; +import function.builtin.SYMBOL_FUNCTION; +import function.builtin.cons.CONS; +import function.builtin.cons.FIRST; +import function.builtin.cons.LENGTH; +import function.builtin.cons.LIST; +import function.builtin.cons.REST; +import function.builtin.math.DIVIDE; +import function.builtin.math.MINUS; +import function.builtin.math.MULTIPLY; +import function.builtin.math.PLUS; +import function.builtin.predicate.ATOM; +import function.builtin.predicate.EQ; +import function.builtin.predicate.EQUAL; +import function.builtin.predicate.GENSYM_EQUAL; +import function.builtin.predicate.LISTP; +import function.builtin.predicate.NULL; +import function.builtin.predicate.NUMERIC_EQUAL; +import function.builtin.predicate.NUMERIC_GREATER; +import function.builtin.predicate.NUMERIC_LESS; +import function.builtin.special.AND; +import function.builtin.special.CASE; +import function.builtin.special.COND; +import function.builtin.special.DEFINE_SPECIAL; +import function.builtin.special.DEFMACRO; +import function.builtin.special.DEFUN; +import function.builtin.special.IF; +import function.builtin.special.LAMBDA; +import function.builtin.special.LET; +import function.builtin.special.LET_STAR; +import function.builtin.special.OR; +import function.builtin.special.PROGN; +import function.builtin.special.QUOTE; +import function.builtin.special.SETQ; public class FunctionTable { diff --git a/src/terminal/ControlSequenceHandler.java b/src/terminal/ControlSequenceHandler.java index 06786d4..fa4a4c3 100644 --- a/src/terminal/ControlSequenceHandler.java +++ b/src/terminal/ControlSequenceHandler.java @@ -1,7 +1,9 @@ package terminal; import static java.lang.Character.isDigit; -import static util.Characters.*; +import static util.Characters.EOF; +import static util.Characters.LEFT_SQUARE_BRACKET; +import static util.Characters.UNICODE_ESCAPE; import stream.SafeInputStream; diff --git a/src/terminal/ControlSequenceLookup.java b/src/terminal/ControlSequenceLookup.java index 35399bf..59b3f9a 100644 --- a/src/terminal/ControlSequenceLookup.java +++ b/src/terminal/ControlSequenceLookup.java @@ -2,7 +2,8 @@ package terminal; import static terminal.SelectGraphicRendition.SGR_COMMAND; -import java.util.*; +import java.util.HashMap; +import java.util.Map; import terminal.ControlSequence.NullControlSequence; diff --git a/src/terminal/LispTerminal.java b/src/terminal/LispTerminal.java index 0bf5b1e..a86d6cb 100644 --- a/src/terminal/LispTerminal.java +++ b/src/terminal/LispTerminal.java @@ -1,18 +1,29 @@ package terminal; -import static com.googlecode.lanterna.input.KeyType.*; +import static com.googlecode.lanterna.input.KeyType.ArrowDown; +import static com.googlecode.lanterna.input.KeyType.ArrowLeft; +import static com.googlecode.lanterna.input.KeyType.ArrowRight; +import static com.googlecode.lanterna.input.KeyType.ArrowUp; +import static com.googlecode.lanterna.input.KeyType.Backspace; +import static com.googlecode.lanterna.input.KeyType.Character; +import static com.googlecode.lanterna.input.KeyType.Delete; +import static com.googlecode.lanterna.input.KeyType.Enter; import static terminal.ControlSequenceHandler.isEscape; import static util.Characters.EOF; import static util.Characters.UNICODE_NULL; import java.io.ByteArrayInputStream; -import java.util.concurrent.*; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; -import com.googlecode.lanterna.*; -import com.googlecode.lanterna.input.*; +import com.googlecode.lanterna.TerminalPosition; +import com.googlecode.lanterna.TerminalSize; +import com.googlecode.lanterna.input.KeyStroke; +import com.googlecode.lanterna.input.KeyType; import com.googlecode.lanterna.terminal.IOSafeTerminal; -import stream.*; +import stream.SafeInputStream; +import stream.SafeOutputStream; public class LispTerminal { diff --git a/src/terminal/TerminalConfiguration.java b/src/terminal/TerminalConfiguration.java index b282f3b..0a26a35 100644 --- a/src/terminal/TerminalConfiguration.java +++ b/src/terminal/TerminalConfiguration.java @@ -1,6 +1,8 @@ package terminal; -import java.io.*; +import java.io.IOException; +import java.io.PipedInputStream; +import java.io.PipedOutputStream; import com.googlecode.lanterna.terminal.IOSafeTerminal; diff --git a/src/terminal/TerminalHistory.java b/src/terminal/TerminalHistory.java index 9185d20..e2b6f25 100644 --- a/src/terminal/TerminalHistory.java +++ b/src/terminal/TerminalHistory.java @@ -1,6 +1,7 @@ package terminal; -import java.util.*; +import java.util.ArrayList; +import java.util.List; public class TerminalHistory { diff --git a/src/token/AtSign.java b/src/token/AtSign.java index e733e50..d057b5e 100644 --- a/src/token/AtSign.java +++ b/src/token/AtSign.java @@ -3,7 +3,8 @@ package token; import java.util.function.Supplier; import file.FilePosition; -import sexpression.*; +import sexpression.AtSignExpression; +import sexpression.SExpression; public class AtSign extends Token { diff --git a/src/token/Backquote.java b/src/token/Backquote.java index f9a6f83..4b10cbe 100644 --- a/src/token/Backquote.java +++ b/src/token/Backquote.java @@ -3,7 +3,8 @@ package token; import java.util.function.Supplier; import file.FilePosition; -import sexpression.*; +import sexpression.BackquoteExpression; +import sexpression.SExpression; public class Backquote extends Token { diff --git a/src/token/Comma.java b/src/token/Comma.java index c661bef..0a419fe 100644 --- a/src/token/Comma.java +++ b/src/token/Comma.java @@ -3,7 +3,8 @@ package token; import java.util.function.Supplier; import file.FilePosition; -import sexpression.*; +import sexpression.CommaExpression; +import sexpression.SExpression; public class Comma extends Token { diff --git a/src/token/Identifier.java b/src/token/Identifier.java index ae91077..f425de4 100644 --- a/src/token/Identifier.java +++ b/src/token/Identifier.java @@ -3,7 +3,8 @@ package token; import java.util.function.Supplier; import file.FilePosition; -import sexpression.*; +import sexpression.SExpression; +import sexpression.Symbol; public class Identifier extends Token { diff --git a/src/token/Number.java b/src/token/Number.java index 3abc7ad..dad0d82 100644 --- a/src/token/Number.java +++ b/src/token/Number.java @@ -3,7 +3,8 @@ package token; import java.util.function.Supplier; import file.FilePosition; -import sexpression.*; +import sexpression.LispNumber; +import sexpression.SExpression; public class Number extends Token { diff --git a/src/token/QuoteMark.java b/src/token/QuoteMark.java index bdbca45..8dba568 100644 --- a/src/token/QuoteMark.java +++ b/src/token/QuoteMark.java @@ -5,7 +5,9 @@ import static sexpression.Nil.NIL; import java.util.function.Supplier; import file.FilePosition; -import sexpression.*; +import sexpression.Cons; +import sexpression.SExpression; +import sexpression.Symbol; public class QuoteMark extends Token { diff --git a/src/token/QuotedString.java b/src/token/QuotedString.java index 76b5b91..22b08b9 100644 --- a/src/token/QuotedString.java +++ b/src/token/QuotedString.java @@ -3,7 +3,8 @@ package token; import java.util.function.Supplier; import file.FilePosition; -import sexpression.*; +import sexpression.LispString; +import sexpression.SExpression; public class QuotedString extends Token { diff --git a/src/token/Token.java b/src/token/Token.java index 7cdf43b..2a622d7 100644 --- a/src/token/Token.java +++ b/src/token/Token.java @@ -3,7 +3,8 @@ package token; import java.util.function.Supplier; import file.FilePosition; -import sexpression.*; +import sexpression.Cons; +import sexpression.SExpression; public abstract class Token { diff --git a/src/token/TokenFactory.java b/src/token/TokenFactory.java index 1347f24..d35aa89 100644 --- a/src/token/TokenFactory.java +++ b/src/token/TokenFactory.java @@ -2,7 +2,8 @@ package token; import static java.text.MessageFormat.format; -import error.*; +import error.CriticalLineColumnException; +import error.LineColumnException; import file.FilePosition; public interface TokenFactory { diff --git a/src/token/TokenFactoryImpl.java b/src/token/TokenFactoryImpl.java index 2ee71b4..cb557e0 100644 --- a/src/token/TokenFactoryImpl.java +++ b/src/token/TokenFactoryImpl.java @@ -1,7 +1,15 @@ package token; import static java.lang.Character.isDigit; -import static util.Characters.*; +import static util.Characters.AT_SIGN; +import static util.Characters.BACKQUOTE; +import static util.Characters.COMMA; +import static util.Characters.DOUBLE_QUOTE; +import static util.Characters.LEFT_PARENTHESIS; +import static util.Characters.RIGHT_PARENTHESIS; +import static util.Characters.SINGLE_QUOTE; +import static util.Characters.isLegalIdentifierCharacter; +import static util.Characters.isNumberPrefix; import file.FilePosition; diff --git a/src/util/Characters.java b/src/util/Characters.java index 1840bb8..8211812 100644 --- a/src/util/Characters.java +++ b/src/util/Characters.java @@ -1,6 +1,7 @@ package util; -import java.util.*; +import java.util.HashSet; +import java.util.Set; public final class Characters { diff --git a/test/acceptance/fixture/LispInterpreterFixture.java b/test/acceptance/fixture/LispInterpreterFixture.java index bb4f0d2..e6ce777 100644 --- a/test/acceptance/fixture/LispInterpreterFixture.java +++ b/test/acceptance/fixture/LispInterpreterFixture.java @@ -3,10 +3,16 @@ package acceptance.fixture; import static table.FunctionTable.resetFunctionTable; import static util.Path.getPathPrefix; -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.PrintStream; import environment.RuntimeEnvironment; -import interpreter.*; +import interpreter.LispInterpreter; +import interpreter.LispInterpreterBuilder; +import interpreter.LispInterpreterBuilderImpl; import table.ExecutionContext; public class LispInterpreterFixture { diff --git a/test/environment/RuntimeEnvironmentTest.java b/test/environment/RuntimeEnvironmentTest.java index 95572ea..a18820a 100644 --- a/test/environment/RuntimeEnvironmentTest.java +++ b/test/environment/RuntimeEnvironmentTest.java @@ -1,10 +1,16 @@ package environment; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; -import java.util.*; +import java.util.HashSet; +import java.util.Set; -import org.junit.*; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; import error.ErrorManager; diff --git a/test/error/ErrorManagerTest.java b/test/error/ErrorManagerTest.java index c0bf58c..d04f4c6 100644 --- a/test/error/ErrorManagerTest.java +++ b/test/error/ErrorManagerTest.java @@ -1,12 +1,19 @@ package error; -import static error.ErrorManager.Severity.*; -import static org.junit.Assert.*; +import static error.ErrorManager.Severity.CRITICAL; +import static error.ErrorManager.Severity.ERROR; +import static error.ErrorManager.Severity.WARNING; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; -import java.io.*; -import java.util.*; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.HashSet; +import java.util.Set; -import org.junit.*; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; import environment.RuntimeEnvironment; import error.ErrorManager.Severity; diff --git a/test/file/FilePositionTrackerTest.java b/test/file/FilePositionTrackerTest.java index 5358c62..b62ddf3 100644 --- a/test/file/FilePositionTrackerTest.java +++ b/test/file/FilePositionTrackerTest.java @@ -4,7 +4,8 @@ import static org.junit.Assert.assertTrue; import java.util.Objects; -import org.junit.*; +import org.junit.Before; +import org.junit.Test; public class FilePositionTrackerTest { diff --git a/test/function/ArgumentValidatorTest.java b/test/function/ArgumentValidatorTest.java index fa3e2f6..6900fd2 100644 --- a/test/function/ArgumentValidatorTest.java +++ b/test/function/ArgumentValidatorTest.java @@ -1,14 +1,24 @@ package function; import static error.ErrorManager.Severity.ERROR; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; -import org.junit.*; +import org.junit.Before; +import org.junit.Test; -import function.ArgumentValidator.*; -import sexpression.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.DottedArgumentListException; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; +import sexpression.Cons; +import sexpression.LispString; +import sexpression.Nil; +import sexpression.SExpression; +import sexpression.Symbol; public class ArgumentValidatorTest { diff --git a/test/function/LispFunctionTest.java b/test/function/LispFunctionTest.java index c23febb..20243fc 100644 --- a/test/function/LispFunctionTest.java +++ b/test/function/LispFunctionTest.java @@ -4,7 +4,8 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; -import sexpression.*; +import sexpression.Cons; +import sexpression.SExpression; public class LispFunctionTest { diff --git a/test/function/LispSpecialFunctionTest.java b/test/function/LispSpecialFunctionTest.java index 88e8ca0..9ff4622 100644 --- a/test/function/LispSpecialFunctionTest.java +++ b/test/function/LispSpecialFunctionTest.java @@ -4,7 +4,8 @@ import static org.junit.Assert.assertFalse; import org.junit.Test; -import sexpression.*; +import sexpression.Cons; +import sexpression.SExpression; public class LispSpecialFunctionTest { diff --git a/test/function/UserDefinedFunctionTest.java b/test/function/UserDefinedFunctionTest.java index 50776c1..1ec8d3c 100644 --- a/test/function/UserDefinedFunctionTest.java +++ b/test/function/UserDefinedFunctionTest.java @@ -1,15 +1,21 @@ package function; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import static sexpression.Nil.NIL; import static testutil.TestUtilities.assertSExpressionsMatch; import org.junit.Test; import error.ErrorManager; -import function.ArgumentValidator.*; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import function.UserDefinedFunction.IllegalKeywordRestPositionException; -import sexpression.*; +import sexpression.Cons; +import sexpression.LispNumber; +import sexpression.SExpression; +import sexpression.Symbol; public class UserDefinedFunctionTest { diff --git a/test/function/builtin/APPLYTest.java b/test/function/builtin/APPLYTest.java index 7a257a8..ee75ca3 100644 --- a/test/function/builtin/APPLYTest.java +++ b/test/function/builtin/APPLYTest.java @@ -1,11 +1,16 @@ package function.builtin; import static function.builtin.APPLY.apply; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TestUtilities.parseString; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.DottedArgumentListException; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import function.builtin.EVAL.UndefinedFunctionException; import sexpression.Cons; import testutil.SymbolAndFunctionCleaner; diff --git a/test/function/builtin/BackquoteEvaluatorTest.java b/test/function/builtin/BackquoteEvaluatorTest.java index c857e71..401f961 100644 --- a/test/function/builtin/BackquoteEvaluatorTest.java +++ b/test/function/builtin/BackquoteEvaluatorTest.java @@ -2,13 +2,25 @@ package function.builtin; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertIsErrorWithMessage; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.makeList; import org.junit.Test; import function.ArgumentValidator.DottedArgumentListException; -import function.builtin.BackquoteEvaluator.*; -import sexpression.*; +import function.builtin.BackquoteEvaluator.AtSignNotInCommaException; +import function.builtin.BackquoteEvaluator.AtSignNotListException; +import function.builtin.BackquoteEvaluator.NestedAtSignException; +import function.builtin.BackquoteEvaluator.NestedCommaException; +import sexpression.AtSignExpression; +import sexpression.BackquoteExpression; +import sexpression.CommaExpression; +import sexpression.Cons; +import sexpression.LispNumber; +import sexpression.LispString; +import sexpression.SExpression; +import sexpression.Symbol; public class BackquoteEvaluatorTest { diff --git a/test/function/builtin/EVALTest.java b/test/function/builtin/EVALTest.java index e199588..7280f7e 100644 --- a/test/function/builtin/EVALTest.java +++ b/test/function/builtin/EVALTest.java @@ -3,13 +3,21 @@ package function.builtin; import static function.builtin.EVAL.lookupSymbol; import static org.junit.Assert.assertNull; import static sexpression.Nil.NIL; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertIsErrorWithMessage; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TestUtilities.parseString; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.DottedArgumentListException; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import function.builtin.BackquoteEvaluator.AtSignNotInCommaException; -import function.builtin.EVAL.*; +import function.builtin.EVAL.UndefinedFunctionException; +import function.builtin.EVAL.UndefinedSymbolException; +import function.builtin.EVAL.UnmatchedAtSignException; +import function.builtin.EVAL.UnmatchedCommaException; import testutil.SymbolAndFunctionCleaner; public class EVALTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/EXITTest.java b/test/function/builtin/EXITTest.java index 5795e14..491dfbd 100644 --- a/test/function/builtin/EXITTest.java +++ b/test/function/builtin/EXITTest.java @@ -1,9 +1,11 @@ package function.builtin; -import static org.junit.Assert.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import static testutil.TestUtilities.evaluateString; -import java.util.*; +import java.util.HashSet; +import java.util.Set; import org.junit.Test; diff --git a/test/function/builtin/FUNCALLTest.java b/test/function/builtin/FUNCALLTest.java index 577bf9f..be3c329 100644 --- a/test/function/builtin/FUNCALLTest.java +++ b/test/function/builtin/FUNCALLTest.java @@ -1,6 +1,8 @@ package function.builtin; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TestUtilities.parseString; import org.junit.Test; diff --git a/test/function/builtin/GENSYMTest.java b/test/function/builtin/GENSYMTest.java index 2fb496c..780519e 100644 --- a/test/function/builtin/GENSYMTest.java +++ b/test/function/builtin/GENSYMTest.java @@ -1,7 +1,9 @@ package function.builtin; import static function.builtin.GENSYM.GENSYM_PREFIX; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsDoNotMatch; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; import static testutil.TypeAssertions.assertSymbol; import org.junit.Test; diff --git a/test/function/builtin/LOADTest.java b/test/function/builtin/LOADTest.java index dd6730e..5b7bf31 100644 --- a/test/function/builtin/LOADTest.java +++ b/test/function/builtin/LOADTest.java @@ -2,15 +2,19 @@ package function.builtin; import static org.junit.Assert.assertTrue; import static testutil.TestUtilities.evaluateString; -import static testutil.TypeAssertions.*; +import static testutil.TypeAssertions.assertNil; +import static testutil.TypeAssertions.assertT; -import java.io.*; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; import org.junit.Test; import environment.RuntimeEnvironment; import error.ErrorManager; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import testutil.SymbolAndFunctionCleaner; public class LOADTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/PRINTTest.java b/test/function/builtin/PRINTTest.java index dff48fe..7f70925 100644 --- a/test/function/builtin/PRINTTest.java +++ b/test/function/builtin/PRINTTest.java @@ -4,12 +4,14 @@ import static java.text.MessageFormat.format; import static org.junit.Assert.assertEquals; import static testutil.TestUtilities.evaluateString; -import java.io.*; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; import org.junit.Test; import environment.RuntimeEnvironment; -import function.ArgumentValidator.*; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import testutil.SymbolAndFunctionCleaner; public class PRINTTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/SETTest.java b/test/function/builtin/SETTest.java index 8ae482f..9b31bf9 100644 --- a/test/function/builtin/SETTest.java +++ b/test/function/builtin/SETTest.java @@ -1,11 +1,14 @@ package function.builtin; import static org.junit.Assert.assertNull; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import function.builtin.EVAL.UndefinedSymbolException; import sexpression.LispNumber; import table.SymbolTable; diff --git a/test/function/builtin/SYMBOL_FUNCTIONTest.java b/test/function/builtin/SYMBOL_FUNCTIONTest.java index 174190a..2c85807 100644 --- a/test/function/builtin/SYMBOL_FUNCTIONTest.java +++ b/test/function/builtin/SYMBOL_FUNCTIONTest.java @@ -1,13 +1,17 @@ package function.builtin; import static error.ErrorManager.Severity.ERROR; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import static sexpression.Nil.NIL; import static testutil.TestUtilities.evaluateString; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import function.builtin.SYMBOL_FUNCTION.UndefinedSymbolFunctionException; import testutil.SymbolAndFunctionCleaner; diff --git a/test/function/builtin/cons/CONSTest.java b/test/function/builtin/cons/CONSTest.java index a524340..af713b6 100644 --- a/test/function/builtin/cons/CONSTest.java +++ b/test/function/builtin/cons/CONSTest.java @@ -1,11 +1,15 @@ package function.builtin.cons; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TestUtilities.parseString; import org.junit.Test; -import function.ArgumentValidator.*; -import sexpression.*; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; +import sexpression.Cons; +import sexpression.Symbol; import testutil.SymbolAndFunctionCleaner; public class CONSTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/cons/FIRSTTest.java b/test/function/builtin/cons/FIRSTTest.java index cf51063..e85bf77 100644 --- a/test/function/builtin/cons/FIRSTTest.java +++ b/test/function/builtin/cons/FIRSTTest.java @@ -1,10 +1,14 @@ package function.builtin.cons; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TestUtilities.parseString; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import testutil.SymbolAndFunctionCleaner; public class FIRSTTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/cons/LENGTHTest.java b/test/function/builtin/cons/LENGTHTest.java index 749d04c..2968159 100644 --- a/test/function/builtin/cons/LENGTHTest.java +++ b/test/function/builtin/cons/LENGTHTest.java @@ -1,10 +1,14 @@ package function.builtin.cons; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TestUtilities.parseString; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import testutil.SymbolAndFunctionCleaner; public class LENGTHTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/cons/LISTTest.java b/test/function/builtin/cons/LISTTest.java index 675b22d..84c1de3 100644 --- a/test/function/builtin/cons/LISTTest.java +++ b/test/function/builtin/cons/LISTTest.java @@ -1,7 +1,9 @@ package function.builtin.cons; import static function.builtin.cons.LIST.makeList; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TestUtilities.parseString; import org.junit.Test; diff --git a/test/function/builtin/cons/RESTTest.java b/test/function/builtin/cons/RESTTest.java index dec352c..ffe983c 100644 --- a/test/function/builtin/cons/RESTTest.java +++ b/test/function/builtin/cons/RESTTest.java @@ -1,10 +1,14 @@ package function.builtin.cons; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TestUtilities.parseString; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import testutil.SymbolAndFunctionCleaner; public class RESTTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/math/DIVIDETest.java b/test/function/builtin/math/DIVIDETest.java index 104045d..5cc9f59 100644 --- a/test/function/builtin/math/DIVIDETest.java +++ b/test/function/builtin/math/DIVIDETest.java @@ -1,10 +1,13 @@ package function.builtin.math; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TestUtilities.parseString; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.TooFewArgumentsException; import testutil.SymbolAndFunctionCleaner; public class DIVIDETest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/math/MINUSTest.java b/test/function/builtin/math/MINUSTest.java index d5ef079..8b8802b 100644 --- a/test/function/builtin/math/MINUSTest.java +++ b/test/function/builtin/math/MINUSTest.java @@ -1,10 +1,12 @@ package function.builtin.math; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.TooFewArgumentsException; import sexpression.LispNumber; import testutil.SymbolAndFunctionCleaner; diff --git a/test/function/builtin/math/MULTIPLYTest.java b/test/function/builtin/math/MULTIPLYTest.java index 9da264c..2a92dd6 100644 --- a/test/function/builtin/math/MULTIPLYTest.java +++ b/test/function/builtin/math/MULTIPLYTest.java @@ -1,6 +1,7 @@ package function.builtin.math; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; import org.junit.Test; diff --git a/test/function/builtin/math/PLUSTest.java b/test/function/builtin/math/PLUSTest.java index 1d850d9..33f56a7 100644 --- a/test/function/builtin/math/PLUSTest.java +++ b/test/function/builtin/math/PLUSTest.java @@ -1,6 +1,7 @@ package function.builtin.math; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; import org.junit.Test; diff --git a/test/function/builtin/predicate/ATOMTest.java b/test/function/builtin/predicate/ATOMTest.java index 17329ef..efd33b5 100644 --- a/test/function/builtin/predicate/ATOMTest.java +++ b/test/function/builtin/predicate/ATOMTest.java @@ -1,11 +1,13 @@ package function.builtin.predicate; import static testutil.TestUtilities.evaluateString; -import static testutil.TypeAssertions.*; +import static testutil.TypeAssertions.assertNil; +import static testutil.TypeAssertions.assertT; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import testutil.SymbolAndFunctionCleaner; public class ATOMTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/predicate/EQTest.java b/test/function/builtin/predicate/EQTest.java index 2f6717f..7ff7b3b 100644 --- a/test/function/builtin/predicate/EQTest.java +++ b/test/function/builtin/predicate/EQTest.java @@ -1,11 +1,13 @@ package function.builtin.predicate; import static testutil.TestUtilities.evaluateString; -import static testutil.TypeAssertions.*; +import static testutil.TypeAssertions.assertNil; +import static testutil.TypeAssertions.assertT; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import testutil.SymbolAndFunctionCleaner; public class EQTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/predicate/EQUALTest.java b/test/function/builtin/predicate/EQUALTest.java index d1cfafb..0190836 100644 --- a/test/function/builtin/predicate/EQUALTest.java +++ b/test/function/builtin/predicate/EQUALTest.java @@ -1,11 +1,13 @@ package function.builtin.predicate; import static testutil.TestUtilities.evaluateString; -import static testutil.TypeAssertions.*; +import static testutil.TypeAssertions.assertNil; +import static testutil.TypeAssertions.assertT; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import testutil.SymbolAndFunctionCleaner; public class EQUALTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/predicate/GENSYM_EQUALTest.java b/test/function/builtin/predicate/GENSYM_EQUALTest.java index ab393aa..623b07a 100644 --- a/test/function/builtin/predicate/GENSYM_EQUALTest.java +++ b/test/function/builtin/predicate/GENSYM_EQUALTest.java @@ -1,11 +1,13 @@ package function.builtin.predicate; import static testutil.TestUtilities.evaluateString; -import static testutil.TypeAssertions.*; +import static testutil.TypeAssertions.assertNil; +import static testutil.TypeAssertions.assertT; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import testutil.SymbolAndFunctionCleaner; public class GENSYM_EQUALTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/predicate/LISTPTest.java b/test/function/builtin/predicate/LISTPTest.java index 17b0282..f7dc56e 100644 --- a/test/function/builtin/predicate/LISTPTest.java +++ b/test/function/builtin/predicate/LISTPTest.java @@ -1,11 +1,13 @@ package function.builtin.predicate; import static testutil.TestUtilities.evaluateString; -import static testutil.TypeAssertions.*; +import static testutil.TypeAssertions.assertNil; +import static testutil.TypeAssertions.assertT; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import testutil.SymbolAndFunctionCleaner; public class LISTPTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/predicate/NULLTest.java b/test/function/builtin/predicate/NULLTest.java index a8b75b5..128394e 100644 --- a/test/function/builtin/predicate/NULLTest.java +++ b/test/function/builtin/predicate/NULLTest.java @@ -1,11 +1,13 @@ package function.builtin.predicate; import static testutil.TestUtilities.evaluateString; -import static testutil.TypeAssertions.*; +import static testutil.TypeAssertions.assertNil; +import static testutil.TypeAssertions.assertT; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import testutil.SymbolAndFunctionCleaner; public class NULLTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/predicate/NUMERIC_EQUALTest.java b/test/function/builtin/predicate/NUMERIC_EQUALTest.java index 1965463..21bb8cc 100644 --- a/test/function/builtin/predicate/NUMERIC_EQUALTest.java +++ b/test/function/builtin/predicate/NUMERIC_EQUALTest.java @@ -1,11 +1,13 @@ package function.builtin.predicate; import static testutil.TestUtilities.evaluateString; -import static testutil.TypeAssertions.*; +import static testutil.TypeAssertions.assertNil; +import static testutil.TypeAssertions.assertT; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.TooFewArgumentsException; import testutil.SymbolAndFunctionCleaner; public class NUMERIC_EQUALTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/predicate/NUMERIC_GREATERTest.java b/test/function/builtin/predicate/NUMERIC_GREATERTest.java index 4aed1ae..6867176 100644 --- a/test/function/builtin/predicate/NUMERIC_GREATERTest.java +++ b/test/function/builtin/predicate/NUMERIC_GREATERTest.java @@ -1,11 +1,13 @@ package function.builtin.predicate; import static testutil.TestUtilities.evaluateString; -import static testutil.TypeAssertions.*; +import static testutil.TypeAssertions.assertNil; +import static testutil.TypeAssertions.assertT; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.TooFewArgumentsException; import testutil.SymbolAndFunctionCleaner; public class NUMERIC_GREATERTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/predicate/NUMERIC_LESSTest.java b/test/function/builtin/predicate/NUMERIC_LESSTest.java index f2ba9da..48d3e91 100644 --- a/test/function/builtin/predicate/NUMERIC_LESSTest.java +++ b/test/function/builtin/predicate/NUMERIC_LESSTest.java @@ -1,11 +1,13 @@ package function.builtin.predicate; import static testutil.TestUtilities.evaluateString; -import static testutil.TypeAssertions.*; +import static testutil.TypeAssertions.assertNil; +import static testutil.TypeAssertions.assertT; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.TooFewArgumentsException; import testutil.SymbolAndFunctionCleaner; public class NUMERIC_LESSTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/special/ANDTest.java b/test/function/builtin/special/ANDTest.java index 05d8f84..d995e0e 100644 --- a/test/function/builtin/special/ANDTest.java +++ b/test/function/builtin/special/ANDTest.java @@ -1,7 +1,9 @@ package function.builtin.special; -import static testutil.TestUtilities.*; -import static testutil.TypeAssertions.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TypeAssertions.assertNil; +import static testutil.TypeAssertions.assertT; import org.junit.Test; diff --git a/test/function/builtin/special/CASETest.java b/test/function/builtin/special/CASETest.java index 69bd42b..5a8bb20 100644 --- a/test/function/builtin/special/CASETest.java +++ b/test/function/builtin/special/CASETest.java @@ -1,10 +1,13 @@ package function.builtin.special; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TestUtilities.parseString; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.TooFewArgumentsException; import testutil.SymbolAndFunctionCleaner; public class CASETest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/special/CONDTest.java b/test/function/builtin/special/CONDTest.java index 8863e9c..84856b2 100644 --- a/test/function/builtin/special/CONDTest.java +++ b/test/function/builtin/special/CONDTest.java @@ -1,10 +1,13 @@ package function.builtin.special; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TestUtilities.parseString; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.DottedArgumentListException; import testutil.SymbolAndFunctionCleaner; public class CONDTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/special/DEFINE_SPECIALTest.java b/test/function/builtin/special/DEFINE_SPECIALTest.java index a137fb8..8b2fa9a 100644 --- a/test/function/builtin/special/DEFINE_SPECIALTest.java +++ b/test/function/builtin/special/DEFINE_SPECIALTest.java @@ -1,15 +1,21 @@ package function.builtin.special; import static org.junit.Assert.assertTrue; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TestUtilities.parseString; -import java.io.*; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; import org.junit.Test; import environment.RuntimeEnvironment; import error.ErrorManager; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.DottedArgumentListException; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import function.UserDefinedFunction.IllegalKeywordRestPositionException; import testutil.SymbolAndFunctionCleaner; diff --git a/test/function/builtin/special/DEFMACROTest.java b/test/function/builtin/special/DEFMACROTest.java index ba4ba9b..13a7a8e 100644 --- a/test/function/builtin/special/DEFMACROTest.java +++ b/test/function/builtin/special/DEFMACROTest.java @@ -1,15 +1,21 @@ package function.builtin.special; import static org.junit.Assert.assertTrue; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TestUtilities.parseString; -import java.io.*; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; import org.junit.Test; import environment.RuntimeEnvironment; import error.ErrorManager; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.DottedArgumentListException; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import function.UserDefinedFunction.IllegalKeywordRestPositionException; import testutil.SymbolAndFunctionCleaner; diff --git a/test/function/builtin/special/DEFUNTest.java b/test/function/builtin/special/DEFUNTest.java index 979938a..ba7c68c 100644 --- a/test/function/builtin/special/DEFUNTest.java +++ b/test/function/builtin/special/DEFUNTest.java @@ -1,15 +1,21 @@ package function.builtin.special; import static org.junit.Assert.assertTrue; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TestUtilities.parseString; -import java.io.*; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; import org.junit.Test; import environment.RuntimeEnvironment; import error.ErrorManager; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.DottedArgumentListException; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import function.UserDefinedFunction.IllegalKeywordRestPositionException; import testutil.SymbolAndFunctionCleaner; diff --git a/test/function/builtin/special/IFTest.java b/test/function/builtin/special/IFTest.java index b9eba13..ac19398 100644 --- a/test/function/builtin/special/IFTest.java +++ b/test/function/builtin/special/IFTest.java @@ -1,11 +1,13 @@ package function.builtin.special; import static testutil.TestUtilities.evaluateString; -import static testutil.TypeAssertions.*; +import static testutil.TypeAssertions.assertNil; +import static testutil.TypeAssertions.assertT; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import function.builtin.EVAL.UndefinedSymbolException; import testutil.SymbolAndFunctionCleaner; diff --git a/test/function/builtin/special/LAMBDATest.java b/test/function/builtin/special/LAMBDATest.java index 0c2f496..a251d1a 100644 --- a/test/function/builtin/special/LAMBDATest.java +++ b/test/function/builtin/special/LAMBDATest.java @@ -1,15 +1,23 @@ package function.builtin.special; -import static org.junit.Assert.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import static sexpression.LispNumber.ONE; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TestUtilities.parseString; import org.junit.Test; -import function.ArgumentValidator.*; -import sexpression.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.DottedArgumentListException; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; +import sexpression.Cons; +import sexpression.LispNumber; +import sexpression.Symbol; import testutil.SymbolAndFunctionCleaner; public class LAMBDATest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/special/LETTest.java b/test/function/builtin/special/LETTest.java index 65d7347..8646c05 100644 --- a/test/function/builtin/special/LETTest.java +++ b/test/function/builtin/special/LETTest.java @@ -1,13 +1,18 @@ package function.builtin.special; import static sexpression.Nil.NIL; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.DottedArgumentListException; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import function.builtin.EVAL.UndefinedSymbolException; -import sexpression.*; +import sexpression.Cons; +import sexpression.LispNumber; import testutil.SymbolAndFunctionCleaner; public class LETTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/special/LET_STARTest.java b/test/function/builtin/special/LET_STARTest.java index aeb2f0e..e00a8d9 100644 --- a/test/function/builtin/special/LET_STARTest.java +++ b/test/function/builtin/special/LET_STARTest.java @@ -1,13 +1,18 @@ package function.builtin.special; import static sexpression.Nil.NIL; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.DottedArgumentListException; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import function.builtin.EVAL.UndefinedSymbolException; -import sexpression.*; +import sexpression.Cons; +import sexpression.LispNumber; import testutil.SymbolAndFunctionCleaner; public class LET_STARTest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/special/ORTest.java b/test/function/builtin/special/ORTest.java index c3d56c3..3e57073 100644 --- a/test/function/builtin/special/ORTest.java +++ b/test/function/builtin/special/ORTest.java @@ -1,7 +1,9 @@ package function.builtin.special; -import static testutil.TestUtilities.*; -import static testutil.TypeAssertions.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TypeAssertions.assertNil; +import static testutil.TypeAssertions.assertT; import org.junit.Test; diff --git a/test/function/builtin/special/PROGNTest.java b/test/function/builtin/special/PROGNTest.java index 1496d09..88ed0c1 100644 --- a/test/function/builtin/special/PROGNTest.java +++ b/test/function/builtin/special/PROGNTest.java @@ -1,6 +1,8 @@ package function.builtin.special; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TestUtilities.parseString; import static testutil.TypeAssertions.assertNil; import org.junit.Test; diff --git a/test/function/builtin/special/QUOTETest.java b/test/function/builtin/special/QUOTETest.java index 3a209d8..e93ef55 100644 --- a/test/function/builtin/special/QUOTETest.java +++ b/test/function/builtin/special/QUOTETest.java @@ -1,10 +1,13 @@ package function.builtin.special; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; +import static testutil.TestUtilities.parseString; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import testutil.SymbolAndFunctionCleaner; public class QUOTETest extends SymbolAndFunctionCleaner { diff --git a/test/function/builtin/special/SETQTest.java b/test/function/builtin/special/SETQTest.java index 83731f1..90aad00 100644 --- a/test/function/builtin/special/SETQTest.java +++ b/test/function/builtin/special/SETQTest.java @@ -1,11 +1,14 @@ package function.builtin.special; import static org.junit.Assert.assertNull; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.evaluateString; import org.junit.Test; -import function.ArgumentValidator.*; +import function.ArgumentValidator.BadArgumentTypeException; +import function.ArgumentValidator.TooFewArgumentsException; +import function.ArgumentValidator.TooManyArgumentsException; import function.builtin.EVAL.UndefinedSymbolException; import sexpression.LispNumber; import table.SymbolTable; diff --git a/test/interpreter/LispInterpreterTest.java b/test/interpreter/LispInterpreterTest.java index bbe44be..c531f86 100644 --- a/test/interpreter/LispInterpreterTest.java +++ b/test/interpreter/LispInterpreterTest.java @@ -3,13 +3,20 @@ package interpreter; import static error.ErrorManager.Severity.CRITICAL; import static interpreter.InteractiveLispInterpreter.PROMPT; import static java.text.MessageFormat.format; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import static testutil.TestUtilities.createInputStreamFromString; -import java.io.*; -import java.util.*; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.HashSet; +import java.util.Set; -import org.junit.*; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; import environment.RuntimeEnvironment; import interpreter.LispInterpreterBuilderImpl.InterpreterAlreadyBuiltException; diff --git a/test/main/MainTest.java b/test/main/MainTest.java index 03e32c8..b829961 100644 --- a/test/main/MainTest.java +++ b/test/main/MainTest.java @@ -1,21 +1,31 @@ package main; import static java.text.MessageFormat.format; -import static main.LispMain.*; +import static main.LispMain.ANSI_GREEN; +import static main.LispMain.ANSI_PURPLE; +import static main.LispMain.ANSI_RESET; +import static main.LispMain.GREETING; import static org.junit.Assert.assertEquals; -import java.io.*; +import java.io.PipedInputStream; +import java.io.PipedOutputStream; import java.util.concurrent.CountDownLatch; -import org.junit.*; -import org.junit.contrib.java.lang.system.*; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.contrib.java.lang.system.ExpectedSystemExit; +import org.junit.contrib.java.lang.system.SystemErrRule; +import org.junit.contrib.java.lang.system.SystemOutRule; import com.googlecode.lanterna.input.KeyType; import com.googlecode.lanterna.terminal.virtual.DefaultVirtualTerminal; import environment.RuntimeEnvironment; import interpreter.LispInterpreterBuilderImpl; -import terminal.*; +import terminal.TerminalConfiguration; +import terminal.VirtualTerminalInteractor; public class MainTest { diff --git a/test/parser/LispParserTest.java b/test/parser/LispParserTest.java index 0c53a93..945f9e7 100644 --- a/test/parser/LispParserTest.java +++ b/test/parser/LispParserTest.java @@ -1,9 +1,21 @@ package parser; import static error.ErrorManager.Severity.ERROR; -import static org.junit.Assert.*; -import static testutil.TestUtilities.*; -import static testutil.TypeAssertions.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static testutil.TestUtilities.createIOExceptionThrowingInputStream; +import static testutil.TestUtilities.createInputStreamFromString; +import static testutil.TypeAssertions.assertAtSignExpression; +import static testutil.TypeAssertions.assertBackTickExpression; +import static testutil.TypeAssertions.assertCommaExpression; +import static testutil.TypeAssertions.assertList; +import static testutil.TypeAssertions.assertNil; +import static testutil.TypeAssertions.assertNumber; +import static testutil.TypeAssertions.assertString; +import static testutil.TypeAssertions.assertSymbol; import java.io.InputStream; diff --git a/test/scanner/LispCommentRemovingInputStreamTest.java b/test/scanner/LispCommentRemovingInputStreamTest.java index ad3d308..07fb893 100644 --- a/test/scanner/LispCommentRemovingInputStreamTest.java +++ b/test/scanner/LispCommentRemovingInputStreamTest.java @@ -1,8 +1,11 @@ package scanner; import static error.ErrorManager.Severity.CRITICAL; -import static org.junit.Assert.*; -import static testutil.TestUtilities.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static testutil.TestUtilities.createIOExceptionThrowingInputStream; +import static testutil.TestUtilities.createInputStreamFromString; import java.io.InputStream; diff --git a/test/scanner/LispScannerTypeTest.java b/test/scanner/LispScannerTypeTest.java index 7f08bdd..58078d7 100644 --- a/test/scanner/LispScannerTypeTest.java +++ b/test/scanner/LispScannerTypeTest.java @@ -1,17 +1,30 @@ package scanner; import static error.ErrorManager.Severity.ERROR; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import static testutil.TestUtilities.createInputStreamFromString; import java.io.InputStream; -import java.util.*; +import java.util.ArrayList; +import java.util.List; -import org.junit.*; +import org.junit.Before; +import org.junit.Test; import scanner.LispScanner.UnterminatedStringException; -import token.*; +import token.AtSign; +import token.Backquote; +import token.Comma; +import token.Eof; +import token.Identifier; +import token.LeftParenthesis; import token.Number; +import token.QuoteMark; +import token.QuotedString; +import token.RightParenthesis; +import token.Token; import token.TokenFactory.BadCharacterException; public class LispScannerTypeTest { diff --git a/test/sexpression/SExpressionTest.java b/test/sexpression/SExpressionTest.java index d1e2072..710657a 100644 --- a/test/sexpression/SExpressionTest.java +++ b/test/sexpression/SExpressionTest.java @@ -1,9 +1,12 @@ package sexpression; import static error.ErrorManager.Severity.ERROR; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import static sexpression.Nil.NIL; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.assertSExpressionsMatch; +import static testutil.TestUtilities.makeList; import java.math.BigInteger; diff --git a/test/stream/SafeInputStreamTest.java b/test/stream/SafeInputStreamTest.java index 25fecbf..4be1d9c 100644 --- a/test/stream/SafeInputStreamTest.java +++ b/test/stream/SafeInputStreamTest.java @@ -1,9 +1,11 @@ package stream; import static org.junit.Assert.assertEquals; -import static testutil.TestUtilities.*; +import static testutil.TestUtilities.createIOExceptionThrowingInputStream; +import static testutil.TestUtilities.createInputStreamFromString; -import org.junit.*; +import org.junit.Before; +import org.junit.Test; public class SafeInputStreamTest { diff --git a/test/stream/SafeOutputStreamTest.java b/test/stream/SafeOutputStreamTest.java index f0ff411..1fc4269 100644 --- a/test/stream/SafeOutputStreamTest.java +++ b/test/stream/SafeOutputStreamTest.java @@ -5,7 +5,8 @@ import static testutil.TestUtilities.createIOExceptionThrowingOutputStream; import java.io.ByteArrayOutputStream; -import org.junit.*; +import org.junit.Before; +import org.junit.Test; public class SafeOutputStreamTest { diff --git a/test/table/ExecutionContextTest.java b/test/table/ExecutionContextTest.java index 1dd22e4..3a374e0 100644 --- a/test/table/ExecutionContextTest.java +++ b/test/table/ExecutionContextTest.java @@ -1,10 +1,14 @@ package table; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNull; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; -import org.junit.*; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; public class ExecutionContextTest { diff --git a/test/table/FunctionTableTest.java b/test/table/FunctionTableTest.java index 09b87e8..0e24546 100644 --- a/test/table/FunctionTableTest.java +++ b/test/table/FunctionTableTest.java @@ -1,17 +1,29 @@ package table; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; -import static table.FunctionTable.*; +import static table.FunctionTable.defineFunction; +import static table.FunctionTable.isAlreadyDefined; +import static table.FunctionTable.lookupFunction; +import static table.FunctionTable.resetFunctionTable; -import java.util.*; +import java.util.HashSet; +import java.util.Set; -import org.junit.*; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; import error.ErrorManager; -import function.*; -import sexpression.*; +import function.FunctionNames; +import function.LispFunction; +import sexpression.Cons; +import sexpression.SExpression; import table.FunctionTable.LispFunctionInstantiationException; public class FunctionTableTest { diff --git a/test/table/SymbolTableTest.java b/test/table/SymbolTableTest.java index f569e7e..778ed9a 100644 --- a/test/table/SymbolTableTest.java +++ b/test/table/SymbolTableTest.java @@ -1,10 +1,13 @@ package table; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; -import org.junit.*; +import org.junit.Before; +import org.junit.Test; public class SymbolTableTest { diff --git a/test/terminal/ControlSequenceHandlerTest.java b/test/terminal/ControlSequenceHandlerTest.java index b429160..d1019e7 100644 --- a/test/terminal/ControlSequenceHandlerTest.java +++ b/test/terminal/ControlSequenceHandlerTest.java @@ -1,10 +1,17 @@ package terminal; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import static terminal.ControlSequenceHandler.isEscape; -import static terminal.SelectGraphicRendition.*; +import static terminal.SelectGraphicRendition.GREEN; +import static terminal.SelectGraphicRendition.PURPLE; +import static terminal.SelectGraphicRendition.RED; +import static terminal.SelectGraphicRendition.RESET; +import static terminal.SelectGraphicRendition.YELLOW; -import org.junit.*; +import org.junit.Before; +import org.junit.Test; import stream.SafeInputStream; import terminal.ControlSequence.NullControlSequence; diff --git a/test/terminal/ControlSequenceTest.java b/test/terminal/ControlSequenceTest.java index 608e6ea..8123ee8 100644 --- a/test/terminal/ControlSequenceTest.java +++ b/test/terminal/ControlSequenceTest.java @@ -1,14 +1,22 @@ package terminal; -import static org.junit.Assert.*; -import static terminal.SelectGraphicRendition.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static terminal.SelectGraphicRendition.GREEN; +import static terminal.SelectGraphicRendition.PURPLE; +import static terminal.SelectGraphicRendition.RED; +import static terminal.SelectGraphicRendition.RESET; +import static terminal.SelectGraphicRendition.YELLOW; -import java.util.*; +import java.util.HashSet; +import java.util.Set; -import org.junit.*; +import org.junit.Before; +import org.junit.Test; import com.googlecode.lanterna.TextColor; -import com.googlecode.lanterna.terminal.virtual.*; +import com.googlecode.lanterna.terminal.virtual.DefaultVirtualTerminal; +import com.googlecode.lanterna.terminal.virtual.VirtualTerminal; import terminal.ControlSequence.NullControlSequence; diff --git a/test/terminal/LispTerminalTest.java b/test/terminal/LispTerminalTest.java index f614a6f..cf140b0 100644 --- a/test/terminal/LispTerminalTest.java +++ b/test/terminal/LispTerminalTest.java @@ -1,9 +1,18 @@ package terminal; -import static com.googlecode.lanterna.input.KeyType.*; +import static com.googlecode.lanterna.input.KeyType.ArrowDown; +import static com.googlecode.lanterna.input.KeyType.ArrowLeft; +import static com.googlecode.lanterna.input.KeyType.ArrowRight; +import static com.googlecode.lanterna.input.KeyType.ArrowUp; +import static com.googlecode.lanterna.input.KeyType.Backspace; +import static com.googlecode.lanterna.input.KeyType.Delete; +import static com.googlecode.lanterna.input.KeyType.Enter; +import static com.googlecode.lanterna.input.KeyType.Escape; import static terminal.LispTerminal.END_OF_SEGMENT; -import org.junit.*; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; public class LispTerminalTest { diff --git a/test/terminal/TerminalConfigurationTest.java b/test/terminal/TerminalConfigurationTest.java index 4ebc89c..9da9f08 100644 --- a/test/terminal/TerminalConfigurationTest.java +++ b/test/terminal/TerminalConfigurationTest.java @@ -1,8 +1,11 @@ package terminal; -import java.io.*; +import java.io.IOException; +import java.io.PipedInputStream; +import java.io.PipedOutputStream; -import org.junit.*; +import org.junit.Before; +import org.junit.Test; import stream.UncheckedIOException; diff --git a/test/terminal/TerminalHistoryTest.java b/test/terminal/TerminalHistoryTest.java index 1577ecf..7838637 100644 --- a/test/terminal/TerminalHistoryTest.java +++ b/test/terminal/TerminalHistoryTest.java @@ -1,8 +1,11 @@ package terminal; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; -import org.junit.*; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; public class TerminalHistoryTest { diff --git a/test/terminal/VirtualTerminalInteractor.java b/test/terminal/VirtualTerminalInteractor.java index 2cdd5f5..24058b7 100644 --- a/test/terminal/VirtualTerminalInteractor.java +++ b/test/terminal/VirtualTerminalInteractor.java @@ -1,13 +1,19 @@ package terminal; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; import static terminal.LispTerminal.END_OF_SEGMENT; -import java.io.*; +import java.io.IOException; +import java.io.PipedInputStream; +import java.io.PipedOutputStream; -import com.googlecode.lanterna.*; -import com.googlecode.lanterna.input.*; -import com.googlecode.lanterna.terminal.virtual.*; +import com.googlecode.lanterna.TerminalPosition; +import com.googlecode.lanterna.TerminalSize; +import com.googlecode.lanterna.input.KeyStroke; +import com.googlecode.lanterna.input.KeyType; +import com.googlecode.lanterna.terminal.virtual.DefaultVirtualTerminal; +import com.googlecode.lanterna.terminal.virtual.VirtualTerminal; import stream.UncheckedIOException; diff --git a/test/testutil/SymbolAndFunctionCleaner.java b/test/testutil/SymbolAndFunctionCleaner.java index 941485f..3181ea0 100644 --- a/test/testutil/SymbolAndFunctionCleaner.java +++ b/test/testutil/SymbolAndFunctionCleaner.java @@ -2,7 +2,8 @@ package testutil; import static table.FunctionTable.resetFunctionTable; -import org.junit.*; +import org.junit.After; +import org.junit.Before; import table.ExecutionContext; diff --git a/test/testutil/TestUtilities.java b/test/testutil/TestUtilities.java index 65b9971..6220bf4 100644 --- a/test/testutil/TestUtilities.java +++ b/test/testutil/TestUtilities.java @@ -2,15 +2,22 @@ package testutil; import static error.ErrorManager.Severity.ERROR; import static function.builtin.EVAL.eval; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import static sexpression.Nil.NIL; -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.util.Arrays; import error.LispException; import parser.LispParser; -import sexpression.*; +import sexpression.Cons; +import sexpression.SExpression; public final class TestUtilities { diff --git a/test/testutil/TypeAssertions.java b/test/testutil/TypeAssertions.java index d0e804d..61da74f 100644 --- a/test/testutil/TypeAssertions.java +++ b/test/testutil/TypeAssertions.java @@ -1,6 +1,8 @@ package testutil; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import static sexpression.Nil.NIL; import static sexpression.Symbol.T; diff --git a/test/token/TokenFactoryTest.java b/test/token/TokenFactoryTest.java index fdcf017..9401394 100644 --- a/test/token/TokenFactoryTest.java +++ b/test/token/TokenFactoryTest.java @@ -1,12 +1,16 @@ package token; import static error.ErrorManager.Severity.CRITICAL; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; -import org.junit.*; +import org.junit.Before; +import org.junit.Test; import file.FilePosition; -import token.TokenFactory.*; +import token.TokenFactory.BadCharacterException; +import token.TokenFactory.EmptyTokenTextException; public class TokenFactoryTest { diff --git a/test/util/CharactersTest.java b/test/util/CharactersTest.java index 7e0115c..4404878 100644 --- a/test/util/CharactersTest.java +++ b/test/util/CharactersTest.java @@ -2,7 +2,8 @@ package util; import static org.junit.Assert.assertTrue; -import java.lang.reflect.*; +import java.lang.reflect.Constructor; +import java.lang.reflect.Modifier; import org.junit.Test; diff --git a/test/util/PathTest.java b/test/util/PathTest.java index 6d9bd4f..cf48ea4 100644 --- a/test/util/PathTest.java +++ b/test/util/PathTest.java @@ -2,7 +2,8 @@ package util; import static org.junit.Assert.assertTrue; -import java.lang.reflect.*; +import java.lang.reflect.Constructor; +import java.lang.reflect.Modifier; import org.junit.Test;