Class: Rattler::Parsers::Predicate

Inherits:
Parser show all
Defined in:
lib/rattler/parsers/predicate.rb

Direct Known Subclasses

Assert, Disallow, Eof

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Parser

#&, #labeled?, #one_or_more, #optional, #skip, #variable_capture_count?, #zero_or_more, #|

Methods inherited from Util::Node

#==, [], #[], #attrs, #can_equal?, #child, #children, #each, #empty?, #eql?, #initialize, #inspect, #method_missing, #name, #respond_to?, #same_contents?, #to_graphviz, #with_attrs, #with_attrs!, #with_children

Constructor Details

This class inherits a constructor from Rattler::Util::Node

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Rattler::Util::Node

Class Method Details

.parsed(results, *_) ⇒ Object

:nodoc:



14
15
16
# File 'lib/rattler/parsers/predicate.rb', line 14

def self.parsed(results, *_)
  self[results.first]
end

Instance Method Details

#capturing?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/rattler/parsers/predicate.rb', line 18

def capturing?
  false
end

#with_ws(ws) ⇒ Object



22
23
24
# File 'lib/rattler/parsers/predicate.rb', line 22

def with_ws(ws)
  self.class.new(child.with_ws(ws), attrs)
end