Skip to content

Commit

Permalink
still tunning lpeg ref
Browse files Browse the repository at this point in the history
  • Loading branch information
pd3v committed Jul 15, 2024
1 parent ce92f25 commit 2d5ccd8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ class Parser {
std::ifstream input (parserFile.c_str());
textBuffer << input.rdbuf();
parserCode = textBuffer.str();

std::cout << "parserCode->" << parserCode << std::endl;
}
~Parser() {lua_close(L);};

Expand All @@ -152,7 +154,7 @@ class Parser {
"\" ;rs = table.concat(lpeg.match(rangeG,\"" + _phrase + "\"),\" \")";

if (int luaError = luaL_dostring(L, parseRange.c_str()) == LUA_OK) {
lua_getglobal(L,"rs");
lua_getglobal(L,"rs");

if (lua_isstring(L,-1))
_phrase = lua_tostring(L,-1);
Expand Down
2 changes: 1 addition & 1 deletion lineparser.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package.cpath = 'externals/?/lib?.dylib;externals/?/lib?.so;../lib/lib?.dylib;../lib/lib?.so;/usr/local/lib/lib?.dylib;/usr/local/lib/lib?.so' .. package.cpath
package.cpath = 'externals/?/lib?.dylib;externals/?/lib?.so;../lib/liblpeg.dylib;../lib/liblpeg.so;/usr/local/lib/lib?.dylib;/usr/local/lib/lib?.so' .. package.cpath

local lpeg = require 'lpeg'
local write = io.write
Expand Down

0 comments on commit 2d5ccd8

Please sign in to comment.