pub enum RuleType {
Normal,
Silent,
Atomic,
CompoundAtomic,
NonAtomic,
}
Expand description
All possible rule types
Variants§
Normal
The normal rule type
Silent
Silent rules are just like normal rules
— when run, they function the same way —
except they do not produce pairs or tokens.
If a rule is silent, it will never appear in a parse result.
(their syntax is _{ ... }
)
Atomic
atomic rule prevent implicit whitespace: inside an atomic rule,
the tilde ~ means “immediately followed by”,
and repetition operators (asterisk * and plus sign +)
have no implicit separation. In addition, all other rules
called from an atomic rule are also treated as atomic.
In an atomic rule, interior matching rules are silent.
(their syntax is @{ ... }
)
CompoundAtomic
Compound atomic rules are similar to atomic rules,
but they produce inner tokens as normal.
(their syntax is ${ ... }
)
NonAtomic
Non-atomic rules cancel the effect of atomic rules.
(their syntax is !{ ... }
)