Ignore:
Timestamp:
Sep 20, 2022, 8:37:05 PM (2 years ago)
Author:
JiadaL <j82liang@…>
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.
Message:

Merge to Master Sept 19

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    rd489da8 r4520b77e  
    254254} // DeclarationNode::newAggregate
    255255
    256 DeclarationNode * DeclarationNode::newEnum( const string * name, DeclarationNode * constants, bool body, DeclarationNode * base) {
     256DeclarationNode * DeclarationNode::newEnum( const string * name, DeclarationNode * constants, bool body, bool typed, DeclarationNode * base) {
    257257        DeclarationNode * newnode = new DeclarationNode;
    258258        newnode->type = new TypeData( TypeData::Enum );
     
    261261        newnode->type->enumeration.body = body;
    262262        newnode->type->enumeration.anon = name == nullptr;
     263        newnode->type->enumeration.typed = typed;
    263264        if ( base && base->type)  {
    264265                newnode->type->base = base->type;
    265266        } // if
    266267
    267         // Check: if base has TypeData
    268268        return newnode;
    269269} // DeclarationNode::newEnum
     
    285285
    286286DeclarationNode * DeclarationNode::newEnumValueGeneric( const string * name, InitializerNode * init ) {
    287         if ( init ) { // list init {} or a singleInit
    288                 if ( init->get_expression() ) { // singleInit
     287        if ( init ) {
     288                if ( init->get_expression() ) {
    289289                        return newEnumConstant( name, init->get_expression() );
    290                 } else { // TODO: listInit
     290                } else {
    291291                        DeclarationNode * newnode = newName( name );
    292292                        newnode->initializer = init;
     
    294294                } // if
    295295        } else {
    296                 return newName( name ); // Not explicitly inited enum value;
     296                return newName( name );
    297297        } // if
    298298} // DeclarationNode::newEnumValueGeneric
Note: See TracChangeset for help on using the changeset viewer.