Bug 150559

Summary: Pattern matcher should support delegation
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal    
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 150279    

Filip Pizlo
Reported 2015-10-26 09:48:55 PDT
Currently, if you write two pattern matchers and you implement one by sometimes using the other as a helper, then the helper will return the first match that works for it regardless of what the outer matcher wants. For example, the outer matcher might want any address except for Index, and so it might want to use the address matcher but somehow tell it "please skip anything that produces Index". But this is currently hard. You'd have to manually set some state on the address matcher that tells it what kinds of things to filter out, and write code in the address matcher that applies the filter. It would be better if this was easier to do. For example, when you runAddressMatcher, you could provide a functor that filters the results of the address matcher. This could be made even better if matchers returned a value rather than void.
Attachments
Filip Pizlo
Comment 1 2015-11-11 10:49:12 PST
We got rid of the pattern matcher.
Note You need to log in before you can comment on or make changes to this bug.