Class: TreeHaver::Backends::Citrus::Tree Private
- Inherits:
-
Object
- Object
- TreeHaver::Backends::Citrus::Tree
- 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
- #root_match ⇒ Object readonly private
- #source ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(root_match, source) ⇒ Tree
constructor
private
A new instance of Tree.
- #root_node ⇒ Object private
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.
253 254 255 256 |
# File 'lib/tree_haver/backends/citrus.rb', line 253 def initialize(root_match, source) @root_match = root_match @source = source end |
Instance Attribute Details
#root_match ⇒ Object (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.
251 252 253 |
# File 'lib/tree_haver/backends/citrus.rb', line 251 def root_match @root_match end |
#source ⇒ Object (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.
251 252 253 |
# File 'lib/tree_haver/backends/citrus.rb', line 251 def source @source end |
Instance Method Details
#root_node ⇒ Object
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.
258 259 260 |
# File 'lib/tree_haver/backends/citrus.rb', line 258 def root_node Node.new(@root_match, @source) end |