class

Pegasus::Language::Rule

Inherits Pegasus::Language::OptionObject / Reference / Object

A single rule. This can have one or more alternatives, but has the same options (zero or more) applied to them.

Constructors

new(alternatives : Array(Pegasus::Language::RuleAlternative), options = [] of Option)
Source

Instance methods

==(other : Rule)
Source
alternatives
Source
compute_optional_variants

Creates a new rule with the same options, but with alternatives expanded for optional values.

Source
compute_optional_variants

Creates a new rule with the same options, but with alternatives expanded for optional values. Uses a custom block to check if the elements can be empty or not.

Source
derives_lambda?

Checks if this rule has any alternatives that can derive lambda.

Source
derives_lambda?

Checks if this rule has any alternatives that can derive lambda, using a custom block for checking if an element can derive lambda.

Source
hash(hasher)

See Object#hash(hasher)

Source