Class: Parslet::Atoms::Rule

Inherits:
Entity show all
Defined in:
lib/parslet/atoms/rule.rb

Defined Under Namespace

Classes: Position

Constant Summary

Constants included from Precedence

Precedence::ALTERNATE, Precedence::BASE, Precedence::LOOKAHEAD, Precedence::OUTER, Precedence::REPETITION, Precedence::SEQUENCE

Instance Attribute Summary

Attributes inherited from Entity

#block, #name

Instance Method Summary collapse

Methods inherited from Entity

#accept, #initialize, #parslet, #to_s_inner

Methods inherited from Base

#accept, #apply, #inspect, #parse, #parse_with_debug, precedence, #setup_and_apply, #to_s

Methods included from CanFlatten

#flatten, #flatten_repetition, #flatten_sequence, #foldl, #merge_fold, #warn_about_duplicate_keys

Methods included from DSL

#>>, #absent?, #as, #maybe, #present?, #repeat, #|

Constructor Details

This class inherits a constructor from Parslet::Atoms::Entity

Instance Method Details

#eval_rule_bodyObject



3
# File 'lib/parslet/atoms/rule.rb', line 3

alias_method :eval_rule_body, :try

#try(source, context) ⇒ Object



5
6
7
# File 'lib/parslet/atoms/rule.rb', line 5

def try(source, context)
  Position.new(source.pos, source, context, self).apply_rule
end