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

AST printer? #15

Open
liamcurry opened this issue Nov 11, 2016 · 2 comments
Open

AST printer? #15

liamcurry opened this issue Nov 11, 2016 · 2 comments

Comments

@liamcurry
Copy link

Thanks for writing this! I think this will be very useful for an idea I have for converting GraphQL schemas to Elm code. However one key thing that seems to be missing is an AST printer. Is that planned? If not I can try to come up with something.

@Bogdanp
Copy link
Owner

Bogdanp commented Nov 11, 2016

What do you mean when you say AST printer? A pretty printer? If so, something like that isn't planned and it would be a welcome contribution, but I'd urge you to wait until after Elm 0.18 comes out as I'm likely going to make some significant changes to support positional information in the AST after it does.

@liamcurry
Copy link
Author

Basically a function that would take in any Elm AST record and output a string of Elm code. An AST by itself is good for introspection, but a printer is needed to make building/modifying ASTs useful. Some things that would be possible with an Elm AST parser + printer:

  • Rewriting elm-format in Elm (@avh4, thoughts?)
  • Converting a GraphQL introspection query into Elm code

supermario pushed a commit to supermario/elm-ast that referenced this issue Jul 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants