Class | Parslet::Atoms::Alternative |
In: |
lib/parslet/atoms/visitor.rb
lib/parslet/atoms/alternative.rb |
Parent: | Object |
Alternative during matching. Contains a list of parslets that is tried each one in turn. Only fails if all alternatives fail.
Example:
str('a') | str('b') # matches either 'a' or 'b'
alternatives | [R] |
Constructs an Alternative instance using all given parslets in the order given. This is what happens if you call ’|’ on existing parslets, like this:
str('a') | str('b')