Changeset 4520b77e for src/Parser/DeclarationNode.cc
- Timestamp:
- Sep 20, 2022, 8:37:05 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- a065f1f
- Parents:
- d489da8 (diff), 12df6fe (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
rd489da8 r4520b77e 254 254 } // DeclarationNode::newAggregate 255 255 256 DeclarationNode * DeclarationNode::newEnum( const string * name, DeclarationNode * constants, bool body, DeclarationNode * base) {256 DeclarationNode * DeclarationNode::newEnum( const string * name, DeclarationNode * constants, bool body, bool typed, DeclarationNode * base) { 257 257 DeclarationNode * newnode = new DeclarationNode; 258 258 newnode->type = new TypeData( TypeData::Enum ); … … 261 261 newnode->type->enumeration.body = body; 262 262 newnode->type->enumeration.anon = name == nullptr; 263 newnode->type->enumeration.typed = typed; 263 264 if ( base && base->type) { 264 265 newnode->type->base = base->type; 265 266 } // if 266 267 267 // Check: if base has TypeData268 268 return newnode; 269 269 } // DeclarationNode::newEnum … … 285 285 286 286 DeclarationNode * DeclarationNode::newEnumValueGeneric( const string * name, InitializerNode * init ) { 287 if ( init ) { // list init {} or a singleInit288 if ( init->get_expression() ) { // singleInit287 if ( init ) { 288 if ( init->get_expression() ) { 289 289 return newEnumConstant( name, init->get_expression() ); 290 } else { // TODO: listInit290 } else { 291 291 DeclarationNode * newnode = newName( name ); 292 292 newnode->initializer = init; … … 294 294 } // if 295 295 } else { 296 return newName( name ); // Not explicitly inited enum value;296 return newName( name ); 297 297 } // if 298 298 } // DeclarationNode::newEnumValueGeneric
Note: See TracChangeset
for help on using the changeset viewer.