diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb index 6038a2bd2..170654fd8 100644 --- a/lib/irb/ruby-lex.rb +++ b/lib/irb/ruby-lex.rb @@ -220,8 +220,8 @@ class Statement def initialize(line, is_assignment, command, arg, command_class) @line = line - @command = command @is_assignment = is_assignment + @command = command @arg = arg @command_class = command_class end @@ -239,8 +239,10 @@ def should_be_handled_by_debugger? end def evaluable_line + return @line unless @command_class + # Hook command-specific transformation - if @command_class&.respond_to?(:transform_args) + if @command_class.respond_to?(:transform_args) arg = @command_class.transform_args(@arg) else arg = @arg