aboutsummaryrefslogtreecommitdiff
path: root/parser.moon
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-06-22 02:40:11 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-06-22 02:41:08 -0700
commit126678f737497d36126665b4661c17588c6d58d8 (patch)
tree0a2b877920ef23800e89b1906d061d314a8d3ca4 /parser.moon
parent86a3219e7fc3244331595819f742b365172f96ad (diff)
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.
Diffstat (limited to 'parser.moon')
-rw-r--r--parser.moon5
1 files changed, 4 insertions, 1 deletions
diff --git a/parser.moon b/parser.moon
index 51538cc..1d62364 100644
--- a/parser.moon
+++ b/parser.moon
@@ -98,7 +98,10 @@ NOMSU_PATTERN = do
ident <- [a-zA-Z_][a-zA-Z0-9_]*
comment <- "--" [^%nl]*
]]
- nomsu_peg = peg_tidier\match(io.open((package.nomsupath or '.').."/nomsu.peg")\read('*a'))
+ 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")
+ nomsu_peg = peg_tidier\match(peg_file\read('*a'))
+ peg_file\close!
re.compile(nomsu_peg, NOMSU_DEFS)
parse = (nomsu_code, source=nil)->