зеркало из https://github.com/github/ruby.git
* 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:
Родитель
89182621d9
Коммит
8f4d0c4526
|
@ -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
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче