aboutsummaryrefslogtreecommitdiff
path: root/Lua
diff options
context:
space:
mode:
Diffstat (limited to 'Lua')
-rw-r--r--Lua/lbp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lua/lbp.c b/Lua/lbp.c
index a8b573e..7306c86 100644
--- a/Lua/lbp.c
+++ b/Lua/lbp.c
@@ -72,7 +72,11 @@ static void push_matchstring(lua_State *L, match_t *m)
static void set_capture_fields(lua_State *L, match_t *m, int *n, const char *start)
{
- if (m->pat->type == BP_CAPTURE) {
+ if (m->pat->type == BP_TAGGED) {
+ lua_pushlstring(L, m->pat->args.capture.name, m->pat->args.capture.namelen);
+ lua_setfield(L, -2, "__tag");
+ set_capture_fields(L, m->children[0], n, start);
+ } else if (m->pat->type == BP_CAPTURE) {
if (m->pat->args.capture.namelen > 0) {
lua_pushlstring(L, m->pat->args.capture.name, m->pat->args.capture.namelen);
push_match(L, m->children[0], start);