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

Formatter cannot format heredoc having interpolation of string literal #7183

Closed
makenowjust opened this issue Dec 13, 2018 · 1 comment
Closed

Comments

@makenowjust
Copy link
Contributor

Extracted from #7099 (comment)

This code causes an error.

<<-FOO
foo#{"foo"}
FOO
$ crystal tool format -< foo.cr
Error: couldn't format STDIN, please report a bug including the contents of it: https://github.com/crystal-lang/crystal/issues

expecting DELIMITER_END, not `INTERPOLATION_START, foo`, at :2:1 (Exception)
  from Crystal::Formatter#check<Symbol>:Nil
  from Crystal::Formatter#visit_string_interpolation<Crystal::StringInterpolation, Crystal::Token, Int32, Int32, Int32, Int32, Bool>:Bool
  from Crystal::Formatter#next_token:Crystal::Token
  from Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::Formatter>:(Bool | Nil)
  from Crystal::format<String>:String
  from Crystal::Command#tool:(Bool | Nil)
  from Crystal::Command#run:(Bool | Crystal::Compiler::Result | Nil)
  from __crystal_main
  from main
@makenowjust
Copy link
Contributor Author

It is another version, but error message is different.

<<-FOO
#{"foo"}
FOO
Syntax error in :4: Unterminated string literal

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