Class: TreeSitter::TextPredicateCapture
- Inherits:
-
Object
- Object
- TreeSitter::TextPredicateCapture
- Defined in:
- lib/tree_sitter/text_predicate_capture.rb
Overview
A representation for text predicates.
Constant Summary collapse
- EQ_CAPTURE =
Equality Capture
0
- EQ_STRING =
Equality String
1
- MATCH_STRING =
Match String
2
- ANY_STRING =
Any String
3
Instance Attribute Summary collapse
-
#fst ⇒ Object
readonly
Returns the value of attribute fst.
-
#snd ⇒ Object
readonly
Returns the value of attribute snd.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
-
.any_string ⇒ Object
Create a TextPredicateCapture for ANY_STRING.
-
.eq_capture ⇒ Object
Create a TextPredicateCapture for EQ_CAPTURE.
-
.eq_string ⇒ Object
Create a TextPredicateCapture for EQ_STRING.
-
.match_string ⇒ Object
Create a TextPredicateCapture for MATCH_STRING.
Instance Method Summary collapse
-
#initialize(type, fst, snd, positive, match_all) ⇒ TextPredicateCapture
constructor
A new instance of TextPredicateCapture.
-
#match_all? ⇒ Boolean
‘#any-` means don’t match all.
-
#positive? ⇒ Boolean
‘#eq` is positive, `#not-eq` is not.
Constructor Details
#initialize(type, fst, snd, positive, match_all) ⇒ TextPredicateCapture
Returns a new instance of TextPredicateCapture.
24 25 26 27 28 29 30 |
# File 'lib/tree_sitter/text_predicate_capture.rb', line 24 def initialize(type, fst, snd, positive, match_all) @type = type @fst = fst @snd = snd @positive = positive @match_all = match_all end |
Instance Attribute Details
#fst ⇒ Object (readonly)
Returns the value of attribute fst.
11 12 13 |
# File 'lib/tree_sitter/text_predicate_capture.rb', line 11 def fst @fst end |
#snd ⇒ Object (readonly)
Returns the value of attribute snd.
12 13 14 |
# File 'lib/tree_sitter/text_predicate_capture.rb', line 12 def snd @snd end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
13 14 15 |
# File 'lib/tree_sitter/text_predicate_capture.rb', line 13 def type @type end |
Class Method Details
.any_string ⇒ Object
Create a TextPredicateCapture for ANY_STRING.
22 |
# File 'lib/tree_sitter/text_predicate_capture.rb', line 22 def self.any_string(...) = new(ANY_STRING, ...) |
.eq_capture ⇒ Object
Create a TextPredicateCapture for EQ_CAPTURE.
16 17 |
# File 'lib/tree_sitter/text_predicate_capture.rb', line 16 def self.eq_capture(...) = new(EQ_CAPTURE, ...) # Create a TextPredicateCapture for {EQ_STRING}. |
.eq_string ⇒ Object
Create a TextPredicateCapture for EQ_STRING.
18 19 |
# File 'lib/tree_sitter/text_predicate_capture.rb', line 18 def self.eq_string(...) = new(EQ_STRING, ...) # Create a TextPredicateCapture for {MATCH_STRING}. |
.match_string ⇒ Object
Create a TextPredicateCapture for MATCH_STRING.
20 21 |
# File 'lib/tree_sitter/text_predicate_capture.rb', line 20 def self.match_string(...) = new(MATCH_STRING, ...) # Create a TextPredicateCapture for {ANY_STRING}. |
Instance Method Details
#match_all? ⇒ Boolean
‘#any-` means don’t match all.
35 |
# File 'lib/tree_sitter/text_predicate_capture.rb', line 35 def match_all? = @match_all |
#positive? ⇒ Boolean
‘#eq` is positive, `#not-eq` is not.
33 34 |
# File 'lib/tree_sitter/text_predicate_capture.rb', line 33 def positive? = @positive # `#any-` means don't match all. |