diff options
Diffstat (limited to 'src/LispExecutionContext.kt')
-rw-r--r-- | src/LispExecutionContext.kt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/LispExecutionContext.kt b/src/LispExecutionContext.kt index 20d581e..ba7df41 100644 --- a/src/LispExecutionContext.kt +++ b/src/LispExecutionContext.kt @@ -16,10 +16,12 @@ class LispExecutionContext() { return StackFrame(rootStackFrame) } - fun executeProgram(stackFrame: StackFrame, program: LispAst.Program) { + fun executeProgram(stackFrame: StackFrame, program: LispAst.Program): LispData? { + var lastValue: LispData? = null for (node in program.nodes) { - executeLisp(stackFrame, node) + lastValue = executeLisp(stackFrame, node) } + return lastValue } |