diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb index 99ab962ff8..fd2e122e1b 100644 --- a/lib/irb/ruby-lex.rb +++ b/lib/irb/ruby-lex.rb @@ -205,7 +205,12 @@ class RubyLex begin # check if parser error are available verbose, $VERBOSE = $VERBOSE, nil - RubyVM::InstructionSequence.compile(code) + case RUBY_ENGINE + when 'jruby' + JRuby.compile_ir(code) + else + RubyVM::InstructionSequence.compile(code) + end rescue SyntaxError => e case e.message when /unterminated (?:string|regexp) meets end of file/