diff options
| -rw-r--r-- | nomsu.lua | 3 | ||||
| -rwxr-xr-x | nomsu.moon | 2 |
2 files changed, 5 insertions, 0 deletions
@@ -173,6 +173,9 @@ run = function() nomsu_environment._1_parsed(NomsuCode:from(source, code)) print("Parse succeeded: " .. tostring(filename)) elseif args.compile then + if filename:match("%.lua$") then + error("Cannot compile a lua file (expected a nomsu file as input)") + end local output if filename == 'stdin' then output = io.output() @@ -142,6 +142,8 @@ run = -> print("Parse succeeded: #{filename}") elseif args.compile -- Compile .nom files into .lua + if filename\match("%.lua$") + error("Cannot compile a lua file (expected a nomsu file as input)") output = if filename == 'stdin' then io.output() else io.open(filename\gsub("%.nom$", ".lua"), "w") code = Files.read(filename) |
