Skip to main content

choice

Function choice 

Source
pub fn choice(alternatives: Vec<GrammarExpr>, ordered: bool) -> GrammarExpr
Expand description

Flattens nested choices of the same ordering, as the JavaScript choice builder does: no alternatives build GrammarExpr::Empty and one alternative builds itself.