Goose  Diff

Differences From Artifact [09923bd0a3]:

  • File bs/builtins/statements/if.cpp — part of check-in [59ecc02baa] at 2019-08-13 00:42:47 on branch trunk — Diagnostics: use value poisoning to (hopefully) fix most cases of superfluous cascading error messages. (user: achavasse size: 4529)

To Artifact [5d1180010b]:

  • File bs/builtins/statements/if.cpp — part of check-in [3d8b581261] at 2019-08-15 22:37:33 on branch trunk —
    • Fixed some bugs related to dropping values.
    • Implemented local variable declarations with default initialization.
    • codegen: Fixed allocas not properly grouped up at the start of the first basic block of functions.
    (user: achavasse size: 4725)

10
11
12
13
14
15
16






17
18
19
20
21
22
23
namespace empathy::builtins
{
    void SetupIfStmt( Env& e )
    {
        auto handleIf = []( Parser& p, uint32_t locationId, uint32_t prec )
        {
            auto& dm = DiagnosticsManager::GetInstance();







            auto pPrecBB = p.currentBB();

            auto np = p.makeNestedParser();
            if( !np.parseExpression( precedence::IfStmt ) )
            {
                dm.emitSyntaxErrorMessage( locationId, "expected an expression following the if statement.", 0 );







>
>
>
>
>
>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
namespace empathy::builtins
{
    void SetupIfStmt( Env& e )
    {
        auto handleIf = []( Parser& p, uint32_t locationId, uint32_t prec )
        {
            auto& dm = DiagnosticsManager::GetInstance();

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

            auto pPrecBB = p.currentBB();

            auto np = p.makeNestedParser();
            if( !np.parseExpression( precedence::IfStmt ) )
            {
                dm.emitSyntaxErrorMessage( locationId, "expected an expression following the if statement.", 0 );