Class: TreeHaver::Backends::Citrus::Tree Private

Inherits:
Object
  • Object
show all
Defined in:
lib/tree_haver/backends/citrus.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Citrus tree wrapper

Wraps a Citrus::Match (which represents the parse tree) to provide tree-sitter-compatible API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root_match, source) ⇒ Tree

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Tree.



224
225
226
227
# File 'lib/tree_haver/backends/citrus.rb', line 224

def initialize(root_match, source)
  @root_match = root_match
  @source = source
end

Instance Attribute Details

#root_matchObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



222
223
224
# File 'lib/tree_haver/backends/citrus.rb', line 222

def root_match
  @root_match
end

#sourceObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



222
223
224
# File 'lib/tree_haver/backends/citrus.rb', line 222

def source
  @source
end

Instance Method Details

#root_nodeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



229
230
231
# File 'lib/tree_haver/backends/citrus.rb', line 229

def root_node
  Node.new(@root_match, @source)
end