diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2022-04-30 15:23:02 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2022-04-30 15:23:02 -0400 |
| commit | 206e1fa68fb921d0fd8c9d31ec59a9b7d0fc2a5d (patch) | |
| tree | 916e508c47a30ed69c6e904479e642d12ec4d080 /Lua/lbp.c | |
| parent | 24ed834317f3fda8f0f55489f54a2df1aca5de17 (diff) | |
Added tagged definitions: `foo:: blah`
Diffstat (limited to 'Lua/lbp.c')
| -rw-r--r-- | Lua/lbp.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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); |
