Goose  Diff

Differences From Artifact [87d28da343]:

  • File bs/parse/parser.cpp — part of check-in [bbef786dbb] at 2019-02-03 12:01:08 on branch trunk — Parser: parse decls. (user: achavasse size: 4358)

To Artifact [3e5aff3711]:

  • File bs/parse/parser.cpp — part of check-in [2e672cd033] at 2019-02-03 21:35:45 on branch trunk —
    • Moved decl and function invocation rules out of sema and into builtins, as it makes more sense.
    • Implemented a helper to determine if a tuple is a valid parameter list.
    (user: achavasse size: 4362)

102
103
104
105
106
107
108
109
110
111
112
113
114
115
116

    if( leftVal->type() == TSID( type ) )
    {
        auto nameTerm = m_resolver->consume();
        const auto* name = get_if< StringId >( &nameTerm->content() );
        auto type = ValueToIRExpr( *pop() );

        return ToValue( sema::Decl( move( type ), *name ) );
    }

    return parsePrefix( strid, prec );
}

optional< uint32_t > Parser::getPrecedence( const Term& t, const pvec& vec )
{







|







102
103
104
105
106
107
108
109
110
111
112
113
114
115
116

    if( leftVal->type() == TSID( type ) )
    {
        auto nameTerm = m_resolver->consume();
        const auto* name = get_if< StringId >( &nameTerm->content() );
        auto type = ValueToIRExpr( *pop() );

        return ToValue( builtins::Decl( move( type ), *name ) );
    }

    return parsePrefix( strid, prec );
}

optional< uint32_t > Parser::getPrecedence( const Term& t, const pvec& vec )
{