Skip to content

Commit ea1f4f3

Browse files
committed
Always store return value of AST node
1 parent 12c6a78 commit ea1f4f3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

monic/expressions/interpreter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,9 @@ def execute(self, tree: ast.AST) -> t.Any:
251251
result = self.visit(stmt.value)
252252
self.global_env["_"] = result
253253
else:
254-
# For other statements, just execute them
255-
self.visit(stmt)
254+
# For other statements, execute them and possibly
255+
# return the result
256+
result = self.visit(stmt)
256257
return result
257258
else:
258259
result = self.visit(tree)

0 commit comments

Comments
 (0)