Actions
Bug #4232
closedunexpected behavior of '#{}' in irb
Description
=begin
In Ruby 1.9.x,
C:\work>irb
irb(main):001:0> a = '#{%}'
irb(main):002:0"
C:\work>irb
irb(main):001:0> a = '#{#}'
irb(main):002:0>
In Ruby 1.8.6,
C:\work>irb
irb(main):001:0> a = '#{%}'
=> "#{%}"
irb(main):002:0>
C:\work>irb
irb(main):001:0> a = '#{#}'
=> "#{#}"
irb(main):002:0>
Here is a patch:
--- ruby-lex.rb 2011-01-05 15:05:31.000000000 +0900
+++ ruby-lex.rb.new 2011-01-05 15:05:08.000000000 +0900
@@ -1046,7 +1046,7 @@
while ch = getc
if @quoted == ch and nest == 0
break
-
elsif ch == "#" and peek(0) == "{"
-
elsif @ltype != "'" && ch == "#" and peek(0) == "{" identify_string_dvar elsif @ltype != "'" && @ltype != "]" && @ltype != ":" and ch == "#" subtype = true
=end
Updated by yugui (Yuki Sonoda) almost 14 years ago
- Assignee set to keiju (Keiju Ishitsuka)
=begin
=end
Updated by shyouhei (Shyouhei Urabe) over 13 years ago
- Status changed from Open to Assigned
Updated by keiju (Keiju Ishitsuka) over 13 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r32257.
Heesob, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- lib/irb/ruby-lex.rb: fix [Bug #4232].
Actions
Like0
Like0Like0Like0