From 69aaea030e08e083151aa25b8080eddd0d4c1683 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 9 Nov 2018 16:40:36 -0800 Subject: No longer passing `tree` to every compile action. Now, you can just return a LuaCode object, and it will automatically get a source from `tree` if it didn't already have a source. Plus some fixes/cleanup. --- nomsu.moon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'nomsu.moon') diff --git a/nomsu.moon b/nomsu.moon index 8825ba5..35726e7 100755 --- a/nomsu.moon +++ b/nomsu.moon @@ -117,7 +117,7 @@ run = -> -- Check syntax code = Files.read(filename) source = Source(filename, 1, #code) - nomsu_environment._1_parsed(NomsuCode(source, code)) + nomsu_environment._1_parsed(NomsuCode\from(source, code)) print("Parse succeeded: #{filename}") elseif args.compile -- Compile .nom files into .lua @@ -125,7 +125,7 @@ run = -> else io.open(filename\gsub("%.nom$", ".lua"), "w") code = Files.read(filename) source = Source(filename, 1, #code) - code = NomsuCode(source, code) + code = NomsuCode\from(source, code) tree = nomsu_environment._1_parsed(code) tree = {tree} unless tree.type == 'FileChunks' for chunk in *tree @@ -139,7 +139,7 @@ run = -> elseif args.verbose code = Files.read(filename) source = Source(filename, 1, #code) - code = NomsuCode(source, code) + code = NomsuCode\from(source, code) tree = nomsu_environment._1_parsed(code) tree = {tree} unless tree.type == 'FileChunks' for chunk in *tree -- cgit v1.2.3