Add error message for bad enum declaration syntax.

BIT-1273 #close
This commit is contained in:
Jon Siwek 2014-10-15 10:20:47 -05:00
parent 191e5da74d
commit ccc88beeee
3 changed files with 11 additions and 2 deletions

View file

@ -1,4 +1,9 @@
2.3-235 | 2014-10-15 10:20:47 -0500
* BIT-1273: Add error message for bad enum declaration syntax.
(Jon Siwek)
2.3-234 | 2014-10-14 14:42:09 -0500 2.3-234 | 2014-10-14 14:42:09 -0500
* Documentation fixes. (Steve Smoot) * Documentation fixes. (Steve Smoot)

View file

@ -1 +1 @@
2.3-234 2.3-235

View file

@ -127,7 +127,11 @@ static void parser_new_enum (void)
{ {
/* Starting a new enum definition. */ /* Starting a new enum definition. */
assert(cur_enum_type == NULL); assert(cur_enum_type == NULL);
cur_enum_type = new EnumType(cur_decl_type_id->Name());
if ( cur_decl_type_id )
cur_enum_type = new EnumType(cur_decl_type_id->Name());
else
reporter->FatalError("incorrect syntax for enum type declaration");
} }
static void parser_redef_enum (ID *id) static void parser_redef_enum (ID *id)