Fixed several minor issues Only print the last value when interpreting a file Resolves #4
29 lines
734 B
Java
29 lines
734 B
Java
package interpreter;
|
|
|
|
import sexpression.SExpression;
|
|
|
|
public class InteractiveLispInterpreter extends LispInterpreter {
|
|
|
|
private static final String PROMPT = "~ ";
|
|
|
|
@Override
|
|
protected void prompt() {
|
|
environment.getOutput().print(environment.decoratePrompt(PROMPT));
|
|
environment.getOutput().flush();
|
|
}
|
|
|
|
@Override
|
|
protected void printSExpression(SExpression sExpression) {
|
|
environment.getOutput().println();
|
|
super.printSExpression(sExpression);
|
|
}
|
|
|
|
@Override
|
|
protected void applyFinishingTouches() {
|
|
environment.getOutput().println();
|
|
environment.getOutput().println(environment.decoratePrompt(""));
|
|
environment.getOutput().flush();
|
|
}
|
|
|
|
}
|