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

Split code generation out of the parser. #51

Closed
4 tasks
ballercat opened this issue Dec 27, 2017 · 0 comments
Closed
4 tasks

Split code generation out of the parser. #51

ballercat opened this issue Dec 27, 2017 · 0 comments

Comments

@ballercat
Copy link
Owner

Goal

Unblock #49

Overview

There are a few parts of the parser which envoke the generator directly. This is OK, but it's making it difficult to implement a few things. There aren't a ton of areas of code where this happens, but they should all be cleaned up. In the very early days, the generator was baked into the parser and everything(parsing + generation) happened in one pass, it still kind of does. We should fix it.

Here is a search which should point out all the problem areas

https://github.com/search?utf8=%E2%9C%93&q=generate++user%3Aballercat+repo%3Aballercat%2Fwalt+path%3Asrc%2Fparser+language%3AJavaScript&type=Code&ref=advsearch&l=JavaScript&l=

Problem areas

This change should be rather easy to make, but there might be a few issues.

  • Function types are generated and referenced in this manner. Not generating function types on the fly will likely break a few things. Something to watch out for.

Acceptance Criteria

  • Move all generator calls out of the parser
  • Have parser spit out the AST ONLY
  • Have generator walk the AST and spit out IR
  • Make sure tests pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant