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

A single comment at the end of a block that has a single item prints strangely. #1781

Open
jordwalke opened this issue Jan 25, 2018 · 0 comments
Labels
KIND: FEATURE REQUEST Printer things that have to do with turning an AST into Reason code

Comments

@jordwalke
Copy link
Member

jordwalke commented Jan 25, 2018

This is a very specific case that our printer doesn't handle well right now.

for (i in 0 to 1) {
  print_newline();
  /* comment */
}

It prints to something like:

for (i in 0 to 1) {
  print_newline();
            /* comment */
}

The reason is that there isn't enough location information retained.
This seems like a small fix, but it's a little more involved than you'd expect. Probably best to tackle this one after swapping out the formatting library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
KIND: FEATURE REQUEST Printer things that have to do with turning an AST into Reason code
Projects
None yet
Development

No branches or pull requests

2 participants