summaryrefslogtreecommitdiff
path: root/ext/ripper/lib
diff options
context:
space:
mode:
authorShugo Maeda <shugo@ruby-lang.org>2021-02-19 16:38:34 +0900
committerShugo Maeda <shugo@ruby-lang.org>2021-02-19 16:40:29 +0900
commit5de38c41ae7bf17ae599fdfa9f8face87f16d8bb (patch)
tree2c4bb713d9d3cdc1252ad2bb08357d7f56db9b6f /ext/ripper/lib
parent7b9476fbfab738d1eb01b4b4c4af9a1680513019 (diff)
ripper: fix a bug of Ripper::Lexer with syntax error and heredoc [Bug #17644]
Diffstat (limited to 'ext/ripper/lib')
-rw-r--r--ext/ripper/lib/ripper/lexer.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/ripper/lib/ripper/lexer.rb b/ext/ripper/lib/ripper/lexer.rb
index 8222684b654..f6051c63416 100644
--- a/ext/ripper/lib/ripper/lexer.rb
+++ b/ext/ripper/lib/ripper/lexer.rb
@@ -136,7 +136,7 @@ class Ripper
end
@buf.flatten!
unless (result = @buf).empty?
- result.concat(@buf) until (@buf = []; super(); @buf.empty?)
+ result.concat(@buf) until (@buf = []; super(); @buf.flatten!; @buf.empty?)
end
result
end