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.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'nomsu.lua') diff --git a/nomsu.lua b/nomsu.lua index 82c0d02..9010227 100644 --- a/nomsu.lua +++ b/nomsu.lua @@ -181,7 +181,7 @@ run = function() if args.check_syntax then local code = Files.read(filename) local source = Source(filename, 1, #code) - nomsu_environment._1_parsed(NomsuCode(source, code)) + nomsu_environment._1_parsed(NomsuCode:from(source, code)) print("Parse succeeded: " .. tostring(filename)) elseif args.compile then local output @@ -192,7 +192,7 @@ run = function() end local code = Files.read(filename) local source = Source(filename, 1, #code) - code = NomsuCode(source, code) + code = NomsuCode:from(source, code) local tree = nomsu_environment._1_parsed(code) if not (tree.type == 'FileChunks') then tree = { @@ -214,7 +214,7 @@ run = function() elseif args.verbose then local code = Files.read(filename) local source = Source(filename, 1, #code) - code = NomsuCode(source, code) + code = NomsuCode:from(source, code) local tree = nomsu_environment._1_parsed(code) if not (tree.type == 'FileChunks') then tree = { -- cgit v1.2.3