Skip to content

Commit

Permalink
Fixed bug in enum declaration requiring a variable name
Browse files Browse the repository at this point in the history
git-svn-id: http://picoc.googlecode.com/svn/trunk@187 21eae674-98b7-11dd-bd71-f92a316d2d60
  • Loading branch information
zik.saleeba committed Mar 10, 2009
1 parent 5883534 commit 6a586ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void ParseDeclaration(struct ParseState *Parser, enum LexToken Token)
do
{
TypeParseIdentPart(Parser, BasicType, &Typ, &Identifier);
if ((Token != TokenVoidType && Token != TokenStructType && Token != TokenUnionType) && Identifier == StrEmpty)
if ((Token != TokenVoidType && Token != TokenStructType && Token != TokenUnionType && Token != TokenEnumType) && Identifier == StrEmpty)
ProgramFail(Parser, "identifier expected");

if (Identifier != StrEmpty)
Expand Down
4 changes: 3 additions & 1 deletion tests/17_enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ enum fred
f = 73,
g,
h
} frod;
};

enum fred frod;

printf("%d %d %d %d %d %d %d %d\n", a, b, c, d, e, f, g, h);
printf("%d\n", frod);
Expand Down

0 comments on commit 6a586ce

Please sign in to comment.