'label can start expressions

let foo = 'label: loop { break 'label 42; };

is valid Rust code.
This commit is contained in:
est31 2018-04-22 13:34:42 +02:00
parent 9af69fe232
commit 40f2ca2c95

View file

@ -277,9 +277,10 @@ impl Token {
DotDot | DotDotDot | DotDotEq | // range notation
Lt | BinOp(Shl) | // associated path
ModSep | // global path
Lifetime(..) | // labeled loop
Pound => true, // expression attributes
Interpolated(ref nt) => match nt.0 {
NtIdent(..) | NtExpr(..) | NtBlock(..) | NtPath(..) => true,
NtIdent(..) | NtExpr(..) | NtBlock(..) | NtPath(..) | NtLifetime(..) => true,
_ => false,
},
_ => false,