Class Parslet::Atoms::Dynamic
In: lib/parslet/atoms/dynamic.rb
Parent: Parslet::Atoms::Base

Evaluates a block at parse time. The result from the block must be a parser (something which implements apply). In the first case, the parser will then be applied to the input, creating the result.

Dynamic parses are never cached.

Example:

  dynamic { rand < 0.5 ? str('a') : str('b') }

Methods

cached?   new   to_s_inner   try  

Attributes

block  [R] 

Public Class methods

Public Instance methods

[Validate]