Macro r4::iterate
[−]
[src]
macro_rules! iterate { (yield $r:expr) => { ... }; (yield $r:expr; for $($rest:tt)+) => { ... }; (yield $r:expr; if $($rest:tt)+) => { ... }; (yield $r:expr; let $($rest:tt)+) => { ... }; (yield $r:expr; yield $($rest:tt)+) => { ... }; (for $x:pat in $xs:expr; $($rest:tt)*) => { ... }; (if let $x:pat = $e:expr; for $($rest:tt)*) => { ... }; (if let $x:pat = $e:expr; if $($rest:tt)*) => { ... }; (if let $x:pat = $e:expr; let $($rest:tt)*) => { ... }; (if let $x:pat = $e:expr; yield $($rest:tt)*) => { ... }; (if $a:expr; if $b:expr; $(if $c:expr;)* for $($rest:tt)*) => { ... }; (if $a:expr; if $b:expr; $(if $c:expr;)* let $($rest:tt)*) => { ... }; (if $a:expr; if $b:expr; $(if $c:expr;)* yield $($rest:tt)*) => { ... }; (if $a:expr; for $($rest:tt)*) => { ... }; (if $a:expr; let $($rest:tt)*) => { ... }; (if $a:expr; yield $($rest:tt)*) => { ... }; ($(let $lhs:pat = $rhs:expr;)+ for $($rest:tt)*) => { ... }; ($(let $lhs:pat = $rhs:expr;)+ if $($rest:tt)*) => { ... }; ($(let $lhs:pat = $rhs:expr;)+ yield $($rest:tt)*) => { ... }; }
Produces an iterator over values yield
ed in a sequence of
semicolon-separated expressions.
Expressions are compiled into nested flat_map operations via closures that move out of the enclosing environment. See top-level documentation for details.
Implementation note: adjacent wildcard matches aren't allowed, so each recursive rule has multiple cases, wherein wildcard matches are separated by macro keywords.