Let the grammar accept unsigned integer constants
This commit is contained in:
parent
33344201fa
commit
1b4851224e
2 changed files with 17 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue