Parse labeled blocks as ExprVerbatim
diff --git a/src/expr.rs b/src/expr.rs
index 6b7e07b..8fc532c 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -1614,6 +1614,8 @@
|
cond_reduce!(allow_block, syn!(ExprBlock)) => { Expr::Block }
|
+ call!(unstable_labeled_block) => { Expr::Verbatim }
+ |
// NOTE: This is the prefix-form of range
call!(expr_range, allow_struct)
|
@@ -1655,6 +1657,8 @@
syn!(ExprUnsafe) => { Expr::Unsafe }
|
syn!(ExprBlock) => { Expr::Block }
+ |
+ call!(unstable_labeled_block) => { Expr::Verbatim }
) >>
// If the next token is a `.` or a `?` it is special-cased to parse
// as an expression instead of a blockexpression.
@@ -2451,6 +2455,21 @@
}
#[cfg(feature = "full")]
+ named!(unstable_labeled_block -> ExprVerbatim, do_parse!(
+ begin: call!(verbatim::grab_cursor) >>
+ many0!(Attribute::parse_outer) >>
+ option!(syn!(Label)) >>
+ braces!(tuple!(
+ many0!(Attribute::parse_inner),
+ call!(Block::parse_within),
+ )) >>
+ end: call!(verbatim::grab_cursor) >>
+ (ExprVerbatim {
+ tts: verbatim::token_range(begin..end),
+ })
+ ));
+
+ #[cfg(feature = "full")]
named!(expr_range(allow_struct: bool) -> Expr, do_parse!(
limits: syn!(RangeLimits) >>
hi: opt_ambiguous_expr!(allow_struct) >>