Ignore:
Timestamp:
Sep 1, 2022, 1:27:52 PM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
12df6fe
Parents:
def751f
Message:

Fix up the QualifiedNameExpr?. It should now work on both old AST and new AST. There are some known bugs to fix so make all-tests will fail.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    rdef751f rb0d9ff7  
    253253} // DeclarationNode::newAggregate
    254254
    255 DeclarationNode * DeclarationNode::newEnum( const string * name, DeclarationNode * constants, bool body, DeclarationNode * base) {
     255DeclarationNode * DeclarationNode::newEnum( const string * name, DeclarationNode * constants, bool body, bool typed, DeclarationNode * base) {
    256256        DeclarationNode * newnode = new DeclarationNode;
    257257        newnode->type = new TypeData( TypeData::Enum );
     
    260260        newnode->type->enumeration.body = body;
    261261        newnode->type->enumeration.anon = name == nullptr;
     262        newnode->type->enumeration.typed = typed;
    262263        if ( base && base->type)  {
    263264                newnode->type->base = base->type;       
    264265        } // if
    265266
    266         // Check: if base has TypeData
    267267        return newnode;
    268268} // DeclarationNode::newEnum
     
    284284
    285285DeclarationNode * DeclarationNode::newEnumValueGeneric( const string * name, InitializerNode * init ) {
    286         if ( init ) { // list init {} or a singleInit
    287                 if ( init->get_expression() ) { // singleInit
     286        if ( init ) {
     287                if ( init->get_expression() ) {
    288288                        return newEnumConstant( name, init->get_expression() );
    289                 } else { // TODO: listInit
     289                } else {
    290290                        DeclarationNode * newnode = newName( name );
    291291                        newnode->initializer = init;
     
    293293                } // if
    294294        } else {
    295                 return newName( name ); // Not explicitly inited enum value;
     295                return newName( name );
    296296        } // if
    297297} // DeclarationNode::newEnumValueGeneric
Note: See TracChangeset for help on using the changeset viewer.