Added handling of "long int" type specifier

Just consumes and discards the "int" token and treats as if it was only
a "long".
This commit is contained in:
Russell Joyce 2020-06-10 18:24:12 +01:00
parent b403e76600
commit 9fd31b6d37
No known key found for this signature in database
GPG key ID: 3D46BD9018AF7B72

8
type.c
View file

@ -457,6 +457,14 @@ int TypeParseFront(struct ParseState *Parser, struct ValueType **Typ,
Token = LexGetToken(Parser, &LexerValue, true);
}
/* handle long with trailing int by consuming and ignoring the int */
if (Token == TokenLongType) {
enum LexToken FollowToken = LexGetToken(Parser, &LexerValue, false);
if (FollowToken == TokenIntType) {
LexGetToken(Parser, &LexerValue, true);
}
}
switch (Token) {
case TokenIntType:
*Typ = Unsigned ? &pc->UnsignedIntType : &pc->IntType;