Changes in src/Parser/DeclarationNode.cc [ed9a1ae:b0d9ff7]
- File:
-
- 1 edited
-
src/Parser/DeclarationNode.cc (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
red9a1ae rb0d9ff7 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Aug 8 17:07:00 202213 // Update Count : 11 8512 // Last Modified On : Wed Jul 14 17:36:57 2021 13 // Update Count : 1154 14 14 // 15 15 … … 128 128 if ( name ) { 129 129 os << *name << ": "; 130 } else { 131 os << "unnamed: "; 130 132 } // if 131 133 … … 152 154 initializer->printOneLine( os ); 153 155 os << " maybe constructed? " << initializer->get_maybeConstructed(); 154 } // if 155 156 for ( Attribute * attr: reverseIterate( attributes ) ) { 157 os << string( indent + 2, ' ' ) << "attr " << attr->name.c_str(); 158 } // for 156 157 } // if 159 158 160 159 os << endl; … … 244 243 newnode->type = new TypeData( TypeData::Aggregate ); 245 244 newnode->type->aggregate.kind = kind; 246 newnode->type->aggregate.name = name == nullptr ? new string( DeclarationNode::anonymous.newName() ) : name;245 newnode->type->aggregate.name = name == nullptr ? new string( DeclarationNode::anonymous.newName() ) : name; 247 246 newnode->type->aggregate.actuals = actuals; 248 247 newnode->type->aggregate.fields = fields; … … 254 253 } // DeclarationNode::newAggregate 255 254 256 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) { 257 256 DeclarationNode * newnode = new DeclarationNode; 258 257 newnode->type = new TypeData( TypeData::Enum ); … … 261 260 newnode->type->enumeration.body = body; 262 261 newnode->type->enumeration.anon = name == nullptr; 262 newnode->type->enumeration.typed = typed; 263 263 if ( base && base->type) { 264 newnode->type->base = base->type; 265 } // if 266 267 // Check: if base has TypeData 264 newnode->type->base = base->type; 265 } // if 266 268 267 return newnode; 269 268 } // DeclarationNode::newEnum … … 285 284 286 285 DeclarationNode * DeclarationNode::newEnumValueGeneric( const string * name, InitializerNode * init ) { 287 if ( init ) { // list init {} or a singleInit288 if ( init->get_expression() ) { // singleInit286 if ( init ) { 287 if ( init->get_expression() ) { 289 288 return newEnumConstant( name, init->get_expression() ); 290 } else { // TODO: listInit289 } else { 291 290 DeclarationNode * newnode = newName( name ); 292 291 newnode->initializer = init; … … 294 293 } // if 295 294 } else { 296 return newName( name ); // Not explicitly inited enum value;295 return newName( name ); 297 296 } // if 298 297 } // DeclarationNode::newEnumValueGeneric … … 505 504 } // for 506 505 // src is the new item being added and has a single bit 507 } else if ( ! src->storageClasses.is_threadlocal _any()) { // conflict ?506 } else if ( ! src->storageClasses.is_threadlocal ) { // conflict ? 508 507 appendError( error, string( "conflicting " ) + Type::StorageClassesNames[storageClasses.ffs()] + 509 508 " & " + Type::StorageClassesNames[src->storageClasses.ffs()] ); … … 519 518 storageClasses |= q->storageClasses; 520 519 521 for ( Attribute * attr: reverseIterate( q->attributes ) ) {520 for ( Attribute *attr: reverseIterate( q->attributes ) ) { 522 521 attributes.push_front( attr->clone() ); 523 522 } // for … … 684 683 } // if 685 684 delete o; 686 687 685 return this; 688 686 }
Note:
See TracChangeset
for help on using the changeset viewer.