From 9fd31b6d37998b1d4ccbf8312ee2ec32a96e8e9a Mon Sep 17 00:00:00 2001 From: Russell Joyce Date: Wed, 10 Jun 2020 18:24:12 +0100 Subject: [PATCH] Added handling of "long int" type specifier Just consumes and discards the "int" token and treats as if it was only a "long". --- type.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/type.c b/type.c index 3a1f926..57ec289 100644 --- a/type.c +++ b/type.c @@ -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;