Skip to content

Commit 60f476a

Browse files
authored
Fix exponential time behaviour when constructing Alt (#106)
Fixes #97 by removing a duplicate evaluation Signed-off-by: Fangyi Zhou <fangyi.zhou15@imperial.ac.uk>
1 parent 268c553 commit 60f476a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/syntax/sedlex.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ let alt r1 r2 succ =
3838
| Some c1, Some c2 -> chars (Cset.union c1 c2) succ
3939
| _ ->
4040
let n = new_node () in
41-
n.eps <- [r1 succ; r2 succ];
41+
n.eps <- [nr1; nr2];
4242
n
4343

4444
let rep r succ =

0 commit comments

Comments
 (0)