From 06b1a795bb10dd8ed9c2f406ca3b906917e1a106 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 17 Dec 2020 19:49:56 -0800 Subject: Better null byte handling, simplified match datastructures, and some misc. cleanup --- types.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'types.h') diff --git a/types.h b/types.h index aa61c38..38c14bb 100644 --- a/types.h +++ b/types.h @@ -63,8 +63,9 @@ typedef struct vm_op_s { struct vm_op_s *first, *second; } multiple; struct { - struct vm_op_s *replace_pat; - const char *replacement; + struct vm_op_s *pat; + const char *text; + size_t len; } replace; struct { struct vm_op_s *capture_pat; @@ -81,10 +82,6 @@ typedef struct vm_op_s { typedef struct match_s { // Where the match starts and ends (end is after the last character) const char *start, *end; - union { - const char *name; - const char *replacement; - } value; struct match_s *child, *nextsibling; vm_op_t *op; } match_t; -- cgit v1.2.3