Skip to content

Commit

Permalink
nit interpreter: check errors for -e and - (stdin)
Browse files Browse the repository at this point in the history
Signed-off-by: Jean Privat <[email protected]>
  • Loading branch information
privat committed Aug 19, 2024
1 parent 1b3cd85 commit 859e8d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nit.nit
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ var mmodules: Array[MModule]

if opt_eval.value then
var amodule = toolcontext.parse_module(progname)
toolcontext.check_errors

var parent = null
if opt_loop.value then
Expand All @@ -62,13 +61,14 @@ if opt_eval.value then
end

modelbuilder.load_rt_module(parent, amodule, "-")
toolcontext.check_errors

mmodules = [amodule.mmodule.as(not null)]
else if progname == "-" then
var content = stdin.read_all
var amodule = toolcontext.parse_module(content)
toolcontext.check_errors
modelbuilder.load_rt_module(null, amodule, "-")
toolcontext.check_errors
mmodules = [amodule.mmodule.as(not null)]
else
mmodules = modelbuilder.parse([progname])
Expand Down

0 comments on commit 859e8d2

Please sign in to comment.