Fix for REPL not getting launched when nomsu -I lib
is run.
This commit is contained in:
parent
fba035595d
commit
54906c0553
@ -98,11 +98,12 @@ if not arg or debug.getinfo(2).func == require then
|
||||
end
|
||||
local file_queue = { }
|
||||
local sep = "\0"
|
||||
local parser = re.compile([[ args <- {| (flag %sep)* (({~ file ~} -> add_file) %sep)? {:nomsu_args: {| ({(!%sep .)*} %sep)* |} :} %sep? |} !.
|
||||
local parser = re.compile([[ args <- {| (flag %sep)* (({~ file ~} -> add_file) {:primary_file: '' -> true :} %sep)?
|
||||
{:nomsu_args: {| ({(!%sep .)*} %sep)* |} :} %sep? |} !.
|
||||
flag <-
|
||||
{:optimization: "-O" (%sep? (([0-9]+) -> tonumber))? :}
|
||||
/ ("-I" %sep? ({~ file ~} -> add_file))
|
||||
/ ("-e" %sep? (({} {~ file ~}) -> add_exec_string))
|
||||
/ ("-e" %sep? (({} {~ file ~}) -> add_exec_string) {:exec_strings: '' -> true :})
|
||||
/ ({:check_syntax: ("-s" -> true):})
|
||||
/ ({:compile: ("-c" -> true):})
|
||||
/ ({:compile: ("-c" -> true):})
|
||||
@ -283,7 +284,7 @@ run = function()
|
||||
end
|
||||
end
|
||||
end
|
||||
if #file_queue == 0 then
|
||||
if not (args.primary_file or args.exec_strings) then
|
||||
nomsu:run([[#!/usr/bin/env nomsu -V2
|
||||
use "lib/consolecolor.nom"
|
||||
action [quit, exit]: lua> "os.exit(0)"
|
||||
|
@ -57,11 +57,12 @@ if not arg or debug.getinfo(2).func == require
|
||||
file_queue = {}
|
||||
sep = "\0"
|
||||
parser = re.compile([[
|
||||
args <- {| (flag %sep)* (({~ file ~} -> add_file) %sep)? {:nomsu_args: {| ({(!%sep .)*} %sep)* |} :} %sep? |} !.
|
||||
args <- {| (flag %sep)* (({~ file ~} -> add_file) {:primary_file: '' -> true :} %sep)?
|
||||
{:nomsu_args: {| ({(!%sep .)*} %sep)* |} :} %sep? |} !.
|
||||
flag <-
|
||||
{:optimization: "-O" (%sep? (([0-9]+) -> tonumber))? :}
|
||||
/ ("-I" %sep? ({~ file ~} -> add_file))
|
||||
/ ("-e" %sep? (({} {~ file ~}) -> add_exec_string))
|
||||
/ ("-e" %sep? (({} {~ file ~}) -> add_exec_string) {:exec_strings: '' -> true :})
|
||||
/ ({:check_syntax: ("-s" -> true):})
|
||||
/ ({:compile: ("-c" -> true):})
|
||||
/ ({:compile: ("-c" -> true):})
|
||||
@ -181,7 +182,7 @@ run = ->
|
||||
-- Just run the file
|
||||
run_file filename, (args.verbose and print or nil)
|
||||
|
||||
if #file_queue == 0
|
||||
unless args.primary_file or args.exec_strings
|
||||
-- Run in interactive mode (REPL)
|
||||
nomsu\run [[
|
||||
#!/usr/bin/env nomsu -V2
|
||||
|
Loading…
Reference in New Issue
Block a user