Module: ASTTransform::InstructionSequence::BootsnapMixin

Defined in:
lib/ast_transform/instruction_sequence/bootsnap_mixin.rb

Instance Method Summary collapse

Instance Method Details

#input_to_storage(source, source_path) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/ast_transform/instruction_sequence/bootsnap_mixin.rb', line 10

def input_to_storage(source, source_path)
  return ASTTransform::MixinUtils.try_super(self, :input_to_storage, source, source_path) if source_path == __FILE__
  return ASTTransform::MixinUtils.try_super(self, :input_to_storage, source, source_path) unless source =~ /transform!/

  iseq = ASTTransform::InstructionSequence.source_to_transformed_iseq(source, source_path)
  iseq.to_binary
rescue SyntaxError
  raise ::Bootsnap::CompileCache::Uncompilable, "syntax error"
end