Changes in src/Parser/DeclarationNode.cc [374cb117:f135b50]
- File:
-
- 1 edited
-
src/Parser/DeclarationNode.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r374cb117 rf135b50 253 253 } // DeclarationNode::newAggregate 254 254 255 DeclarationNode * DeclarationNode::newEnum( const string * name, DeclarationNode * constants, bool body ) {255 DeclarationNode * DeclarationNode::newEnum( const string * name, DeclarationNode * constants, bool body, bool typed) { 256 256 DeclarationNode * newnode = new DeclarationNode; 257 257 newnode->type = new TypeData( TypeData::Enum ); … … 272 272 } // DeclarationNode::newName 273 273 274 DeclarationNode * DeclarationNode::newEnumConstant( const string * name, ExpressionNode * constant ) { 274 DeclarationNode * DeclarationNode::newEnumConstant( const string * name, ExpressionNode * constant ) { // Marker 275 275 DeclarationNode * newnode = newName( name ); 276 276 newnode->enumeratorValue.reset( constant ); 277 277 return newnode; 278 278 } // DeclarationNode::newEnumConstant 279 280 DeclarationNode * DeclarationNode::newEnumValueGeneric( const string * name, InitializerNode * init ) {281 if ( init ) { // list init {} or a singleInit282 if ( init->get_expression() ) { // singleInit283 return newEnumConstant( name, init->get_expression() );284 } else { // TODO: listInit285 DeclarationNode * newnode = newName( name );286 newnode->initializer = init;287 return newnode;288 } // if289 } else {290 return newName( name ); // Not explicitly inited enum value;291 } // if292 } // DeclarationNode::newEnumGeneric293 279 294 280 DeclarationNode * DeclarationNode::newFromTypedef( const string * name ) {
Note:
See TracChangeset
for help on using the changeset viewer.