Class: Spectre::NothingParser

Inherits:
Object
  • Object
show all
Includes:
Parser
Defined in:
lib/spectre/generic/primitives.rb

Overview

Matches nothing, i.e. it always fails. Shortcut: nothing.

Instance Attribute Summary

Attributes included from Parser

#node

Instance Method Summary collapse

Methods included from Parser

#backtrack, #create_match, from_POD, #pre_skip?, #to_p

Instance Method Details

#inspectObject



133
134
135
# File 'lib/spectre/generic/primitives.rb', line 133

def inspect
    "[nothing]"
end

#negationObject



127
# File 'lib/spectre/generic/primitives.rb', line 127

def negation; Negations::NegatedZeroTokenParser.new; end

#scan(iter) ⇒ Object



129
130
131
# File 'lib/spectre/generic/primitives.rb', line 129

def scan iter
    nil
end