Goose  Diff

Differences From Artifact [bea9324373]:

  • File bs/builtins/operators/dollar.cpp — part of check-in [bf81e30984] at 2021-09-18 17:00:20 on branch trunk —
    • Refactored LocationId into a separate class and actually use it everywhere instead of uint32_t, this makes it easier to make generic wrappers for APIs
    • g0 api: more work on the CIR api
    (user: achavasse size: 6256)

To Artifact [08b0311199]:

  • File bs/builtins/operators/dollar.cpp — part of check-in [93eaca4c2b] at 2021-09-26 19:47:46 on branch trunk —
    • Fixed a handful of parsing issues related to templates
    • Added missing export of "ref" to g1
    (user: achavasse size: 6038)

116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132

        if( !holds_alternative< StringId >( nameTerm->first ) )
            return nullopt;

        if( !builtins::IsType( p.context(), *leftVal ) && !builtins::IsTExpr( *leftVal ) )
            return nullopt;

        // The infix dollar operator is a syntactic shortcut meant to behave like we are applying
        // a TExpr to a type or another TExpr (just like a regular decl), so it have the application precedence.
        return precedence::Application;
    }

    bool ParseInfixDollarOperator( Parser& p, LocationId locationId, uint32_t prec )
    {
        const auto& leftVal = p.peekLastValue();
        if( !leftVal )
            return false;







<
<
|







116
117
118
119
120
121
122


123
124
125
126
127
128
129
130

        if( !holds_alternative< StringId >( nameTerm->first ) )
            return nullopt;

        if( !builtins::IsType( p.context(), *leftVal ) && !builtins::IsTExpr( *leftVal ) )
            return nullopt;



        return precedence::Decl;
    }

    bool ParseInfixDollarOperator( Parser& p, LocationId locationId, uint32_t prec )
    {
        const auto& leftVal = p.peekLastValue();
        if( !leftVal )
            return false;