Skip to content

Commit 610f2a3

Browse files
committed
Note why fsm_union_repeated_pattern_group depends on re_comp.
This may not be necessary in the future, but currently analyze_group_nfa in union.c depends on knowing that re_comp will always assign the true unanchored start loop an earlier state ID than the unanchored end loop in order to properly link a few ambiguous cases.
1 parent 255e426 commit 610f2a3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

include/fsm/bool.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,11 @@ fsm_union_array(size_t fsm_count,
5757
* eager outputs can match. Ownership of the NFAs is transferred, they will
5858
* be combined (or freed, if they don't have a start state).
5959
*
60-
* This MUST be called with NFAs constructed via re_comp, Calling it with
61-
* manually constructed NFAs or DFAs is unsupported.
60+
* This MUST be called with NFAs constructed via re_comp, Calling it
61+
* with manually constructed NFAs or DFAs may lead to incorrect loop
62+
* linking, because in a few ambiguous cases (e.g. `$|^`) it relies on
63+
* internal details of re_comp's normal construction to correctly
64+
* identify the state representing the unanchored start loop.
6265
*
6366
* This will set end IDs and/or output IDs representing matching each
6467
* of the original NFAs on the combined result, where nfas[i] will

0 commit comments

Comments
 (0)