Class: Language::Atom::Ignore
- Inherits:
-
Language::Atom
- Object
- Language::Atom
- Language::Atom::Ignore
- Defined in:
- lib/language/atom/ignore.rb
Instance Method Summary collapse
-
#initialize(parent:) ⇒ Ignore
constructor
A new instance of Ignore.
- #parse(parser) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Language::Atom
#<<, #>>, #absent, #aka, #any, #ignore, #inspect, #maybe, #repeat, #str, #then, #|
Constructor Details
#initialize(parent:) ⇒ Ignore
Returns a new instance of Ignore.
6 7 8 |
# File 'lib/language/atom/ignore.rb', line 6 def initialize(parent:) @parent = parent end |
Instance Method Details
#parse(parser) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/language/atom/ignore.rb', line 10 def parse(parser) clone = Parser.new( root: self, input: parser.input, cursor: parser.cursor, buffer: parser.buffer ) @parent.parse(clone) parser.cursor = clone.cursor end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/language/atom/ignore.rb', line 22 def to_s "#{@parent}.ignore" end |