From 0e96b8551b5293ffeadfebc31b85a165b0a74b99 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Tue, 25 Jul 2017 21:08:44 -0500 Subject: create general regex simplification pass Move the previous special-case logic for removing 1-1 repeats into this pass. --- ast.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ast.h') diff --git a/ast.h b/ast.h index f8183f9..dac6e8a 100644 --- a/ast.h +++ b/ast.h @@ -28,7 +28,7 @@ struct atom { struct repeat counts; struct atom *child; } repeat; - const struct atom *children[2]; + struct atom *children[2]; const char *literal; } u; }; @@ -38,6 +38,8 @@ void dump_atom(const struct atom *a); void print_regex(const struct atom *a); +void simplify(struct atom *a); + extern struct atom *ast; #endif -- cgit v1.2.3