diff options
| -rw-r--r-- | grammar.c | 2 | ||||
| -rw-r--r-- | types.h | 4 | ||||
| -rw-r--r-- | vm.c | 2 |
3 files changed, 5 insertions, 3 deletions
@@ -94,7 +94,7 @@ void push_backref(grammar_t *g, const char *name, match_t *capture) op->start = capture->start; op->end = capture->end; op->len = -1; // TODO: maybe calculate this? - op->args.backref = (void*)capture; + op->args.backref = capture; g->backrefs[i].op = op; } @@ -41,6 +41,8 @@ enum VMOpcode { VM_NODENT, }; +struct match_s; // forward declared to resolve circular struct defs + /* * A struct reperesenting a BP virtual machine operation */ @@ -71,7 +73,7 @@ typedef struct vm_op_s { struct vm_op_s *capture_pat; char *name; } capture; - void *backref; + struct match_s *backref; struct vm_op_s *pat; } args; } vm_op_t; @@ -458,7 +458,7 @@ static match_t *_match(grammar_t *g, file_t *f, const char *str, vm_op_t *op, un return m; } case VM_BACKREF: { - return match_backref(str, op, (match_t*)op->args.backref, flags); + return match_backref(str, op, op->args.backref, flags); } case VM_NODENT: { if (*str != '\n') return NULL; |
