mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/irb/ruby-lex.rb: allow to handle recursive heredocs on
irb[Bug #5648]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
89182621d9
commit
8f4d0c4526
2 changed files with 24 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu Dec 27 21:30:21 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
|
||||
|
||||
* lib/irb/ruby-lex.rb: allow to handle recursive heredocs on
|
||||
irb[Bug #5648].
|
||||
|
||||
Thu Dec 27 20:45:29 2012 Masaki Matsushita <glass.saga@gmail.com>
|
||||
|
||||
* ext/stringio/stringio.c (strio_getline): fix not to raise TypeError
|
||||
|
|
|
@ -907,10 +907,25 @@ class RubyLex
|
|||
end
|
||||
|
||||
@here_header = false
|
||||
while l = gets
|
||||
l = l.sub(/(:?\r)?\n\z/, '')
|
||||
if (indent ? l.strip : l) == quoted
|
||||
break
|
||||
# while l = gets
|
||||
# l = l.sub(/(:?\r)?\n\z/, '')
|
||||
# if (indent ? l.strip : l) == quoted
|
||||
# break
|
||||
# end
|
||||
# end
|
||||
|
||||
line = ""
|
||||
while ch = getc
|
||||
if ch == "\n"
|
||||
if line == quoted
|
||||
break
|
||||
end
|
||||
line = ""
|
||||
else
|
||||
line.concat ch unless indent && line == "" && /\s/ =~ ch
|
||||
if @ltype != "'" && ch == "#" && peek(0) == "{"
|
||||
identify_string_dvar
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue