aboutsummaryrefslogtreecommitdiff
path: root/nomsu.lua
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-09 16:40:36 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-09 16:41:19 -0800
commit69aaea030e08e083151aa25b8080eddd0d4c1683 (patch)
tree6cd90a65e6828f60cc052c4a1b33a4a4c0d65570 /nomsu.lua
parenta2f07415c5284bf94c146cea6eed4a15f171b9ab (diff)
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.
Diffstat (limited to 'nomsu.lua')
-rw-r--r--nomsu.lua6
1 files changed, 3 insertions, 3 deletions
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 = {