Skip to content

Missing closing parenthesis deletes code #91

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

Closed
i-am-the-slime opened this issue Apr 4, 2022 · 7 comments · Fixed by #92
Closed

Missing closing parenthesis deletes code #91

i-am-the-slime opened this issue Apr 4, 2022 · 7 comments · Fixed by #92

Comments

@i-am-the-slime
Copy link
Contributor

i-am-the-slime commented Apr 4, 2022

I can't quite tell what the real issue is but I just had tidy delete a good chunk of code. The version is 0.7.1.
Funnily enough it used unsafeCoerce and tidy seemed to take this quite literally:

Here is a small Repro:

Input:

module Example where

delete me =
  unsafeCoerce (f
    (a lotta code is actually here
    )

Output:

module Example where

delete me =
  unsafeCoerce
@JordanMartinez
Copy link
Contributor

Which version of purs-tidy are you on?

@thomashoneyman
Copy link
Collaborator

The report says it's 0.7.1, which is currently the latest version.

@JordanMartinez
Copy link
Contributor

Oh, sorry, I missed that part.

@natefaubion
Copy link
Owner

natefaubion commented Apr 4, 2022

@mikesol experienced this as well, but didn’t have a repro I could test. When I tested the simple missing paren case, it correctly failed with an error. Are you able to repro? Or rather is your example a true repro or just a summary of what you did?

@natefaubion
Copy link
Owner

Now that I'm able to test, the repro does indeed work. Thanks! I suspect something is up in the parser.

@natefaubion
Copy link
Owner

This is fixed in 0.7.2

@natefaubion
Copy link
Owner

The exact issue was an error in the implementation of many which propagated the wrong parser state in the case of a failure. This particular case was showing up in the call to many for expression applications. Parens and applications are a common case, but it could show up with any parse failure in any call to many.

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

Successfully merging a pull request may close this issue.

4 participants