Expand description
Converts a flat collection of matches into a nested form suitable for replacement. When there are multiple matches for a node, or that overlap, priority is given to the earlier rule. Nested matches are only permitted if the inner match is contained entirely within a placeholder of an outer match.
For example, if our search pattern is foo(foo($a)) and the code had foo(foo(foo(foo(42)))),
then weโll get 3 matches, however only the outermost and innermost matches can be accepted. The
middle match would take the second foo from the outer match.
Structsยง
- Match
Collector ๐
Functionsยง
- nest_
and_ ๐remove_ collisions - try_
add_ ๐sub_ match - Attempts to add
mas a sub-match ofexisting.