Macro Optionals

Source
macro_rules! Optionals {
    ($t:ty) => { ... };
    ($t:ty, $u:ty) => { ... };
    ($t:ty, $u:ty, $v:ty) => { ... };
    ($t:ty, $u:ty, $v:ty, $w:ty) => { ... };
    ($t:ty, $u:ty, $v:ty, $w:ty, $x:ty) => { ... };
}
Expand description

A helper type for parsing optional CSS grammar patterns where items can appear in any order but at most once each (the || combinator in CSS grammar).

§Example

// For CSS grammar: [ foo | <number> ]
let (foo, num) = p.parse::<Optionals![Ident, Number]>()?;