match self.kind {
OpenDelim(Brace) => true,
Interpolated(ref nt) => match **nt {
- NtExpr(..) => true,
- NtBlock(..) => true,
- NtLiteral(..) => true,
+ NtExpr(..) | NtBlock(..) | NtLiteral(..) => true,
_ => false,
}
_ => self.can_begin_literal_or_bool(),
}
}
- crate fn expect_lit(&self) -> Lit {
- match self.kind {
- Literal(lit) => lit,
- _ => panic!("`expect_lit` called on non-literal"),
- }
- }
-
/// Returns `true` if the token is any literal, a minus (which can prefix a literal,
/// for example a '-42', or one of the boolean idents).
pub fn can_begin_literal_or_bool(&self) -> bool {