Sha256: 616ac96b4ce62908d1c7b70e0656459d6021923314c31f6bf192ceaf08092ceb
Contents?: true
Size: 761 Bytes
Versions: 5
Compression:
Stored size: 761 Bytes
Contents
require 'internal/vm' if defined?(RubyVM::InstructionSequence) then require 'internal/vm/bytedecoder' class RubyVM class InstructionSequence def as_code(indent=0) env = Nodewrap::ByteDecoder::Environment.new(local_table()) opt_pc = self.opt_pc self.bytedecode(env, opt_pc) expressions = env.expressions + env.stack if expressions.length == 0 then return nil elsif expressions.length == 1 and expressions[0].is_a?(Nodewrap::ByteDecoder::Expression::Literal) and expressions[0].value == nil then return nil else expressions.map! { |e| "#{' '*indent}#{e}" } return expressions.join("\n") end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems