Ignore:
Timestamp:
Jan 23, 2024, 2:16:13 PM (6 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
71b5aad5
Parents:
a4ed165
Message:

Changed notZeroExpr so that expressions with conditional contexts are handled in the resolver instead of the parser. Bugs kept the same from being done with statements. (Also a bit of clean-up from the last commit and a small fix in code-gen.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CandidateFinder.cpp

    ra4ed165 r61e362f  
    4646#include "AST/Type.hpp"
    4747#include "Common/utility.h"       // for move, copy
     48#include "Parser/parserutility.h" // for notZeroExpr
    4849#include "SymTab/Mangler.h"
    4950#include "Tuples/Tuples.h"        // for handleTupleAssignment
     
    15021503        void Finder::postvisit( const ast::LogicalExpr * logicalExpr ) {
    15031504                CandidateFinder finder1( context, tenv );
    1504                 finder1.find( logicalExpr->arg1, ResolveMode::withAdjustment() );
     1505                ast::ptr<ast::Expr> arg1 = notZeroExpr( logicalExpr->arg1 );
     1506                finder1.find( arg1, ResolveMode::withAdjustment() );
    15051507                if ( finder1.candidates.empty() ) return;
    15061508
    15071509                CandidateFinder finder2( context, tenv );
    1508                 finder2.find( logicalExpr->arg2, ResolveMode::withAdjustment() );
     1510                ast::ptr<ast::Expr> arg2 = notZeroExpr( logicalExpr->arg2 );
     1511                finder2.find( arg2, ResolveMode::withAdjustment() );
    15091512                if ( finder2.candidates.empty() ) return;
    15101513
     
    15321535                // candidates for condition
    15331536                CandidateFinder finder1( context, tenv );
    1534                 finder1.find( conditionalExpr->arg1, ResolveMode::withAdjustment() );
     1537                ast::ptr<ast::Expr> arg1 = notZeroExpr( conditionalExpr->arg1 );
     1538                finder1.find( arg1, ResolveMode::withAdjustment() );
    15351539                if ( finder1.candidates.empty() ) return;
    15361540
Note: See TracChangeset for help on using the changeset viewer.