aboutsummaryrefslogtreecommitdiff
path: root/nomsu.moon
diff options
context:
space:
mode:
Diffstat (limited to 'nomsu.moon')
-rwxr-xr-xnomsu.moon2
1 files changed, 2 insertions, 0 deletions
diff --git a/nomsu.moon b/nomsu.moon
index fc2fe5a..a55ace4 100755
--- a/nomsu.moon
+++ b/nomsu.moon
@@ -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)