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.
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_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.
222 223 224 |
# File 'lib/tree_haver/backends/citrus.rb', line 222 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.
222 223 224 |
# File 'lib/tree_haver/backends/citrus.rb', line 222 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.
229 230 231 |
# File 'lib/tree_haver/backends/citrus.rb', line 229 def root_node Node.new(@root_match, @source) end |