From 126678f737497d36126665b4661c17588c6d58d8 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 22 Jun 2018 02:40:11 -0700 Subject: Adding fancy makefile that compiles all the moonscript files and precompiles all the nomsu files and can build a nice executable file and install it wherever you like. --- parser.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'parser.lua') diff --git a/parser.lua b/parser.lua index e685d56..7b734c3 100644 --- a/parser.lua +++ b/parser.lua @@ -127,7 +127,10 @@ do ident <- [a-zA-Z_][a-zA-Z0-9_]* comment <- "--" [^%nl]* ]]) - local nomsu_peg = peg_tidier:match(io.open((package.nomsupath or '.') .. "/nomsu.peg"):read('*a')) + local peg_file = io.open("nomsu.peg") or (package.nomsupath and io.open(package.nomsupath .. "/nomsu.peg")) + assert(peg_file, "could not find nomsu.peg file") + local nomsu_peg = peg_tidier:match(peg_file:read('*a')) + peg_file:close() NOMSU_PATTERN = re.compile(nomsu_peg, NOMSU_DEFS) end local parse -- cgit v1.2.3