Project

General

Profile

Bug #9975 » fix_irb_keyword_bug.patch

takkanm (三村 益隆), 06/24/2014 01:08 PM

View differences:

lib/irb/ruby-lex.rb
when "class"
valid = false unless peek_match?(/^\s*(<<|\w|::)/)
when "def"
valid = false if peek_match?(/^\s*(([+\-\/*&\|^]|<<|>>|\|\||\&\&)=|\&\&|\|\|)/)
valid = false if peek_match?(/^\s*(([+\-\/*&\|^]|<<|>>|\|\||\&\&)=|\&\&|\|\||:)/)
when "do"
valid = false if peek_match?(/^\s*([+\-\/*]?=|\*|<|>|\&)/)
valid = false if peek_match?(/^\s*([+\-\/*]?=|\*|<|>|\&|:)/)
when *ENINDENT_CLAUSE
valid = false if peek_match?(/^\s*([+\-\/*]?=|\*|<|>|\&|\|)/)
valid = false if peek_match?(/^\s*([+\-\/*]?=|\*|<|>|\&|\||:)/)
else
# no nothing
end
    (1-1/1)