summaryrefslogtreecommitdiff
path: root/parse-pattern.y
diff options
context:
space:
mode:
authorBobby Bingham <koorogi@koorogi.info>2017-07-25 21:08:44 -0500
committerBobby Bingham <koorogi@koorogi.info>2017-07-25 21:09:45 -0500
commit0e96b8551b5293ffeadfebc31b85a165b0a74b99 (patch)
tree1057a6bc62f64b9172d3d73a2d4a6cf422cc2f7e /parse-pattern.y
parentee78102672afdede839489fa0b1932b64335eaaf (diff)
create general regex simplification passHEADmaster
Move the previous special-case logic for removing 1-1 repeats into this pass.
Diffstat (limited to 'parse-pattern.y')
-rw-r--r--parse-pattern.y8
1 files changed, 1 insertions, 7 deletions
diff --git a/parse-pattern.y b/parse-pattern.y
index 2c0556a..e5acd3c 100644
--- a/parse-pattern.y
+++ b/parse-pattern.y
@@ -62,13 +62,7 @@ input:
;
molecule:
- repeat sequence {
- if ($1.min == 1 && $1.max == 1) {
- $$ = $2;
- } else {
- $$ = mkatom(&(struct atom) { .type = ATOM_REPETITION, .u = { .repeat = { .counts = $1, .child = $2 } } });
- }
- }
+ repeat sequence { $$ = mkatom(&(struct atom) { .type = ATOM_REPETITION, .u = { .repeat = { .counts = $1, .child = $2 } } }); }
;
repeat: