Added handling of "short int" type specifier

Just consumes and discards the "int" token and treats as if it was only
a "short".
This commit is contained in:
Russell Joyce 2020-06-18 17:20:02 +01:00
parent 3979f563aa
commit 7b43483f68
No known key found for this signature in database
GPG key ID: 3D46BD9018AF7B72
2 changed files with 9 additions and 4 deletions

View file

@ -8,8 +8,13 @@ long int e;
unsigned long f;
unsigned long int g;
volatile int i;
int volatile static j;
short h;
short int i;
unsigned short j;
unsigned short int k;
volatile int l;
int volatile static m;
const int x;
long const y;

4
type.c
View file

@ -464,8 +464,8 @@ 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) {
/* handle long or short with trailing int by consuming and ignoring the int */
if (Token == TokenLongType || Token == TokenShortType) {
enum LexToken FollowToken = LexGetToken(Parser, NULL, false);
if (FollowToken == TokenIntType) {
LexGetToken(Parser, NULL, true);