Goose  Diff

Differences From Artifact [6a79e14da1]:

  • File bs/builtins/statements/if.cpp — part of check-in [605ff0a654] at 2022-11-17 00:46:21 on branch trunk — expose more compiler functionality to g0api:
    • local variable declarations
    • lifetime scopes
    (user: zlodo size: 5335)

To Artifact [3b1efdb412]:

  • File bs/builtins/statements/if.cpp — part of check-in [f605c7c4a3] at 2023-08-25 18:44:59 on branch trunk — Some cleanup in preparation for getting rid of proposition lists (user: zlodo size: 5373)

11
12
13
14
15
16
17
18

19
20
21
22
23
24
25
11
12
13
14
15
16
17

18
19
20
21
22
23
24
25







-
+







    void SetupIfStmt( Env& e )
    {
        auto handleIf = []( Parser& p, LocationId locationId, uint32_t prec )
        {
            auto& dm = DiagnosticsManager::GetInstance();
            auto cfg = GetCFG( p.context() );

            if( p.isInParenExpr() || !cfg )
            if( p.isInParenExpr() || !cfg || !IsBranchingAllowed( p.context() ) )
            {
                dm.emitSyntaxErrorMessage( locationId, "the if statement is not allowed here.", 0 );
                return false;
            }

            auto pPrecBB = cfg->currentBB();