Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions asteroid/repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from asteroid.version import VERSION
from asteroid.state import state
from asteroid.globals import ExpectationError
from asteroid.walk import function_return_value

from sys import stdin
import readline
Expand Down Expand Up @@ -66,6 +67,15 @@ def run_repl():
# Try to
line = ""

# Check for return value
if function_return_value[-1]:
# Get the last return value (type, value)
(_, val) = function_return_value[-1]

# If it isn't none, print out the value
if val is not None:
print(val)

except ExpectationError as e:
# If we expected something but found EOF, it's a continue
if e.found_EOF:
Expand Down