MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / luaopen_lpeg

Function luaopen_lpeg

other_src/lua/src/lpeg.cpp:2392–2404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2390
2391int luaopen_lpeg (lua_State *L);
2392int luaopen_lpeg (lua_State *L) {
2393 lua_pushcfunction(L, (lua_CFunction)&l_newpf); /* new-pattern function */
2394 lua_setfield(L, LUA_REGISTRYINDEX, KEYNEWPATT); /* register it */
2395 luaL_newmetatable(L, PATTERN_T);
2396 lua_pushnumber(L, MAXBACK);
2397 lua_setfield(L, LUA_REGISTRYINDEX, MAXSTACKIDX);
2398 luaL_register(L, NULL, metapattreg);
2399 luaL_register(L, "lpeg", pattreg);
2400 lua_pushliteral(L, "__index");
2401 lua_pushvalue(L, -2);
2402 lua_settable(L, -4);
2403 return 1;
2404}
2405

Callers

nothing calls this directly

Calls 5

lua_setfieldFunction · 0.70
luaL_newmetatableFunction · 0.70
lua_pushnumberFunction · 0.70
lua_pushvalueFunction · 0.70
lua_settableFunction · 0.70

Tested by

no test coverage detected