Skip to content
Myr

Merge pull request #198 from dtolnay/ensure

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Preserve spans of all punctuation and keyword tokens in ensure

authored by David Tolnay · committed by GitHub · parents 0b5c758, c5068a8 · Browse files · 3 files+184 added−181 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+184 added−181 removed

  • tests:+7 added−1 removed
  • other:+177 added−180 removed

3 files+184 added−181 removed

modified:src/ensure.rs+176 added-180 removed
101 unmodified lines
102103#[doc(hidden)]104#[macro_export]105macro_rules! __parse_ensure {106 (atom () $bail:tt $fuel:tt {($($rhs:tt)+) ($($lhs:tt)+) $op:tt} $(,)?) => {106 (atom () $bail:tt $fuel:tt {($($rhs:tt)+) ($($lhs:tt)+) $op:tt} $dup:tt $(,)?) => {107 $crate::__fancy_ensure!($($lhs)+, $op, $($rhs)+)108 };109110 // low precedence control flow constructs111112 (0 $stack:tt ($($bail:tt)*) $fuel:tt $parse:tt return $($rest:tt)*) => {112 (0 $stack:tt ($($bail:tt)*) $fuel:tt $parse:tt $dup:tt return $($rest:tt)*) => {113 $crate::__fallback_ensure!($($bail)*)114 };115116 (0 $stack:tt ($($bail:tt)*) $fuel:tt $parse:tt break $($rest:tt)*) => {116 (0 $stack:tt ($($bail:tt)*) $fuel:tt $parse:tt $dup:tt break $($rest:tt)*) => {117 $crate::__fallback_ensure!($($bail)*)118 };119120 (0 $stack:tt ($($bail:tt)*) $fuel:tt $parse:tt continue $($rest:tt)*) => {120 (0 $stack:tt ($($bail:tt)*) $fuel:tt $parse:tt $dup:tt continue $($rest:tt)*) => {121 $crate::__fallback_ensure!($($bail)*)122 };123124 (0 $stack:tt ($($bail:tt)*) $fuel:tt $parse:tt yield $($rest:tt)*) => {124 (0 $stack:tt ($($bail:tt)*) $fuel:tt $parse:tt $dup:tt yield $($rest:tt)*) => {125 $crate::__fallback_ensure!($($bail)*)126 };127128 (0 $stack:tt ($($bail:tt)*) $fuel:tt $parse:tt move $($rest:tt)*) => {128 (0 $stack:tt ($($bail:tt)*) $fuel:tt $parse:tt $dup:tt move $($rest:tt)*) => {129 $crate::__fallback_ensure!($($bail)*)130 };131132 // unary operators133134 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} * $($rest:tt)*) => {135 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* *) $($parse)*} $($rest)*)134 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($deref:tt $($dup:tt)*) * $($rest:tt)*) => {135 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $deref) $($parse)*} ($($rest)*) $($rest)*)136 };137138 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ! $($rest:tt)*) => {139 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* !) $($parse)*} $($rest)*)138 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($not:tt $($dup:tt)*) ! $($rest:tt)*) => {139 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $not) $($parse)*} ($($rest)*) $($rest)*)140 };141142 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} - $($rest:tt)*) => {143 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* -) $($parse)*} $($rest)*)142 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($neg:tt $($dup:tt)*) - $($rest:tt)*) => {143 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $neg) $($parse)*} ($($rest)*) $($rest)*)144 };145146 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} let $(|)? $($pat:pat)|+ = $($rest:tt)*) => {147 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* let $($pat)|+ =) $($parse)*} $($rest)*)146 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($let:tt $($dup:tt)*) let $(|)? $($pat:pat)|+ = $($rest:tt)*) => {147 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $let $($pat)|+ =) $($parse)*} ($($rest)*) $($rest)*)148 };149150 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $life:lifetime : $($rest:tt)*) => {151 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $life :) $($parse)*} $($rest)*)150 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($life:tt $colon:tt $($dup:tt)*) $label:lifetime : $($rest:tt)*) => {151 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $life $colon) $($parse)*} ($($rest)*) $($rest)*)152 };153154 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} &mut $($rest:tt)*) => {155 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* &mut) $($parse)*} $($rest)*)154 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($and:tt $mut:tt $($dup:tt)*) &mut $($rest:tt)*) => {155 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $and $mut) $($parse)*} ($($rest)*) $($rest)*)156 };157158 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} & $($rest:tt)*) => {159 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* &) $($parse)*} $($rest)*)158 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($and:tt $($dup:tt)*) & $($rest:tt)*) => {159 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $and) $($parse)*} ($($rest)*) $($rest)*)160 };161162 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} &&mut $($rest:tt)*) => {163 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* &&mut) $($parse)*} $($rest)*)162 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($andand:tt $mut:tt $($dup:tt)*) &&mut $($rest:tt)*) => {163 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $andand $mut) $($parse)*} ($($rest)*) $($rest)*)164 };165166 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} && $($rest:tt)*) => {167 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* &&) $($parse)*} $($rest)*)166 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($andand:tt $($dup:tt)*) && $($rest:tt)*) => {167 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $andand) $($parse)*} ($($rest)*) $($rest)*)168 };169170 // control flow constructs171172 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} if $($rest:tt)*) => {173 $crate::__parse_ensure!(0 (cond $stack) $bail ($($fuel)*) {($($buf)* if) $($parse)*} $($rest)*)172 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($if:tt $($dup:tt)*) if $($rest:tt)*) => {173 $crate::__parse_ensure!(0 (cond $stack) $bail ($($fuel)*) {($($buf)* $if) $($parse)*} ($($rest)*) $($rest)*)174 };175176 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} match $($rest:tt)*) => {177 $crate::__parse_ensure!(0 (cond $stack) $bail ($($fuel)*) {($($buf)* match) $($parse)*} $($rest)*)176 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($match:tt $($dup:tt)*) match $($rest:tt)*) => {177 $crate::__parse_ensure!(0 (cond $stack) $bail ($($fuel)*) {($($buf)* $match) $($parse)*} ($($rest)*) $($rest)*)178 };179180 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} while $($rest:tt)*) => {181 $crate::__parse_ensure!(0 (cond $stack) $bail ($($fuel)*) {($($buf)* while) $($parse)*} $($rest)*)180 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($while:tt $($dup:tt)*) while $($rest:tt)*) => {181 $crate::__parse_ensure!(0 (cond $stack) $bail ($($fuel)*) {($($buf)* $while) $($parse)*} ($($rest)*) $($rest)*)182 };183184 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} for $(|)? $($pat:pat)|+ in $($rest:tt)*) => {185 $crate::__parse_ensure!(0 (cond $stack) $bail ($($fuel)*) {($($buf)* for $($pat)|+ in) $($parse)*} $($rest)*)184 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($for:tt $($dup:tt)*) for $(|)? $($pat:pat)|+ in $($rest:tt)*) => {185 $crate::__parse_ensure!(0 (cond $stack) $bail ($($fuel)*) {($($buf)* $for $($pat)|+ in) $($parse)*} ($($rest)*) $($rest)*)186 };187188 (atom (cond $stack:tt) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} {$($block:tt)*} $($rest:tt)*) => {189 $crate::__parse_ensure!(cond $stack $bail ($($fuel)*) {($($buf)* {$($block)*}) $($parse)*} $($rest)*)188 (atom (cond $stack:tt) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($brace:tt $($dup:tt)*) {$($block:tt)*} $($rest:tt)*) => {189 $crate::__parse_ensure!(cond $stack $bail ($($fuel)*) {($($buf)* $brace) $($parse)*} ($($rest)*) $($rest)*)190 };191192 (cond $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} else if $($rest:tt)*) => {193 $crate::__parse_ensure!(0 (cond $stack) $bail ($($fuel)*) {($($buf)* else if) $($parse)*} $($rest)*)192 (cond $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($else:tt $if:tt $($dup:tt)*) else if $($rest:tt)*) => {193 $crate::__parse_ensure!(0 (cond $stack) $bail ($($fuel)*) {($($buf)* $else $if) $($parse)*} ($($rest)*) $($rest)*)194 };195196 (cond $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} else {$($block:tt)*} $($rest:tt)*) => {197 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* else {$($block)*}) $($parse)*} $($rest)*)196 (cond $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($else:tt $brace:tt $($dup:tt)*) else {$($block:tt)*} $($rest:tt)*) => {197 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $else $brace) $($parse)*} ($($rest)*) $($rest)*)198 };199200 (cond $stack:tt $bail:tt (~$($fuel:tt)*) $parse:tt $($rest:tt)*) => {201 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) $parse $($rest)*)200 (cond $stack:tt $bail:tt (~$($fuel:tt)*) $parse:tt $dup:tt $($rest:tt)*) => {201 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) $parse $dup $($rest)*)202 };203204 // atomic expressions205206 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($($paren:tt)*) $($rest:tt)*) => {207 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* ($($paren)*)) $($parse)*} $($rest)*)206 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($paren:tt $($dup:tt)*) ($($content:tt)*) $($rest:tt)*) => {207 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $paren) $($parse)*} ($($rest)*) $($rest)*)208 };209210 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} [$($array:tt)*] $($rest:tt)*) => {211 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* [$($array)*]) $($parse)*} $($rest)*)210 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($bracket:tt $($dup:tt)*) [$($array:tt)*] $($rest:tt)*) => {211 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $bracket) $($parse)*} ($($rest)*) $($rest)*)212 };213214 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} {$($block:tt)*} $($rest:tt)*) => {215 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* {$($block)*}) $($parse)*} $($rest)*)214 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($brace:tt $($dup:tt)*) {$($block:tt)*} $($rest:tt)*) => {215 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $brace) $($parse)*} ($($rest)*) $($rest)*)216 };217218 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} loop {$($block:tt)*} $($rest:tt)*) => {219 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* loop {$($block)*}) $($parse)*} $($rest)*)218 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($loop:tt $block:tt $($dup:tt)*) loop {$($body:tt)*} $($rest:tt)*) => {219 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $loop $block) $($parse)*} ($($rest)*) $($rest)*)220 };221222 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} async {$($block:tt)*} $($rest:tt)*) => {223 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* async {$($block)*}) $($parse)*} $($rest)*)222 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($async:tt $block:tt $($dup:tt)*) async {$($body:tt)*} $($rest:tt)*) => {223 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $async $block) $($parse)*} ($($rest)*) $($rest)*)224 };225226 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} async move {$($block:tt)*} $($rest:tt)*) => {227 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* async move {$($block)*}) $($parse)*} $($rest)*)226 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($async:tt $move:tt $block:tt $($dup:tt)*) async move {$($body:tt)*} $($rest:tt)*) => {227 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $async $move $block) $($parse)*} ($($rest)*) $($rest)*)228 };229230 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} unsafe {$($block:tt)*} $($rest:tt)*) => {231 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* unsafe {$($block)*}) $($parse)*} $($rest)*)230 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($unsafe:tt $block:tt $($dup:tt)*) unsafe {$($body:tt)*} $($rest:tt)*) => {231 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $unsafe $block) $($parse)*} ($($rest)*) $($rest)*)232 };233234 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $lit:literal $($rest:tt)*) => {235 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $lit) $($parse)*} $($rest)*)234 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $dup:tt $lit:literal $($rest:tt)*) => {235 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $lit) $($parse)*} ($($rest)*) $($rest)*)236 };237238 // path expressions239240 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} :: $($rest:tt)*) => {241 $crate::__parse_ensure!(path $stack $bail ($($fuel)*) {($($buf)* ::) $($parse)*} $($rest)*)240 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($colons:tt $($dup:tt)*) :: $($rest:tt)*) => {241 $crate::__parse_ensure!(path $stack $bail ($($fuel)*) {($($buf)* $colons) $($parse)*} ($($rest)*) $($rest)*)242 };243244 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $ident:ident $($rest:tt)*) => {245 $crate::__parse_ensure!(component $stack $bail ($($fuel)*) {($($buf)* $ident) $($parse)*} $($rest)*)244 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $dup:tt $ident:ident $($rest:tt)*) => {245 $crate::__parse_ensure!(component $stack $bail ($($fuel)*) {($($buf)* $ident) $($parse)*} ($($rest)*) $($rest)*)246 };247248 (path $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $ident:ident $($rest:tt)*) => {249 $crate::__parse_ensure!(component $stack $bail ($($fuel)*) {($($buf)* $ident) $($parse)*} $($rest)*)248 (path $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $dup:tt $ident:ident $($rest:tt)*) => {249 $crate::__parse_ensure!(component $stack $bail ($($fuel)*) {($($buf)* $ident) $($parse)*} ($($rest)*) $($rest)*)250 };251252 (component $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} :: < $($rest:tt)*) => {253 $crate::__parse_ensure!(generic (component $stack) $bail ($($fuel)*) {($($buf)* :: <) $($parse)*} $($rest)*)252 (component $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($colons:tt $langle:tt $($dup:tt)*) :: < $($rest:tt)*) => {253 $crate::__parse_ensure!(generic (component $stack) $bail ($($fuel)*) {($($buf)* $colons $langle) $($parse)*} ($($rest)*) $($rest)*)254 };255256 (component $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} :: << $($rest:tt)*) => {257 $crate::__parse_ensure!(generic (component $stack) $bail ($($fuel)*) {($($buf)* :: <) $($parse)*} < $($rest)*)256 (component $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($colons:tt $($dup:tt)*) :: << $($rest:tt)*) => {257 $crate::__parse_ensure!(generic (component $stack) $bail ($($fuel)*) {($($buf)* $colons <) $($parse)*} (< $($rest)*) < $($rest)*)258 };259260 (component $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} :: $($rest:tt)*) => {261 $crate::__parse_ensure!(path $stack $bail ($($fuel)*) {($($buf)* ::) $($parse)*} $($rest)*)260 (component $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($colons:tt $($dup:tt)*) :: $($rest:tt)*) => {261 $crate::__parse_ensure!(path $stack $bail ($($fuel)*) {($($buf)* $colons) $($parse)*} ($($rest)*) $($rest)*)262 };263264 // macro invocations265266 (component $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ! ($($mac:tt)*) $($rest:tt)*) => {267 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* ! ($($mac)*)) $($parse)*} $($rest)*)266 (component $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($bang:tt $args:tt $($dup:tt)*) ! ($($mac:tt)*) $($rest:tt)*) => {267 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $bang $args) $($parse)*} ($($rest)*) $($rest)*)268 };269270 (component $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ! [$($mac:tt)*] $($rest:tt)*) => {271 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* ! [$($mac)*]) $($parse)*} $($rest)*)270 (component $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($bang:tt $args:tt $($dup:tt)*) ! [$($mac:tt)*] $($rest:tt)*) => {271 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $bang $args) $($parse)*} ($($rest)*) $($rest)*)272 };273274 (component $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ! {$($mac:tt)*} $($rest:tt)*) => {275 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* ! {$($mac)*}) $($parse)*} $($rest)*)274 (component $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($bang:tt $args:tt $($dup:tt)*) ! {$($mac:tt)*} $($rest:tt)*) => {275 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $bang $args) $($parse)*} ($($rest)*) $($rest)*)276 };277278 (component $stack:tt $bail:tt (~$($fuel:tt)*) $parse:tt $($rest:tt)*) => {279 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) $parse $($rest)*)278 (component $stack:tt $bail:tt (~$($fuel:tt)*) $parse:tt $dup:tt $($rest:tt)*) => {279 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) $parse $dup $($rest)*)280 };281282 // trailer expressions283284 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($($call:tt)*) $($rest:tt)*) => {285 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* ($($call)*)) $($parse)*} $($rest)*)284 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($paren:tt $($dup:tt)*) ($($call:tt)*) $($rest:tt)*) => {285 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $paren) $($parse)*} ($($rest)*) $($rest)*)286 };287288 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} [$($index:tt)*] $($rest:tt)*) => {289 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* [$($index)*]) $($parse)*} $($rest)*)288 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($bracket:tt $($dup:tt)*) [$($index:tt)*] $($rest:tt)*) => {289 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $bracket) $($parse)*} ($($rest)*) $($rest)*)290 };291292 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} {$($init:tt)*} $($rest:tt)*) => {293 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* {$($init)*}) $($parse)*} $($rest)*)292 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($brace:tt $($dup:tt)*) {$($init:tt)*} $($rest:tt)*) => {293 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $brace) $($parse)*} ($($rest)*) $($rest)*)294 };295296 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ? $($rest:tt)*) => {297 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* ?) $($parse)*} $($rest)*)296 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($question:tt $($dup:tt)*) ? $($rest:tt)*) => {297 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $question) $($parse)*} ($($rest)*) $($rest)*)298 };299300 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} . $ident:ident :: < $($rest:tt)*) => {301 $crate::__parse_ensure!(generic (atom $stack) $bail ($($fuel)*) {($($buf)* . $ident :: <) $($parse)*} $($rest)*)300 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($dot:tt $ident:tt $colons:tt $langle:tt $($dup:tt)*) . $i:ident :: < $($rest:tt)*) => {301 $crate::__parse_ensure!(generic (atom $stack) $bail ($($fuel)*) {($($buf)* $dot $ident $colons $langle) $($parse)*} ($($rest)*) $($rest)*)302 };303304 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} . $ident:ident :: << $($rest:tt)*) => {305 $crate::__parse_ensure!(generic (atom $stack) $bail ($($fuel)*) {($($buf)* . $ident :: <) $($parse)*} < $($rest)*)304 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($dot:tt $ident:tt $colons:tt $($dup:tt)*) . $i:ident :: << $($rest:tt)*) => {305 $crate::__parse_ensure!(generic (atom $stack) $bail ($($fuel)*) {($($buf)* $dot $ident $colons <) $($parse)*} (< $($rest)*) < $($rest)*)306 };307308 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} . $ident:ident $($rest:tt)*) => {309 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* . $ident) $($parse)*} $($rest)*)308 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($dot:tt $($dup:tt)*) . $index:tt $($rest:tt)*) => {309 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $dot $index) $($parse)*} ($($rest)*) $($rest)*)310 };311312 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} . $lit:tt $($rest:tt)*) => {313 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* . $lit) $($parse)*} $($rest)*)314 };315312 // angle bracketed generic arguments313318 (generic ($pop:ident $stack:tt) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} > $($rest:tt)*) => {319 $crate::__parse_ensure!($pop $stack $bail ($($fuel)*) {($($buf)* >) $($parse)*} $($rest)*)314 (generic ($pop:ident $stack:tt) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($rangle:tt $($dup:tt)*) > $($rest:tt)*) => {315 $crate::__parse_ensure!($pop $stack $bail ($($fuel)*) {($($buf)* $rangle) $($parse)*} ($($rest)*) $($rest)*)316 };317322 (generic $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $lit:literal $($rest:tt)*) => {323 $crate::__parse_ensure!(arglist $stack $bail ($($fuel)*) {($($buf)* $lit) $($parse)*} $($rest)*)318 (generic $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $dup:tt $lit:literal $($rest:tt)*) => {319 $crate::__parse_ensure!(arglist $stack $bail ($($fuel)*) {($($buf)* $lit) $($parse)*} ($($rest)*) $($rest)*)320 };321326 (generic $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} {$($block:tt)*} $($rest:tt)*) => {327 $crate::__parse_ensure!(arglist $stack $bail ($($fuel)*) {($($buf)* {$($block)*}) $($parse)*} $($rest)*)322 (generic $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($brace:tt $($dup:tt)*) {$($block:tt)*} $($rest:tt)*) => {323 $crate::__parse_ensure!(arglist $stack $bail ($($fuel)*) {($($buf)* $brace) $($parse)*} ($($rest)*) $($rest)*)324 };325330 (generic $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $life:lifetime $($rest:tt)*) => {331 $crate::__parse_ensure!(arglist $stack $bail ($($fuel)*) {($($buf)* $life) $($parse)*} $($rest)*)326 (generic $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $dup:tt $life:lifetime $($rest:tt)*) => {327 $crate::__parse_ensure!(arglist $stack $bail ($($fuel)*) {($($buf)* $life) $($parse)*} ($($rest)*) $($rest)*)328 };329334 (generic $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $ty:ty , $($rest:tt)*) => {335 $crate::__parse_ensure!(generic $stack $bail ($($fuel)*) {($($buf)* $ty ,) $($parse)*} $($rest)*)330 (generic $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $dup:tt $ty:ty , $($rest:tt)*) => {331 $crate::__parse_ensure!(generic $stack $bail ($($fuel)*) {($($buf)* $ty ,) $($parse)*} ($($rest)*) $($rest)*)332 };333338 (generic ($pop:ident $stack:tt) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $ty:ty > $($rest:tt)*) => {339 $crate::__parse_ensure!($pop $stack $bail ($($fuel)*) {($($buf)* $ty >) $($parse)*} $($rest)*)334 (generic ($pop:ident $stack:tt) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $dup:tt $ty:ty > $($rest:tt)*) => {335 $crate::__parse_ensure!($pop $stack $bail ($($fuel)*) {($($buf)* $ty >) $($parse)*} ($($rest)*) $($rest)*)336 };337342 (arglist $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} , $($rest:tt)*) => {343 $crate::__parse_ensure!(generic $stack $bail ($($fuel)*) {($($buf)* ,) $($parse)*} $($rest)*)338 (arglist $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($comma:tt $($dup:tt)*) , $($rest:tt)*) => {339 $crate::__parse_ensure!(generic $stack $bail ($($fuel)*) {($($buf)* $comma) $($parse)*} ($($rest)*) $($rest)*)340 };341346 (arglist ($pop:ident $stack:tt) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} > $($rest:tt)*) => {347 $crate::__parse_ensure!($pop $stack $bail ($($fuel)*) {($($buf)* >) $($parse)*} $($rest)*)342 (arglist ($pop:ident $stack:tt) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($rangle:tt $($dup:tt)*) > $($rest:tt)*) => {343 $crate::__parse_ensure!($pop $stack $bail ($($fuel)*) {($($buf)* $rangle) $($parse)*} ($($rest)*) $($rest)*)344 };345346 // high precedence binary operators347352 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} + $($rest:tt)*) => {353 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* +) $($parse)*} $($rest)*)348 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($add:tt $($dup:tt)*) + $($rest:tt)*) => {349 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $add) $($parse)*} ($($rest)*) $($rest)*)350 };351356 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} - $($rest:tt)*) => {357 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* -) $($parse)*} $($rest)*)352 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($sub:tt $($dup:tt)*) - $($rest:tt)*) => {353 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $sub) $($parse)*} ($($rest)*) $($rest)*)354 };355360 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} * $($rest:tt)*) => {361 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* *) $($parse)*} $($rest)*)356 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($mul:tt $($dup:tt)*) * $($rest:tt)*) => {357 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $mul) $($parse)*} ($($rest)*) $($rest)*)358 };359364 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} / $($rest:tt)*) => {365 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* /) $($parse)*} $($rest)*)360 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($div:tt $($dup:tt)*) / $($rest:tt)*) => {361 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $div) $($parse)*} ($($rest)*) $($rest)*)362 };363368 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} % $($rest:tt)*) => {369 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* %) $($parse)*} $($rest)*)364 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($rem:tt $($dup:tt)*) % $($rest:tt)*) => {365 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $rem) $($parse)*} ($($rest)*) $($rest)*)366 };367372 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ^ $($rest:tt)*) => {373 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* ^) $($parse)*} $($rest)*)368 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($bitxor:tt $($dup:tt)*) ^ $($rest:tt)*) => {369 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $bitxor) $($parse)*} ($($rest)*) $($rest)*)370 };371376 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} & $($rest:tt)*) => {377 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* &) $($parse)*} $($rest)*)372 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($bitand:tt $($dup:tt)*) & $($rest:tt)*) => {373 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $bitand) $($parse)*} ($($rest)*) $($rest)*)374 };375380 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} | $($rest:tt)*) => {381 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* |) $($parse)*} $($rest)*)376 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($bitor:tt $($dup:tt)*) | $($rest:tt)*) => {377 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $bitor) $($parse)*} ($($rest)*) $($rest)*)378 };379384 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} << $($rest:tt)*) => {385 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* <<) $($parse)*} $($rest)*)380 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($shl:tt $($dup:tt)*) << $($rest:tt)*) => {381 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $shl) $($parse)*} ($($rest)*) $($rest)*)382 };383388 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} >> $($rest:tt)*) => {389 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* >>) $($parse)*} $($rest)*)384 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($shr:tt $($dup:tt)*) >> $($rest:tt)*) => {385 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $shr) $($parse)*} ($($rest)*) $($rest)*)386 };387388 // comparison binary operators389394 (atom () $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} == $($rest:tt)*) => {395 $crate::__parse_ensure!(0 () $bail ($($fuel)*) {() $($parse)* ($($buf)*) ==} $($rest)*)390 (atom () $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($eq:tt $($dup:tt)*) == $($rest:tt)*) => {391 $crate::__parse_ensure!(0 () $bail ($($fuel)*) {() $($parse)* ($($buf)*) $eq} ($($rest)*) $($rest)*)392 };393398 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)+) $($parse:tt)*} == $($rest:tt)*) => {399 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* ==) $($parse)*} $($rest)*)394 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)+) $($parse:tt)*} ($eq:tt $($dup:tt)*) == $($rest:tt)*) => {395 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $eq) $($parse)*} ($($rest)*) $($rest)*)396 };397402 (atom () $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} <= $($rest:tt)*) => {403 $crate::__parse_ensure!(0 () $bail ($($fuel)*) {() $($parse)* ($($buf)*) <=} $($rest)*)398 (atom () $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($le:tt $($dup:tt)*) <= $($rest:tt)*) => {399 $crate::__parse_ensure!(0 () $bail ($($fuel)*) {() $($parse)* ($($buf)*) $le} ($($rest)*) $($rest)*)400 };401406 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)+) $($parse:tt)*} <= $($rest:tt)*) => {407 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* <=) $($parse)*} $($rest)*)402 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)+) $($parse:tt)*} ($le:tt $($dup:tt)*) <= $($rest:tt)*) => {403 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $le) $($parse)*} ($($rest)*) $($rest)*)404 };405410 (atom () $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} < $($rest:tt)*) => {411 $crate::__parse_ensure!(0 () $bail ($($fuel)*) {() $($parse)* ($($buf)*) <} $($rest)*)406 (atom () $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($lt:tt $($dup:tt)*) < $($rest:tt)*) => {407 $crate::__parse_ensure!(0 () $bail ($($fuel)*) {() $($parse)* ($($buf)*) $lt} ($($rest)*) $($rest)*)408 };409414 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)+) $($parse:tt)*} < $($rest:tt)*) => {415 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* <) $($parse)*} $($rest)*)410 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)+) $($parse:tt)*} ($lt:tt $($dup:tt)*) < $($rest:tt)*) => {411 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $lt) $($parse)*} ($($rest)*) $($rest)*)412 };413418 (atom () $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} != $($rest:tt)*) => {419 $crate::__parse_ensure!(0 () $bail ($($fuel)*) {() $($parse)* ($($buf)*) !=} $($rest)*)414 (atom () $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($ne:tt $($dup:tt)*) != $($rest:tt)*) => {415 $crate::__parse_ensure!(0 () $bail ($($fuel)*) {() $($parse)* ($($buf)*) $ne} ($($rest)*) $($rest)*)416 };417422 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)+) $($parse:tt)*} != $($rest:tt)*) => {423 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* !=) $($parse)*} $($rest)*)418 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)+) $($parse:tt)*} ($ne:tt $($dup:tt)*) != $($rest:tt)*) => {419 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $ne) $($parse)*} ($($rest)*) $($rest)*)420 };421426 (atom () $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} >= $($rest:tt)*) => {427 $crate::__parse_ensure!(0 () $bail ($($fuel)*) {() $($parse)* ($($buf)*) >=} $($rest)*)422 (atom () $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($ge:tt $($dup:tt)*) >= $($rest:tt)*) => {423 $crate::__parse_ensure!(0 () $bail ($($fuel)*) {() $($parse)* ($($buf)*) $ge} ($($rest)*) $($rest)*)424 };425430 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)+) $($parse:tt)*} >= $($rest:tt)*) => {431 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* >=) $($parse)*} $($rest)*)426 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)+) $($parse:tt)*} ($ge:tt $($dup:tt)*) >= $($rest:tt)*) => {427 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $ge) $($parse)*} ($($rest)*) $($rest)*)428 };429434 (atom () $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} > $($rest:tt)*) => {435 $crate::__parse_ensure!(0 () $bail ($($fuel)*) {() $($parse)* ($($buf)*) >} $($rest)*)430 (atom () $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($gt:tt $($dup:tt)*) > $($rest:tt)*) => {431 $crate::__parse_ensure!(0 () $bail ($($fuel)*) {() $($parse)* ($($buf)*) $gt} ($($rest)*) $($rest)*)432 };433438 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)+) $($parse:tt)*} > $($rest:tt)*) => {439 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* >) $($parse)*} $($rest)*)434 (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)+) $($parse:tt)*} ($gt:tt $($dup:tt)*) > $($rest:tt)*) => {435 $crate::__parse_ensure!(0 $stack $bail ($($fuel)*) {($($buf)* $gt) $($parse)*} ($($rest)*) $($rest)*)436 };437438 // low precedence binary operators439444 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} && $($rest:tt)*) => {445 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* &&) $($parse)*} $($rest)*)440 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($and:tt $($dup:tt)*) && $($rest:tt)*) => {441 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* $and) $($parse)*} ($($rest)*) $($rest)*)442 };443448 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} || $($rest:tt)*) => {449 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* ||) $($parse)*} $($rest)*)444 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($or:tt $($dup:tt)*) || $($rest:tt)*) => {445 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* $or) $($parse)*} ($($rest)*) $($rest)*)446 };447452 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} = $($rest:tt)*) => {453 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* =) $($parse)*} $($rest)*)448 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($assign:tt $($dup:tt)*) = $($rest:tt)*) => {449 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* $assign) $($parse)*} ($($rest)*) $($rest)*)450 };451456 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} += $($rest:tt)*) => {457 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* +=) $($parse)*} $($rest)*)452 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($addeq:tt $($dup:tt)*) += $($rest:tt)*) => {453 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* $addeq) $($parse)*} ($($rest)*) $($rest)*)454 };455460 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} -= $($rest:tt)*) => {461 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* -=) $($parse)*} $($rest)*)456 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($subeq:tt $($dup:tt)*) -= $($rest:tt)*) => {457 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* $subeq) $($parse)*} ($($rest)*) $($rest)*)458 };459464 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} *= $($rest:tt)*) => {465 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* *=) $($parse)*} $($rest)*)460 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($muleq:tt $($dup:tt)*) *= $($rest:tt)*) => {461 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* $muleq) $($parse)*} ($($rest)*) $($rest)*)462 };463468 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} /= $($rest:tt)*) => {469 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* /=) $($parse)*} $($rest)*)464 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($diveq:tt $($dup:tt)*) /= $($rest:tt)*) => {465 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* $diveq) $($parse)*} ($($rest)*) $($rest)*)466 };467472 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} %= $($rest:tt)*) => {473 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* %=) $($parse)*} $($rest)*)468 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($remeq:tt $($dup:tt)*) %= $($rest:tt)*) => {469 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* $remeq) $($parse)*} ($($rest)*) $($rest)*)470 };471476 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ^= $($rest:tt)*) => {477 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* ^=) $($parse)*} $($rest)*)472 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($bitxoreq:tt $($dup:tt)*) ^= $($rest:tt)*) => {473 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* $bitxoreq) $($parse)*} ($($rest)*) $($rest)*)474 };475480 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} &= $($rest:tt)*) => {481 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* &=) $($parse)*} $($rest)*)476 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($bitandeq:tt $($dup:tt)*) &= $($rest:tt)*) => {477 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* $bitandeq) $($parse)*} ($($rest)*) $($rest)*)478 };479484 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} |= $($rest:tt)*) => {485 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* |=) $($parse)*} $($rest)*)480 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($bitoreq:tt $($dup:tt)*) |= $($rest:tt)*) => {481 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* $bitoreq) $($parse)*} ($($rest)*) $($rest)*)482 };483488 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} <<= $($rest:tt)*) => {489 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* <<=) $($parse)*} $($rest)*)484 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($shleq:tt $($dup:tt)*) <<= $($rest:tt)*) => {485 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* $shleq) $($parse)*} ($($rest)*) $($rest)*)486 };487492 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} >>= $($rest:tt)*) => {493 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* >>=) $($parse)*} $($rest)*)488 (atom ($($stack:tt)+) $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($shreq:tt $($dup:tt)*) >>= $($rest:tt)*) => {489 $crate::__parse_ensure!(0 ($($stack)*) $bail ($($fuel)*) {($($buf)* $shreq) $($parse)*} ($($rest)*) $($rest)*)490 };491492 // unrecognized expression493
47 unmodified lines
modified:src/macros.rs+1 added
168 unmodified lines
169 /* stack */ ()170 /* bail */ ($($tt)*)171 /* fuel */ (~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~)172 /* parse */ {()}173 /* dup */ ($($tt)*)174 /* rest */ $($tt)*175 )176 };177}
46 unmodified lines
modified:tests/test_ensure.rs+7 added-1 removed
1#![allow(2 clippy::diverging_sub_expression,3 clippy::if_same_then_else,4 clippy::ifs_same_cond,5 clippy::let_and_return,6 clippy::let_underscore_drop,7 clippy::match_bool,8 clippy::never_loop,9 clippy::redundant_closure_call,10 clippy::redundant_pattern_matching,6 clippy::unit_arg11 clippy::unit_arg,12 clippy::while_immutable_condition13)]1415use anyhow::{anyhow, ensure, Chain, Error, Result};16use std::fmt::Debug;
387 unmodified lines