dynamic.rb

Path: lib/parslet/atoms/dynamic.rb
Last Update: Fri Jul 15 14:35:39 -0400 2016

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') }

[Validate]