Let the grammar accept unsigned integer constants

This commit is contained in:
Randy Heit 2013-09-10 21:44:32 -05:00
commit 1b4851224e
2 changed files with 17 additions and 1 deletions

View file

@ -140,6 +140,7 @@ static void InitTokenMap()
TOKENDEF (TK_Identifier, ZCC_IDENTIFIER);
TOKENDEF (TK_StringConst, ZCC_STRCONST);
TOKENDEF (TK_IntConst, ZCC_INTCONST);
TOKENDEF (TK_UIntConst, ZCC_UINTCONST);
TOKENDEF (TK_FloatConst, ZCC_FLOATCONST);
TOKENDEF (TK_NonWhitespace, ZCC_NWS);
}
@ -197,6 +198,11 @@ static void DoParse(const char *filename)
value.Int = sc.Number;
tokentype = ZCC_INTCONST;
}
else if (sc.TokenType == TK_UIntConst)
{
value.Int = sc.Number;
tokentype = ZCC_UINTCONST;
}
else if (sc.TokenType == TK_FloatConst)
{
value.Float = sc.Float;