{ "name": "lpeg", "version": "1.1.0", "summary": "LPeg: parsing expression grammars for Lua, as a library to link (Neovim) and as LuaJIT's module lpeg with re.lua", "category": "library", "license": "MIT", "homepage": "https://www.inf.puc-rio.br/~roberto/lpeg/", "source": { "url": "https://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.1.0.tar.gz", "sha256": "4b155d67d2246c1ffa7ad7bc466c1ea899bbc40fef0257cc9c03cecbaed4352a" }, "watch": {"kind": "index", "url": "https://www.inf.puc-rio.br/~roberto/lpeg/", "regex": "lpeg-([0-9]+(?:\\.[0-9]+)+)\\.tar\\.gz"}, "deps": [ "luajit" ], "env_packages": [], "static": true, "nss": false, "check": "LDFLAGS=\"$LDFLAGS -llpeg\" check_lib luajit 'lua.h lauxlib.h lualib.h' 'extern int luaopen_lpeg(lua_State *); lua_State *L = luaL_newstate(); luaL_openlibs(L); luaopen_lpeg(L); lua_setglobal(L, \"lpeg\"); if (luaL_dostring(L, \"local C, P, R, Ct = lpeg.C, lpeg.P, lpeg.R, lpeg.Ct local num = C(R(\\\"09\\\") ^ 1) local list = Ct(num * (P(\\\",\\\") * num) ^ 0) local t = list:match(\\\"10,200,3\\\") return #t .. \\\" \\\" .. t[2] .. \\\" \\\" .. lpeg.version\")) { fprintf(stderr, \"%s\\n\", lua_tostring(L, -1)); return 1; } const char *r = lua_tostring(L, -1); printf(\"lpeg linked into a LuaJIT program: a list grammar split 10,200,3 into (count, second, version) %s\\n\", r); return strcmp(r, \"3 200 LPeg 1.1.0\")' && if [ \"$STATIC\" != 1 ]; then bin/luajit -e \"package.cpath = '$PREFIX/lib/lua/5.1/?.so' package.path = '$PREFIX/share/lua/5.1/?.lua' local re = require('re') local p = re.compile([[ kv <- {| (pair (',' pair)*)? |} pair <- {| {:k: [a-z]+ :} '=' {:v: [0-9]+ :} |} ]]) local t = p:match('cpu=4,ram=8') io.write('lpeg module and re.lua: ', t[2].k, '=', t[2].v, '\\\\n')\" | has 'ram=8'; fi" }