Class: Pione::Util::IgnoreAtom
- Inherits:
-
Parslet::Atoms::Base
- Object
- Parslet::Atoms::Base
- Pione::Util::IgnoreAtom
- Defined in:
- lib/pione/util/parslet-extension.rb
Instance Method Summary collapse
-
#initialize(atom) ⇒ IgnoreAtom
constructor
A new instance of IgnoreAtom.
- #to_s_inner(prec) ⇒ Object
- #try(source, context, consume_all) ⇒ Object
Constructor Details
#initialize(atom) ⇒ IgnoreAtom
Returns a new instance of IgnoreAtom.
41 42 43 |
# File 'lib/pione/util/parslet-extension.rb', line 41 def initialize(atom) @atom = atom end |
Instance Method Details
#to_s_inner(prec) ⇒ Object
50 51 52 |
# File 'lib/pione/util/parslet-extension.rb', line 50 def to_s_inner(prec) "IGNORE" end |
#try(source, context, consume_all) ⇒ Object
45 46 47 48 |
# File 'lib/pione/util/parslet-extension.rb', line 45 def try(source, context, consume_all) success, _ = result = @atom.try(source, context, consume_all) return sucess ? succ(nil) : result end |