Ignore:
Timestamp:
Jan 22, 2024, 3:23:12 AM (5 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
544deb9
Parents:
ac939461
Message:

Update enum.tex

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Validate/ReplacePseudoFunc.cpp

    rac939461 r367725d  
    1717ast::Expr const * ReplacePseudoFuncCore::postvisit( ast::ApplicationExpr const * expr) {
    1818    auto fname = ast::getFunctionName( expr );
    19     if ( fname == "posE" ) {
     19    if ( fname == "posE" || fname == "valueE" || fname == "labelE" ) {
    2020        // std::cerr << "Found App in ReplacePseudoFunc" << std::endl;
    2121        if ( expr->args.size() != 1 ) {
     
    3535        for ( size_t i = 0; i < base->members.size(); i++ ) {
    3636            if ( base->members[i]->name == referredName ) {
    37                 return ast::ConstantExpr::from_int( expr->location, i );
     37                if ( fname == "posE ")
     38                    return ast::ConstantExpr::from_int( expr->location, i );
     39                else if (fname == "labelE" )
     40                    return ast::ConstantExpr::from_string( expr->location, referredName );
     41                else
     42                    return new ast::TypeExpr( expr->location, argType );
    3843            }
    3944        }
Note: See TracChangeset for help on using the changeset viewer.