Skip to content
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

Closed
schwern opened this issue Apr 6, 2011 · 4 comments
Closed

Replace our ad hoc parser with PPI #11

schwern opened this issue Apr 6, 2011 · 4 comments
Labels

Comments

@schwern
Copy link
Contributor

schwern commented Apr 6, 2011

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.

@barefootcoder
Copy link
Contributor

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.

@schwern
Copy link
Contributor Author

schwern commented Jul 3, 2011

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.

@barefootcoder
Copy link
Contributor

I think this may be address by version 20121201. Is there more to do here?

@schwern
Copy link
Contributor Author

schwern commented Mar 26, 2014

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.

@schwern schwern closed this as completed Mar 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants