Changeset 67467a3 for src/Parser/parser.yy
- Timestamp:
- Mar 26, 2024, 3:17:51 PM (3 months ago)
- Branches:
- master
- Children:
- 544b799
- Parents:
- 84886499
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r84886499 r67467a3 202 202 203 203 DeclarationNode * fieldDecl( DeclarationNode * typeSpec, DeclarationNode * fieldList ) { 204 if ( ! fieldList ) { // field declarator ?205 if ( ! ( typeSpec->type && (typeSpec->type->kind == TypeData::Aggregate || typeSpec->type->kind == TypeData::Enum)) ) {204 if ( nullptr == fieldList ) { 205 if ( !( typeSpec->type && typeSpec->type->kind == TypeData::Aggregate ) ) { 206 206 stringstream ss; 207 207 // printf( "fieldDecl1 typeSpec %p\n", typeSpec ); typeSpec->type->print( std::cout ); … … 2173 2173 { 2174 2174 SemanticError( yylloc, "syntax error, expecting ';' at end of \"%s\" declaration.", 2175 $1->type->enumeration.name ? "enum" :ast::AggregateDecl::aggrString( $1->type->aggregate.kind ) );2175 ast::AggregateDecl::aggrString( $1->type->aggregate.kind ) ); 2176 2176 $$ = nullptr; 2177 2177 } … … 3245 3245 if ( $1->linkage == ast::Linkage::Cforall && ! $1->storageClasses.is_static && 3246 3246 $1->type && $1->type->kind == TypeData::AggregateInst ) { 3247 if ( $1->type->aggInst.aggregate->kind == TypeData::Enum && $1->type->aggInst.aggregate->enumeration.anon ) { 3248 SemanticError( yylloc, "extern anonymous enumeration is currently unimplemented." ); $$ = nullptr; 3249 } else if ( $1->type->aggInst.aggregate->aggregate.anon ) { // handles struct or union 3250 SemanticError( yylloc, "extern anonymous struct/union is currently unimplemented." ); $$ = nullptr; 3247 if ( $1->type->aggInst.aggregate->aggregate.anon ) { 3248 SemanticError( yylloc, "extern anonymous aggregate is currently unimplemented." ); $$ = nullptr; 3251 3249 } 3252 3250 }
Note: See TracChangeset
for help on using the changeset viewer.