diff --git a/src/error/ErrorManager.java b/src/error/ErrorManager.java
index bd065a1..2a20dc6 100644
--- a/src/error/ErrorManager.java
+++ b/src/error/ErrorManager.java
@@ -3,7 +3,7 @@ package error;
import java.text.MessageFormat;
/**
- * Prints error messages.
+ * Prints error messages and potentially terminates the application.
*/
public class ErrorManager {
@@ -15,27 +15,13 @@ public class ErrorManager {
public static final String ANSI_PURPLE = "\u001B[35m";
public static void generateError(LispException lispException) {
- generateError(lispException.getMessage(), lispException.getSeverity());
- }
-
- /**
- * Prints out the specified error message to the console and decides whether
- * or not to terminate the currently running program.
- *
- * @param message
- * the error message
- * @param level
- * the "criticality" level of the error
- * @postcondition If level >= CRITICAL_LEVEL
the currently
- * running program has been terminated.
- */
- public static void generateError(String message, int level) {
- String color = (level >= CRITICAL_LEVEL) ? ANSI_PURPLE : ANSI_RED;
- String formattedMessage = MessageFormat.format("{0}error: {1}{2}", color, message, ANSI_RESET);
+ String color = (lispException.getSeverity() >= CRITICAL_LEVEL) ? ANSI_PURPLE : ANSI_RED;
+ String formattedMessage = MessageFormat.format("{0}error: {1}{2}", color, lispException.getMessage(),
+ ANSI_RESET);
System.out.println(formattedMessage);
- if (level >= CRITICAL_LEVEL) {
+ if (lispException.getSeverity() >= CRITICAL_LEVEL) {
System.exit(1);
}
}
diff --git a/src/main/LispInterpreter.java b/src/main/LispInterpreter.java
index 08dafe5..3236019 100644
--- a/src/main/LispInterpreter.java
+++ b/src/main/LispInterpreter.java
@@ -32,14 +32,14 @@ public class LispInterpreter {
/**
* Evaluate the S-expressions found in the file given as a command-line
- * argument and print the results to the console. If no file name was
- * given, retrieve the S-expressions from standard input.
+ * argument and print the results to the console. If no file name was given,
+ * retrieve the S-expressions from standard input.
*
* @param args
- * the command-line arguments:
- *
args[0]
- file name (optional)args[0]
- file name (optional)