irb
irb copied to clipboard
Handle keyword local variables correctly
Local variable can be a keyword. Fix a bug that IRB doesn't work in this case.
irb(main):001> {if:1} => {if:}
=> nil
irb(main):002> 1+2
irb(main):003>
irb(main):004> (Can't submit input)
IRB prepends local variable assignment code a=_=nil; to the input code. (Because Ruby code is parsed differently depending on local variable existence)
Prepending if=_=nil; cause bug in this case.