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