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

Add validation for with nodes to match if, while, assert #1224

Open
sirosen opened this issue Oct 11, 2024 · 0 comments
Open

Add validation for with nodes to match if, while, assert #1224

sirosen opened this issue Oct 11, 2024 · 0 comments

Comments

@sirosen
Copy link

sirosen commented Oct 11, 2024

I believe that after v1.5.0 , with nodes are the only case of a keyword followed by an expression with

  • optional space after the keyword
  • missing validation that some non-empty whitespace is present on non-parenthesized expressions

I have some codepaths in my fixer for removing extra parens.
I found that after 1.5.0, if(x()) fixing failed because it removes the parens first, then adds the space. It generates ifx() in an intermediate state and is rejected.

The same path works for with(x()), removing parens (producing withx()) and then adding the space (with x()).

This isn't a problem for me, but I think it would be better for these APIs to be as consistent as we can have them! 🙂

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

1 participant