aboutsummaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2020-12-17 19:49:56 -0800
committerBruce Hill <bruce@bruce-hill.com>2020-12-17 19:49:56 -0800
commit06b1a795bb10dd8ed9c2f406ca3b906917e1a106 (patch)
tree09731a1b5009c68f3a19cfe89ee7f03d4c786d9c /types.h
parentb37359b4503d447457646e8f8e01810b6525bd56 (diff)
Better null byte handling, simplified match datastructures, and some
misc. cleanup
Diffstat (limited to 'types.h')
-rw-r--r--types.h9
1 files changed, 3 insertions, 6 deletions
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;