Class: Rattler::Parsers::ESymbol

Inherits:
Parser show all
Includes:
Atomic, Singleton
Defined in:
lib/rattler/parsers/e_symbol.rb

Overview

ESymbol always succeeds without advancing.

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Atomic

#with_ws

Methods inherited from Parser

#&, #>>, #capturing_decidable?, #labeled?, #list, #one_or_more, #optional, #repeat, #semantic?, #sequence?, #skip, #variable_capture_count?, #with_ws, #zero_or_more, #|

Methods included from Runtime::ParserHelper

#select_captures

Methods inherited from Util::Node

#==, #[], #attrs, #can_equal?, #child, #children, #each, #empty?, #eql?, #initialize, #inspect, #method_missing, #name, #pretty_print, #pretty_print_cycle, #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

.[]ESymbol

Return the singleton instance of ESymbol

Returns:

  • (ESymbol)

    the singleton instance



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

def self.[]()
  self.instance
end

.parsed(*_) ⇒ Object



19
20
21
# File 'lib/rattler/parsers/e_symbol.rb', line 19

def self.parsed(*_) #:nodoc:
  self.instance
end

Instance Method Details

#capturing?Boolean

Returns true if the parser returns parse results on success, or false if the parser simply returns true on success.

Returns:

  • (Boolean)

    true if the parser returns parse results on success, or false if the parser simply returns true on success



33
34
35
# File 'lib/rattler/parsers/e_symbol.rb', line 33

def capturing?
  false
end

#parse(*_) ⇒ Boolean

Return true without advancing

Parameters:

  • scanner (StringScanner)

    the scanner for the current parse

  • rules (RuleSet)

    the grammar rules being used for the current parse

  • scope (ParserScope)

    the scope of captured results

Returns:

  • (Boolean)

    true



28
29
30
# File 'lib/rattler/parsers/e_symbol.rb', line 28

def parse(*_)
  true
end