-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for "ignorable" name matches.
One irritation with fm is that if you need to match (potentially or definitely) different literal text in a pattern, you need to generate fresh pattern names for each match point, even though you're not comparing the contents of these names. For example, if you want to match against the text "a b" you might use a pattern `$1 $2` (note: `$1 $1` would not match). This commit adds support for "ignorable" name matches, which match against literal text, but ignore what the contents are. For example, if you add `$_` as the ignorable pattern matching literal text then you can match against `a b` with `$_ $_`. I'm not sure if `name_matcher_ignore` is the best name for the relevant configuration function, but at the very least it shows what this functionality can do, and that it's relatively easy to add in.
- Loading branch information
Showing
2 changed files
with
105 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters