aboutsummaryrefslogtreecommitdiff
path: root/lptree.c
diff options
context:
space:
mode:
Diffstat (limited to 'lptree.c')
-rw-r--r--lptree.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/lptree.c b/lptree.c
index 62acc5c..30cef67 100644
--- a/lptree.c
+++ b/lptree.c
@@ -1247,12 +1247,6 @@ static int lp_setmax (lua_State *L) {
1247} 1247}
1248 1248
1249 1249
1250static int lp_version (lua_State *L) {
1251 lua_pushstring(L, VERSION);
1252 return 1;
1253}
1254
1255
1256static int lp_type (lua_State *L) { 1250static int lp_type (lua_State *L) {
1257 if (testpattern(L, 1)) 1251 if (testpattern(L, 1))
1258 lua_pushliteral(L, "pattern"); 1252 lua_pushliteral(L, "pattern");
@@ -1323,7 +1317,7 @@ static struct luaL_Reg pattreg[] = {
1323 {"R", lp_range}, 1317 {"R", lp_range},
1324 {"utfR", lp_utfr}, 1318 {"utfR", lp_utfr},
1325 {"locale", lp_locale}, 1319 {"locale", lp_locale},
1326 {"version", lp_version}, 1320 {"version", NULL},
1327 {"setmaxstack", lp_setmax}, 1321 {"setmaxstack", lp_setmax},
1328 {"type", lp_type}, 1322 {"type", lp_type},
1329 {NULL, NULL} 1323 {NULL, NULL}
@@ -1352,6 +1346,8 @@ int luaopen_lpeg (lua_State *L) {
1352 luaL_newlib(L, pattreg); 1346 luaL_newlib(L, pattreg);
1353 lua_pushvalue(L, -1); 1347 lua_pushvalue(L, -1);
1354 lua_setfield(L, -3, "__index"); 1348 lua_setfield(L, -3, "__index");
1349 lua_pushliteral(L, "LPeg " VERSION);
1350 lua_setfield(L, -2, "version");
1355 return 1; 1351 return 1;
1356} 1352}
1357 1353