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

Wrong formatting on comment just after a then #11809

Open
I3oris opened this issue Feb 7, 2022 · 0 comments
Open

Wrong formatting on comment just after a then #11809

I3oris opened this issue Feb 7, 2022 · 0 comments

Comments

@I3oris
Copy link
Contributor

I3oris commented Feb 7, 2022

The following code, compile fine:

case :foo
when :foo then puts "foo"
when :bar then # comment
when :baz then puts "baz"
end

But it get formatted like this:

case :foo
when :foo then puts "foo"
when :bar # comment
 then
when :baz then puts "baz"
end

which doesn't compile any more.
=> Error: unexpected token: "then" (expecting when, else or end)

I would expect the code to staying the same.

crystal -v

Crystal 1.3.2 (2022-01-19)

LLVM: 13.0.0
Default target: x86_64-pc-linux-gnu
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

2 participants