Crate tree_pattern_match

Source

Structs§

Match
Similar to regex match. A match can have multiple captures.
Placeholder
Placeholder for capturing. Currently supports single item (__, like ? in glob) and mult-item (___, like * in glob), with g to indicate matching trees (groups). Might be extended (like, adding fields of custom functions) to support more complex matches (ex. look ahead, balanced brackets, limited tokens, etc).

Enums§

Item
Minimal abstraction for tree-like.

Traits§

PlaceholderExt
Replace
Takes a single match and output its replacement.

Functions§

find_all
Find matches. Similar to Python re.findall but is tree aware.
matches_full
Find a match align with items.
matches_start
Find a match align with the start of items. Similar to Python re.match.
replace_all
Replace matches. Similar to Python re.sub but is tree aware.