aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/token.h
diff options
context:
space:
mode:
Diffstat (limited to 'token.h')
-rw-r--r--token.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/token.h b/token.h
index 292db167..33a6eda1 100644
--- a/token.h
+++ b/token.h
@@ -241,4 +241,11 @@ static inline int match_ident(struct token *token, struct ident *id)
return token->pos.type == TOKEN_IDENT && token->ident == id;
}
+static inline int match_token_zero(struct token *token)
+{
+ if (token_type(token) != TOKEN_NUMBER)
+ return false;
+ return token->number[0] == '0' && !token->number[1];
+}
+
#endif