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

Format: fix formatter bug on nesting begin/end #5922

Merged

Conversation

makenowjust
Copy link
Contributor

@makenowjust makenowjust commented Apr 5, 2018

This file reproduces a formatter bug:

begin
  begin
  end
end
Error: couldn't format STDIN, please report a bug including the contents of it: https://github.com/crystal-lang/crystal/issues

expecting keyword end, not `(, `, at :2:3 (Exception)
  from Crystal::Formatter#check_keyword<Symbol>:Nil
  from Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::Formatter>:(Bool | Nil)
  from Crystal::Formatter::format<String, Nil>:String
  from Crystal::Command#tool:(Bool | IO::FileDescriptor | Nil)
  from Crystal::Command#run:(Bool | Crystal::Compiler::Result | IO::FileDescriptor | Nil)
  from main

It is fixed by this PR.

@jhass jhass added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:tools:formatter labels Apr 5, 2018
@jhass jhass added this to the Next milestone Apr 5, 2018
@jhass jhass merged commit ef85244 into crystal-lang:master Apr 5, 2018
@jhass
Copy link
Member

jhass commented Apr 5, 2018

Thank you!

@makenowjust makenowjust deleted the fix/crystal-format/begin-end-nesting branch April 5, 2018 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler topic:tools:formatter topic:tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants