diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/irb/ruby-lex.rb | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb index 295dc9fa06..19b7b9198b 100644 --- a/lib/irb/ruby-lex.rb +++ b/lib/irb/ruby-lex.rb @@ -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 |