summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorragge <ragge>2009-08-13 16:59:01 +0000
committerragge <ragge>2009-08-13 16:59:01 +0000
commit55519c3fb700154a19d78b51af77a2e097c83028 (patch)
tree647a51a2c44bc40865658866497182b9ee0c6386
parent6973828c20f1f6dfeec2282258180ceaaa5017ab (diff)
Handling of character constants in #if expressions broke when the preprocessor
were changed recently. Fixes Jira#PCC-77 by Detlef Riekenberg.
-rw-r--r--token.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/token.c b/token.c
index a4d967c..b11772a 100644
--- a/token.c
+++ b/token.c
@@ -375,8 +375,6 @@ chlit:
}
yytext[yyp] = 0;
- yylval.node.op = NUMBER;
- yylval.node.nd_val = charcon((usch *)yytext);
return (NUMBER);
case ' ':
@@ -538,10 +536,16 @@ yylex()
if (ch == c2)
badop("");
break;
+
case NUMBER:
- cvtdig(yytext[0] != '0' ? 10 :
- yytext[1] == 'x' || yytext[1] == 'X' ? 16 : 8);
+ if (yytext[0] == '\'') {
+ yylval.node.op = NUMBER;
+ yylval.node.nd_val = charcon((usch *)yytext);
+ } else
+ cvtdig(yytext[0] != '0' ? 10 :
+ yytext[1] == 'x' || yytext[1] == 'X' ? 16 : 8);
return NUMBER;
+
case IDENT:
if (strcmp(yytext, "defined") == 0) {
ifdef = 1;