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 );
|