aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/expression.c
diff options
authorChristopher Li <sparse@chrisli.org>2010-04-08 14:05:29 -0700
committerChristopher Li <sparse@chrisli.org>2010-04-08 14:39:53 -0700
commit298c360ab0d1583585ea0fdefb9f9c96aefc64fe (patch)
treebbdf526fd03331c66332e8a46b018b6b674d4bd9 /expression.c
parent703499e552b45542a328e3016868419d65143f2b (diff)
downloadsparse-dev-298c360ab0d1583585ea0fdefb9f9c96aefc64fe.tar.gz
Allow parsing L'\0'
It is nasty that L'\0' start from an identifier letter. I try my best not to slow down the hot path. The test is done inside get_one_identifier() after the ident hash is built. It look a little bit out of palace but faster than testing 'L' before hand. Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'expression.c')
-rw-r--r--expression.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/expression.c b/expression.c
index c9277da7..67e05e74 100644
--- a/expression.c
+++ b/expression.c
@@ -397,9 +397,10 @@ struct token *primary_expression(struct token *token, struct expression **tree)
switch (token_type(token)) {
case TOKEN_CHAR:
+ case TOKEN_LONG_CHAR:
expr = alloc_expression(token->pos, EXPR_VALUE);
expr->flags = Int_const_expr;
- expr->ctype = &int_ctype;
+ expr->ctype = token_type(token) == TOKEN_CHAR ? &int_ctype : &long_ctype;
expr->value = (unsigned char) token->character;
token = token->next;
break;