-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve pattern matching #21
Comments
Should we introduce the category of overlapping and non-overlapping matches (comparable to contained and non-contained matches)? I think it is relevant for replacements: I don't think we can find an acceptable definition for replacing overlapping matches! If so, can we check it locally (at a list) or do we need to check it globally? |
How many matches should be found when searching with the pattern
|
Where single placeholders just claim a place /AST node in the list of AST nodes, matching So we could use standard |
Maybe we should do something special for the head and tail elements when the pattern contains actual AST nodes there: |
Done in latest release |
Only done for C/C++ version - So need to keep it open for the Ada version. |
The current implementation of match pattern fails in some cases.
This is however not needed.
($M_X, $M_X) fails on (1,2,3,1,2,3)
($M_X, 1,1, $M_Y) fails on (1,2,1,1,3,4)
($M_X, $S_Y, $S_Z) fails on (1,2,3)
Note we should not backtrack with
($M_Args) on (1,2,3,4,5,6), just match on length: $M_Args has length of 6!
Note: ($M_X, 1,1, $M_Y) on (1,1,2,1,1,3,4) has 2 solutions:
not only pattern but also instance determines number of matches
Solution
Point of attention (ignore patterns - present in C++ version)
The text was updated successfully, but these errors were encountered: