Accept name constants in the grammar
This commit is contained in:
parent
b6e525d935
commit
33e835b58d
3 changed files with 18 additions and 0 deletions
|
|
@ -139,6 +139,7 @@ static void InitTokenMap()
|
|||
|
||||
TOKENDEF (TK_Identifier, ZCC_IDENTIFIER);
|
||||
TOKENDEF (TK_StringConst, ZCC_STRCONST);
|
||||
TOKENDEF (TK_NameConst, ZCC_NAMECONST);
|
||||
TOKENDEF (TK_IntConst, ZCC_INTCONST);
|
||||
TOKENDEF (TK_UIntConst, ZCC_UINTCONST);
|
||||
TOKENDEF (TK_FloatConst, ZCC_FLOATCONST);
|
||||
|
|
@ -193,6 +194,11 @@ static void DoParse(const char *filename)
|
|||
value.String = state.Strings.Alloc(sc.String, sc.StringLen);
|
||||
tokentype = ZCC_STRCONST;
|
||||
}
|
||||
else if (sc.TokenType == TK_NameConst)
|
||||
{
|
||||
value.Int = sc.Name;
|
||||
tokentype = ZCC_NAMECONST;
|
||||
}
|
||||
else if (sc.TokenType == TK_IntConst)
|
||||
{
|
||||
value.Int = sc.Number;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue