mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Use JRuby equivalent of RubyVM.compile.
RubyVM is specific to CRuby and not supported on JRuby. This is the equivalent operation.
This commit is contained in:
parent
58bb7f0ca1
commit
f9f02e8216
1 changed files with 6 additions and 1 deletions
|
@ -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/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue