Moved compatibility to lib/ and fixed path searching for .peg files.

This commit is contained in:
Bruce Hill 2019-01-14 17:14:34 -08:00
parent 9fceff7e78
commit ddef8be3df
22 changed files with 4 additions and 4 deletions

View File

@ -50,7 +50,7 @@ optimize: lua $(LIB_LUA_FILES)
.PHONY: clean
clean:
@echo "\033[1mDeleting...\033[0m"
@rm -rvf version lib/*.lua lib/*/*.lua compatibility/*.lua
@rm -rvf version lib/*.lua lib/*/*.lua
.PHONY: install
install: lua version optimize
@ -78,7 +78,7 @@ install: lua version optimize
&& chmod +x $$prefix/bin/nomsu$$version \
&& cp -v nomsu $$prefix/bin \
&& cp -v doc/nomsu.1 $$prefix/share/man/man1 \
&& cp -rv $(LUA_FILES) $(PEG_FILES) lib compatibility $$prefix/share/nomsu/$$version;
&& cp -rv $(LUA_FILES) $(PEG_FILES) lib $$prefix/share/nomsu/$$version;
.PHONY: uninstall
uninstall: version

View File

@ -35,7 +35,7 @@ local max_parser_version = 0
for version = 1, 999 do
local peg_file
if package.nomsupath then
local pegpath = package.nomsupath:gsub("%.nom", ".peg")
local pegpath = package.nomsupath:gsub("lib/%?%.nom", "?.peg"):gsub("lib/%?%.lua", "?.peg")
do
local path = package.searchpath("nomsu." .. tostring(version), pegpath, "/")
if path then

View File

@ -20,7 +20,7 @@ max_parser_version = 0
for version=1,999
local peg_file
if package.nomsupath
pegpath = package.nomsupath\gsub("%.nom", ".peg")
pegpath = package.nomsupath\gsub("lib/%?%.nom", "?.peg")\gsub("lib/%?%.lua", "?.peg")
if path = package.searchpath("nomsu.#{version}", pegpath, "/")
peg_file = io.open(path)
else