34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
}
if( ambiguous )
{
// TODO display details
DiagnosticsManager::GetInstance().emitErrorMessage( loc,
"ambiguous function call." );
return nullopt;
}
if( !bestSol )
{
// TODO display details
DiagnosticsManager::GetInstance().emitErrorMessage( loc,
"function arguments mismatch." );
return nullopt;
}
return invoke( c, loc, callee, *bestSol, *bestUC );
}
optional< Value > invoke( const Context& c, uint32_t loc, const Value& callee, const Term& unifiedCallPat, UnificationContext& uc ) const final
{
|
|
|
|
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
}
if( ambiguous )
{
// TODO display details
DiagnosticsManager::GetInstance().emitErrorMessage( loc,
"ambiguous function call." );
return PoisonValue();
}
if( !bestSol )
{
// TODO display details
DiagnosticsManager::GetInstance().emitErrorMessage( loc,
"function arguments mismatch." );
return PoisonValue();
}
return invoke( c, loc, callee, *bestSol, *bestUC );
}
optional< Value > invoke( const Context& c, uint32_t loc, const Value& callee, const Term& unifiedCallPat, UnificationContext& uc ) const final
{
|
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
optional< Value > prepareFunc( const Context& c, const Value& callee, const Term& unifiedCallPat, UnificationContext& uc ) const final
{
if( IsBuiltinFunc( callee ) || IsIntrinsicFunc( callee ) )
return callee;
// TODO better description with the function's name if possible (we may need to explicitely store it in the func)
DiagnosticsContext dc( 0, true );
return CompileFunc( c, callee );
}
};
ptr< InvocationRule >& GetFuncInvocationRule()
{
|
>
|
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
optional< Value > prepareFunc( const Context& c, const Value& callee, const Term& unifiedCallPat, UnificationContext& uc ) const final
{
if( IsBuiltinFunc( callee ) || IsIntrinsicFunc( callee ) )
return callee;
// TODO better description with the function's name if possible (we may need to explicitely store it in the func)
DiagnosticsContext dc( 0, true );
VerbosityContext vc( Verbosity::Normal, true );
return CompileFunc( c, callee );
}
};
ptr< InvocationRule >& GetFuncInvocationRule()
{
|