#ifndef GOOSE_PARSE_PARSER_INL
#define GOOSE_PARSE_PARSER_INL
namespace goose::parse
{
template< typename V >
void Parser::pushValue( V&& val )
{
if( val.isPoison() )
{
DiagnosticsManager::GetInstance().setCurrentVerbosityLevel( Verbosity::Silent );
builtins::PoisonBuilder( context() );
}
flushValue();
m_lastValue = forward< V >( val );
if( !context().locationId().invalid() )
m_lastValue->setLocationId( context().locationId() );
// If the value we just pushed is of void type, it was pushed only for its side effects
// (for instance a SetVar instruction), so it should be flushed immediately.
if( m_lastValue->type() == GetValueType< void >() )
flushValue();
}
template< typename T >
optional< uint32_t > Parser::getPrecedence( const Term&, const T& )
{
return nullopt;
}
template< typename T >
bool Parser::parsePrefix( const T&, uint32_t )
{
return false;
}
template< typename T >
bool Parser::parseInfix( const T&, uint32_t prec )
{
return false;
}
}
#endif