Changeset b0d9ff7 for src/Parser/DeclarationNode.cc
- Timestamp:
- Sep 1, 2022, 1:27:52 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 12df6fe
- Parents:
- def751f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
rdef751f rb0d9ff7 253 253 } // DeclarationNode::newAggregate 254 254 255 DeclarationNode * DeclarationNode::newEnum( const string * name, DeclarationNode * constants, bool body, DeclarationNode * base) {255 DeclarationNode * DeclarationNode::newEnum( const string * name, DeclarationNode * constants, bool body, bool typed, DeclarationNode * base) { 256 256 DeclarationNode * newnode = new DeclarationNode; 257 257 newnode->type = new TypeData( TypeData::Enum ); … … 260 260 newnode->type->enumeration.body = body; 261 261 newnode->type->enumeration.anon = name == nullptr; 262 newnode->type->enumeration.typed = typed; 262 263 if ( base && base->type) { 263 264 newnode->type->base = base->type; 264 265 } // if 265 266 266 // Check: if base has TypeData267 267 return newnode; 268 268 } // DeclarationNode::newEnum … … 284 284 285 285 DeclarationNode * DeclarationNode::newEnumValueGeneric( const string * name, InitializerNode * init ) { 286 if ( init ) { // list init {} or a singleInit287 if ( init->get_expression() ) { // singleInit286 if ( init ) { 287 if ( init->get_expression() ) { 288 288 return newEnumConstant( name, init->get_expression() ); 289 } else { // TODO: listInit289 } else { 290 290 DeclarationNode * newnode = newName( name ); 291 291 newnode->initializer = init; … … 293 293 } // if 294 294 } else { 295 return newName( name ); // Not explicitly inited enum value;295 return newName( name ); 296 296 } // if 297 297 } // DeclarationNode::newEnumValueGeneric
Note: See TracChangeset
for help on using the changeset viewer.