diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-11-17 14:38:05 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-11-17 14:39:08 -0800 |
| commit | 7f47d4204039258cec78c767f489b7809b4257ff (patch) | |
| tree | c8533068b75ab453accfe1f688705e9e94c9e279 /nomsu.moon | |
| parent | 34a3dd22a4e132bd4e0fe3ce89831c3fe761d3d9 (diff) | |
In-progress (but working) overhaul of some elements including: function
calls, lib/thing.nom API, multi-assignments, varargs, etc.
Diffstat (limited to 'nomsu.moon')
| -rwxr-xr-x | nomsu.moon | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -131,10 +131,10 @@ run = -> for chunk_no, chunk in ipairs tree lua = nomsu_environment.compile(chunk) lua\declare_locals! + lua\prepend((chunk_no > 1) and '\n' or '', "-- File #{filename} chunk ##{chunk_no}\n") + if args.verbose then print(lua\text!) nomsu_environment.run_1_in(chunk, nomsu_environment) - output\write((chunk_no > 1) and '\n' or '', "-- File #{filename} chunk ##{chunk_no}\n") - output\write(tostring(lua), "\n") - if args.verbose then print(tostring(lua)) + output\write(lua\text!, "\n") print ("Compiled %-25s -> %s")\format(filename, filename\gsub("%.nom$", ".lua")) output\close! elseif args.verbose @@ -143,11 +143,12 @@ run = -> code = NomsuCode\from(source, code) tree = nomsu_environment._1_parsed(code) tree = {tree} unless tree.type == 'FileChunks' - for chunk in *tree + for chunk_no, chunk in ipairs tree lua = nomsu_environment.compile(chunk) lua\declare_locals! - nomsu_environment.run_1_in(chunk, nomsu_environment) - print(tostring(lua)) + lua\prepend((chunk_no > 1) and '\n' or '', "-- File #{filename} chunk ##{chunk_no}\n") + print(lua\text!) + nomsu_environment.run_1_in(lua, nomsu_environment) else -- Just run the file nomsu_environment.run_file_1_in(filename, nomsu_environment, 0) |
