Skip to content

Commit

Permalink
Fix exponential time behaviour when constructing Alt (#106)
Browse files Browse the repository at this point in the history
Fixes #97 by removing a duplicate evaluation

Signed-off-by: Fangyi Zhou <[email protected]>
  • Loading branch information
fangyi-zhou authored Dec 3, 2021
1 parent 268c553 commit 60f476a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/syntax/sedlex.ml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ let alt r1 r2 succ =
| Some c1, Some c2 -> chars (Cset.union c1 c2) succ
| _ ->
let n = new_node () in
n.eps <- [r1 succ; r2 succ];
n.eps <- [nr1; nr2];
n

let rep r succ =
Expand Down

0 comments on commit 60f476a

Please sign in to comment.