Now parses but ignores signed/unsigned declarations
git-svn-id: http://picoc.googlecode.com/svn/trunk@325 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
parent
44eb3d3def
commit
637e224fff
2
parse.c
2
parse.c
|
@ -384,6 +384,8 @@ enum ParseResult ParseStatement(struct ParseState *Parser)
|
||||||
case TokenStructType:
|
case TokenStructType:
|
||||||
case TokenUnionType:
|
case TokenUnionType:
|
||||||
case TokenEnumType:
|
case TokenEnumType:
|
||||||
|
case TokenSignedType:
|
||||||
|
case TokenUnsignedType:
|
||||||
*Parser = PreState;
|
*Parser = PreState;
|
||||||
CheckTrailingSemicolon = ParseDeclaration(Parser, Token);
|
CheckTrailingSemicolon = ParseDeclaration(Parser, Token);
|
||||||
break;
|
break;
|
||||||
|
|
15
type.c
15
type.c
|
@ -288,9 +288,22 @@ int TypeParseFront(struct ParseState *Parser, struct ValueType **Typ)
|
||||||
enum LexToken Token = LexGetToken(Parser, NULL, TRUE);
|
enum LexToken Token = LexGetToken(Parser, NULL, TRUE);
|
||||||
*Typ = NULL;
|
*Typ = NULL;
|
||||||
|
|
||||||
|
/* just ignore signed/unsigned for now */
|
||||||
|
if (Token == TokenSignedType || Token == TokenUnsignedType)
|
||||||
|
{
|
||||||
|
Token = LexGetToken(Parser, NULL, FALSE);
|
||||||
|
if (Token != TokenIntType && Token != TokenLongType && Token != TokenShortType && Token != TokenCharType)
|
||||||
|
{
|
||||||
|
*Typ = &IntType;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Token = LexGetToken(Parser, NULL, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
switch (Token)
|
switch (Token)
|
||||||
{
|
{
|
||||||
case TokenIntType: case TokenLongType: case TokenShortType: *Typ = &IntType; break;
|
case TokenIntType: case TokenLongType: case TokenShortType: case TokenSignedType: case TokenUnsignedType: *Typ = &IntType; break;
|
||||||
case TokenCharType: *Typ = &CharType; break;
|
case TokenCharType: *Typ = &CharType; break;
|
||||||
#ifndef NO_FP
|
#ifndef NO_FP
|
||||||
case TokenFloatType: case TokenDoubleType: *Typ = &FPType; break;
|
case TokenFloatType: case TokenDoubleType: *Typ = &FPType; break;
|
||||||
|
|
Loading…
Reference in a new issue