class SyntaxTree::Index::ISeqBackend

This backend creates the index using RubyVM::InstructionSequence, which is faster than using the Syntax Tree parser, but is not available on all runtimes.

Constants

VM_DEFINECLASS_FLAG_HAS_SUPERCLASS
VM_DEFINECLASS_FLAG_SCOPED
VM_DEFINECLASS_TYPE_CLASS
VM_DEFINECLASS_TYPE_MODULE
VM_DEFINECLASS_TYPE_SINGLETON_CLASS

Public Instance Methods

index(source) click to toggle source
# File lib/syntax_tree/index.rb, line 184
def index(source)
  index_iseq(
    RubyVM::InstructionSequence.compile(source).to_a,
    FileComments.new(FileComments::StringSource.new(source))
  )
end
index_file(filepath) click to toggle source
# File lib/syntax_tree/index.rb, line 191
def index_file(filepath)
  index_iseq(
    RubyVM::InstructionSequence.compile_file(filepath).to_a,
    FileComments.new(FileComments::FileSource.new(filepath))
  )
end