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

Fix parsing an empty heredoc #5602

Merged
merged 1 commit into from
Jan 18, 2018

Conversation

makenowjust
Copy link
Contributor

The compiler raises an error "unterminated heredoc" against this:

p <<-HERE
HERE

And this code can be compiled:

p <<-HERE
HERE
HERE
# output: "HERE"

This PR fixes parsing an empty heredoc correctly. I'm not sure an empty heredoc is useful, but the current behavior is a bug surely.

@makenowjust makenowjust force-pushed the fix/crystal/empty-heredoc branch from 6e897e3 to e3ee9a2 Compare January 18, 2018 08:15
@makenowjust makenowjust force-pushed the fix/crystal/empty-heredoc branch from e3ee9a2 to e61dbe8 Compare January 18, 2018 08:16
@RX14 RX14 requested a review from asterite January 18, 2018 11:35
Copy link
Member

@asterite asterite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! I knew about this bug but I was lazy to fix it 😊

@asterite asterite added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib labels Jan 18, 2018
@asterite asterite merged commit 6a574f2 into crystal-lang:master Jan 18, 2018
@RX14 RX14 added this to the Next milestone Jan 18, 2018
@makenowjust makenowjust deleted the fix/crystal/empty-heredoc branch January 18, 2018 13: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:stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants