| 1156 | |
| 1157 | |
| 1158 | static int testpattern (lua_State *L, int idx) { |
| 1159 | if (lua_touserdata(L, idx)) { /* value is a userdata? */ |
| 1160 | if (lua_getmetatable(L, idx)) { /* does it have a metatable? */ |
| 1161 | luaL_getmetatable(L, PATTERN_T); |
| 1162 | if (lua_rawequal(L, -1, -2)) { /* does it have the correct mt? */ |
| 1163 | lua_pop(L, 2); /* remove both metatables */ |
| 1164 | return 1; |
| 1165 | } |
| 1166 | } |
| 1167 | } |
| 1168 | return 0; |
| 1169 | } |
| 1170 | |
| 1171 | |
| 1172 | static Instruction *fix_l (lua_State *L, int t) { |
no test coverage detected