Bug 150559 - Pattern matcher should support delegation
Summary: Pattern matcher should support delegation
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 150279
  Show dependency treegraph
 
Reported: 2015-10-26 09:48 PDT by Filip Pizlo
Modified: 2015-11-11 10:49 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 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.
Comment 1 Filip Pizlo 2015-11-11 10:49:12 PST
We got rid of the pattern matcher.