diff options
| author | Martin Emde <martin.emde@gmail.com> | 2023-11-30 19:53:54 -0800 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2023-12-01 15:17:20 +0000 |
| commit | cbe57caa246f57440667a53b4526ddabcea82df9 (patch) | |
| tree | 12c1255647a4b7092c2cc80c6fc8399c7f7b019b /test | |
| parent | ffeec108cfccda71ff63167d41f090aa39c2432c (diff) | |
[ruby/prism] Fix comments after HEREDOCs again.
The problem was deeper than just looking back a single token.
You can push the heredoc_end token way back into the list.
We need to save the last location of a heredoc end to see if
it's the last token in the file.
Fixes https://github.com/ruby/prism/pull/1954
https://github.com/ruby/prism/commit/91dfd4eecd
Diffstat (limited to 'test')
| -rw-r--r-- | test/prism/fixtures/heredoc_with_comment.txt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/prism/fixtures/heredoc_with_comment.txt b/test/prism/fixtures/heredoc_with_comment.txt index cf48c12051..8e7b7275bd 100644 --- a/test/prism/fixtures/heredoc_with_comment.txt +++ b/test/prism/fixtures/heredoc_with_comment.txt @@ -1,2 +1,3 @@ -<<-TARGET # comment
+<<-TARGET.chomp # the heredoc end token doesn't always precede the comment
+ content makes for an obvious error
TARGET
\ No newline at end of file |
