-
Notifications
You must be signed in to change notification settings - Fork 35
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
Replace our ad hoc parser with PPI #11
Comments
The trick here, as I see it, is to figure out how to pass information between Method::Signatures::Parser::split_proto, which splits the signature into prototypes, and parse_func, which splits each prototype into its individual components. split_proto already uses PPI, but parse_func does not. So either parse_func has to use PPI on the same stuff that's already been PPI-parsed once (inefficient), or split_proto has to return something a hell of a lot more complex than an array of prototypes. |
I suspect the real answer is to have a real object representing a signature while parsing. Then methods can store and modify things on the object rather than pass them around. |
I think this may be address by version 20121201. Is there more to do here? |
I'm going to close this. If there's specific bits which don't use PPI we want to address we can do that in a new issue. |
Our ad hoc parser only works as long as there's nothing balanced we need to parse. Defaults need balanced parsing, so they use PPI.
where
needs parsing, too.We already run everything through PPI once to split the list of prototypes (to account for complicated defaults), and we'll need to do it again to differentiate
where
from defaults.So we might as well do it all in PPI.
This will use PPI to tokenize the structure and then we walk it. Hopefully PPI will tokenize the signature without modification, but we might have to make a subclass. @barefootcoder has been looking into it. We've been talking about it in email, but here is better so @chipdude can chime in.
The text was updated successfully, but these errors were encountered: