summaryrefslogtreecommitdiff
path: root/ext/ripper/lib/ripper/lexer.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-02-02 10:52:38 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-02-02 12:20:10 +0900
commitfad48fefe19cc282a5b209944244a3713359b47f (patch)
treebf63879d90d418049f61245f9e807bdcb09d783c /ext/ripper/lib/ripper/lexer.rb
parentf499c81b01b5c4b7a2ce11d6467d793669d67695 (diff)
[Bug #19399] Parsing invalid heredoc inside block parameter
Although this is of course invalid as Ruby code, allow to just parse and tokenize.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7229
Diffstat (limited to 'ext/ripper/lib/ripper/lexer.rb')
-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 19c59e2ccc..6a3c04af30 100644
--- a/ext/ripper/lib/ripper/lexer.rb
+++ b/ext/ripper/lib/ripper/lexer.rb
@@ -228,7 +228,7 @@ class Ripper
def on_heredoc_end(tok)
@buf.push Elem.new([lineno(), column()], __callee__, tok, state())
- @buf = @stack.pop
+ @buf = @stack.pop unless @stack.empty?
end
def _push_token(tok)