Changeset dd6d7c6


Ignore:
Timestamp:
May 22, 2019, 1:55:16 PM (3 years ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
arm-eh, cleanup-dtors, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
f4c2f1a
Parents:
37eef7a
Message:

Implememented draft conversion in rememaining misc cases

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r37eef7a rdd6d7c6  
    13261326
    13271327        const ast::Attribute * visit( const ast::Attribute * node ) override final {
    1328                 (void)node;
     1328                auto attr = new Attribute(
     1329                        node->name,
     1330                        get<Expression>().acceptL(node->parameters)
     1331                );
     1332                this->node = attr;
    13291333                return nullptr;
    13301334        }
    13311335
    13321336        const ast::TypeSubstitution * visit( const ast::TypeSubstitution * node ) override final {
    1333                 (void)node;
     1337                // Handled by convertTypeSubstitution helper instead.
     1338                // TypeSubstitution is not a node in the old model, so the conversion result wouldn't fit in this->node.
     1339                assert( 0 );
    13341340                return nullptr;
    13351341        }
     
    26702676
    26712677        virtual void visit( Constant * ) override final {
    2672 
    2673         }
    2674 
    2675         virtual void visit( Attribute * ) override final {
    2676 
     2678                // Handled in visit( ConstantEpxr * ).
     2679                // In the new tree, Constant fields are inlined into containing ConstantExpression.
     2680                assert( 0 );
     2681        }
     2682
     2683        virtual void visit( Attribute * old ) override final {
     2684                this->node = new ast::Attribute(
     2685                        old->name,
     2686                        GET_ACCEPT_V( parameters, Expr )
     2687                );
    26772688        }
    26782689
    26792690        virtual void visit( AttrExpr * ) override final {
    2680 
    2681                 assert( 0 );
     2691                assertf( false, "AttrExpr deprecated in new AST." );
    26822692        }
    26832693};
Note: See TracChangeset for help on using the changeset viewer.