parent
b29a1e00f8
commit
e65c060d78
4 changed files with 47 additions and 0 deletions
|
@ -756,6 +756,11 @@ impl Token {
|
|||
)
|
||||
}
|
||||
|
||||
/// Returns `true` if the token is the integer literal.
|
||||
pub fn is_integer_lit(&self) -> bool {
|
||||
matches!(self.kind, Literal(Lit { kind: LitKind::Integer, .. }))
|
||||
}
|
||||
|
||||
/// 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