Use verbose suggestions and only match if the + is seen before a numeric literal
This commit is contained in:
parent
bc9877c5af
commit
65eb7e516c
9 changed files with 58 additions and 95 deletions
|
@ -586,6 +586,10 @@ impl Token {
|
|||
self.is_non_raw_ident_where(|id| id.name.is_bool_lit())
|
||||
}
|
||||
|
||||
pub fn is_numeric_lit(&self) -> bool {
|
||||
matches!(self.kind, Literal(Lit { kind: LitKind::Integer, ..}) | Literal(Lit { kind: LitKind::Float, ..}))
|
||||
}
|
||||
|
||||
/// Returns `true` if the token is a non-raw identifier for which `pred` holds.
|
||||
pub fn is_non_raw_ident_where(&self, pred: impl FnOnce(Ident) -> bool) -> bool {
|
||||
match self.ident() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue