Goose  Diff

Differences From Artifact [129e9ce297]:

  • File bs/builtins/statements/using.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: 4048)

To Artifact [1aff9ab41a]:

  • File bs/builtins/statements/using.cpp — part of check-in [d6abaa6734] at 2023-12-05 18:43:34 on branch trunk —
    • Comptime functions are now explicitely marked with "comptime"
    • Fixed some bugs (or added placeholders) for things that the above change revealed to be broken or missing
    (user: zlodo size: 4439)

82
83
84
85
86
87
88





89




90
91
92
93
94
95
            {
                DiagnosticsManager::GetInstance().emitSyntaxErrorMessage( locationId,
                    "expected an expression.", 0 );
                context.env()->storeValue( localIdentity, ANYTERM( _ ), ValueToEIR( PoisonValue() ) );
                return true;
            }






            context.env()->storeValue( localIdentity, ANYTERM( _ ), ValueToEIR( *np.popValue() ) );




            return true;
        };

        RegisterRule( e, "using"_sid, Rule( handleUsing ) );
    }
}







>
>
>
>
>
|
>
>
>
>






82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
            {
                DiagnosticsManager::GetInstance().emitSyntaxErrorMessage( locationId,
                    "expected an expression.", 0 );
                context.env()->storeValue( localIdentity, ANYTERM( _ ), ValueToEIR( PoisonValue() ) );
                return true;
            }

            auto val = np.popValue();
            if( !val->isConstant() )
            {
                DiagnosticsManager::GetInstance().emitSyntaxErrorMessage( val->locationId(),
                    "this expression is not a comptime constant.", 0 );
                context.env()->storeValue( localIdentity, ANYTERM( _ ), ValueToEIR( PoisonValue() ) );
                return true;
            }

            context.env()->storeValue( localIdentity, ANYTERM( _ ), ValueToEIR( *val ) );
            return true;
        };

        RegisterRule( e, "using"_sid, Rule( handleUsing ) );
    }
}