140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
auto nameTerm = m_resolver->consume();
const auto* name = get_if< StringId >( &nameTerm->first );
// If the identifier is preceded by a TExpr or a Type,
// then this becomes a TDecl or a Decl, respectively.
if( IsTExpr( *leftVal ) )
{
auto loc = LocationManager::GetInstance().getSpanningLocation( leftVal->locationId(), nameTerm->second );
auto texpr = ValueToIRExpr( *popValue() );
pushValue( ToValue( TNamedDecl( move( texpr ), *name ) ).setLocationId( loc ) );
return true;
}
else if( leftVal->isType() )
{
auto loc = LocationManager::GetInstance().getSpanningLocation( leftVal->locationId(), nameTerm->second );
auto type = ValueToIRExpr( *popValue() );
pushValue( ToValue( Decl( move( type ), *name ) ).setLocationId( loc ) );
return true;
}
return parsePrefix( strid, prec );
|
|
|
|
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
auto nameTerm = m_resolver->consume();
const auto* name = get_if< StringId >( &nameTerm->first );
// If the identifier is preceded by a TExpr or a Type,
// then this becomes a TDecl or a Decl, respectively.
if( IsTExpr( *leftVal ) )
{
auto loc = Location::CreateSpanningLocation( leftVal->locationId(), nameTerm->second );
auto texpr = ValueToIRExpr( *popValue() );
pushValue( ToValue( TNamedDecl( move( texpr ), *name ) ).setLocationId( loc ) );
return true;
}
else if( leftVal->isType() )
{
auto loc = Location::CreateSpanningLocation( leftVal->locationId(), nameTerm->second );
auto type = ValueToIRExpr( *popValue() );
pushValue( ToValue( Decl( move( type ), *name ) ).setLocationId( loc ) );
return true;
}
return parsePrefix( strid, prec );
|