Goose  Diff

Differences From Artifact [6e7e5fbd90]:

  • File bs/parse/parser.cpp — part of check-in [ffbb9276bb] at 2019-08-14 15:21:42 on branch trunk — Implemented the "InitializeLocalVar" extension point, with a builtin overload for integers. (user: achavasse size: 6433)

To Artifact [3bcd6b7421]:

  • File bs/parse/parser.cpp — part of check-in [75bcd81044] at 2019-08-15 01:27:35 on branch trunk —
    • Implemented the DropValue() extension point, called when a previously pushed value is dropped without being used.
    • ir, sema: the complexity of an ir expression is now directly counted by ir::Vector, so that we don't have to deal with it in every unification rule (and it was missing from most of them, which caused incorrect overload resolutions in some cases).
    (user: achavasse size: 6512)

49
50
51
52
53
54
55
56


57
58
59
60
61
62
63
64


65
66
67
68
69
70
71
72
73
74
75
        if( !parseInfix( next->first, *prec ) )
            break;
    }
}

void Parser::flushValue()
{
    // Flush the pending value's llr as a standalone instruction,


    // if any. If it is a constant, complain about discarding it.
    if( !m_lastValue )
         return;

    if( m_lastValue->isConstant() || m_lastValue->isPoison() )
        return;

    assert( m_currentBB );



    auto llr = move( *m_lastValue->llr() );
    m_lastValue = nullopt;
    emitInstruction( move( llr ) );
}

optional< uint32_t > Parser::getPrecedence( const Term& t )
{
    return visit( [&]( auto&& content )
    {
        return getPrecedence( t, content );







|
>
>
|

|

|


<
>
>

<

<







49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

66
67
68

69

70
71
72
73
74
75
76
        if( !parseInfix( next->first, *prec ) )
            break;
    }
}

void Parser::flushValue()
{
    // Flush the pending value, by invoking the DropValue
    // extension point, where an overload will decide
    // of the value's fate (or possibly emit an error
    // if that value wasn't allowed to be discarded).
    if( !m_lastValue )
        return;

    if( m_lastValue->isPoison() )
        return;


    InvokeOverloadSet( resolver()->context(), resolver()->context().env()->extDropValue(),
        MakeTuple( *m_lastValue ) );


    m_lastValue = nullopt;

}

optional< uint32_t > Parser::getPrecedence( const Term& t )
{
    return visit( [&]( auto&& content )
    {
        return getPrecedence( t, content );