diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-09-21 00:26:36 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-09-21 00:27:14 -0700 |
| commit | acd9c2acd4688f2301b091daad910c04e402bd6a (patch) | |
| tree | 411ac06c722b60fb8584b0eef13579c1dd4967a2 /nomsu_compiler.moon | |
| parent | d11f9bc5d3971a68dd78cdaca0b046a40a329000 (diff) | |
Fixed breaking bug with compiler not finding the peg file when running the installed version because it
wasn't looking in the full nomsupath.
Diffstat (limited to 'nomsu_compiler.moon')
| -rw-r--r-- | nomsu_compiler.moon | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/nomsu_compiler.moon b/nomsu_compiler.moon index 19d4049..f5cc7d2 100644 --- a/nomsu_compiler.moon +++ b/nomsu_compiler.moon @@ -79,10 +79,13 @@ make_tree = (tree, userdata)-> Parsers = {} max_parser_version = 0 for version=1,999 - if peg_contents = Files.read("nomsu.#{version}.peg") - max_parser_version = version - Parsers[version] = make_parser(peg_contents, make_tree) - else break + found_version = false + for _, full_path in Files.walk("nomsu.#{version}.peg") + if peg_contents = Files.read(full_path) + found_version = true + max_parser_version = version + Parsers[version] = make_parser(peg_contents, make_tree) + break unless found_version MAX_LINE = 80 -- For beautification purposes, try not to make lines much longer than this value NomsuCompiler = setmetatable {}, {__tostring: => "Nomsu"} |
