diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-06-21 19:12:59 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-06-21 19:13:47 -0700 |
| commit | 86a3219e7fc3244331595819f742b365172f96ad (patch) | |
| tree | 948a3f308bd9c45b85efa2e130af8432bb1a97e2 /parser.lua | |
| parent | 7761f715f7497e8b325a4f1134869f332848fd16 (diff) | |
Cleanup of some metaprogramming stuff, as well as adding support for
"package.nomsupath" to search for files in different locations, and
prioritizing use of "luafilesystem" over system calls.
Diffstat (limited to 'parser.lua')
| -rw-r--r-- | parser.lua | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -127,7 +127,7 @@ do ident <- [a-zA-Z_][a-zA-Z0-9_]* comment <- "--" [^%nl]* ]]) - local nomsu_peg = peg_tidier:match(io.open("nomsu.peg"):read('*a')) + local nomsu_peg = peg_tidier:match(io.open((package.nomsupath or '.') .. "/nomsu.peg"):read('*a')) NOMSU_PATTERN = re.compile(nomsu_peg, NOMSU_DEFS) end local parse @@ -162,8 +162,7 @@ parse = function(nomsu_code, source) end errors = _accum_0 end - io.stderr:write("Errors occurred while parsing:\n\n", table.concat(errors, "\n\n"), '\n') - os.exit(1) + error("Errors occurred while parsing:\n\n" .. table.concat(errors, "\n\n"), 0) end return tree end |
