Skip to content

Commit b249287

Browse files
committed
Support const block syntax in ensure! macro
1 parent 80d4c8d commit b249287

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ensure.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,11 @@ macro_rules! __parse_ensure {
231231
$crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $unsafe $block) $($parse)*} ($($rest)*) $($rest)*)
232232
};
233233

234+
(0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($const:tt $block:tt $($dup:tt)*) const {$($body:tt)*} $($rest:tt)*) => {
235+
// TODO: this is mostly useless due to https://github.com/rust-lang/rust/issues/86730
236+
$crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $const $block) $($parse)*} ($($rest)*) $($rest)*)
237+
};
238+
234239
(0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $dup:tt $lit:literal $($rest:tt)*) => {
235240
$crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $lit) $($parse)*} ($($rest)*) $($rest)*)
236241
};

0 commit comments

Comments
 (0)