Changeset 60914351 for src/ResolvExpr


Ignore:
Timestamp:
Jan 31, 2018, 4:58:04 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
bc6f918
Parents:
7aaec67
Message:

Add support for resolving function with clause [fixes #80]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r7aaec67 r60914351  
    271271                functionDecl->set_type( new_type );
    272272                GuardValue( functionReturn );
    273                 functionReturn = ResolvExpr::extractResultType( functionDecl->get_functionType() );
     273                functionReturn = ResolvExpr::extractResultType( functionDecl->type );
     274
     275                {
     276                        // resolve with-exprs with parameters in scope and add any newly generated declarations to the
     277                        // front of the function body.
     278                        auto guard = makeFuncGuard( [this]() { indexer.enterScope(); }, [this](){ indexer.leaveScope(); } );
     279                        indexer.addFunctionType( functionDecl->type );
     280                        std::list< Statement * > newStmts;
     281                        resolveWithExprs( functionDecl->withExprs, newStmts );
     282                        functionDecl->statements->kids.splice( functionDecl->statements->kids.begin(), newStmts );
     283                }
    274284        }
    275285
Note: See TracChangeset for help on using the changeset viewer.