diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-06-23 17:22:23 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-06-23 17:22:43 -0700 |
| commit | 863983202ce4ef92d9e3a296a682535d157c245d (patch) | |
| tree | 288411a534c8a64542ce1b101b9532cb12f11c7d /parser.lua | |
| parent | 0d888db6324ecd879ba770880173255b6c3f7ae5 (diff) | |
Fixed up nomsupath behavior and refactored file stuff into its own file.
Diffstat (limited to 'parser.lua')
| -rw-r--r-- | parser.lua | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -132,7 +132,15 @@ do Parser.version = tonumber(v) end }) - local peg_file = io.open("nomsu.peg") or (package.nomsupath and io.open(package.nomsupath .. "/nomsu.peg")) + local peg_file = io.open("nomsu.peg") + if not peg_file and package.nomsupath then + for path in package.nomsupath:gmatch("[^;]+") do + peg_file = io.open(path .. "/nomsu.peg") + if peg_file then + break + end + end + end assert(peg_file, "could not find nomsu.peg file") local nomsu_peg = peg_tidier:match(peg_file:read('*a')) peg_file:close() |
