14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
auto handleHIf = []( Parser& p, const Term& t, uint32_t prec )
{
auto pPrecBB = p.currentBB();
auto np = p.makeNestedParser();
if( !np.parseExpression( precedence::IfStmt ) )
{
cout << "expected an expression following the #if statement.";
return false;
}
auto condVal = np.popValue();
if( !condVal )
{
cout << "expected an expression following the #if statement.";
return false;
}
const auto& context = p.resolver()->context();
auto converted = ConvertValueToType( context, *condVal, GetValueType< bool >() );
if( holds_alternative< ValUnifyError >( converted ) )
{
|
|
|
|
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
auto handleHIf = []( Parser& p, const Term& t, uint32_t prec )
{
auto pPrecBB = p.currentBB();
auto np = p.makeNestedParser();
if( !np.parseExpression( precedence::IfStmt ) )
{
cout << "expected an expression following the #if statement.\n";
return false;
}
auto condVal = np.popValue();
if( !condVal )
{
cout << "expected an expression following the #if statement.\n";
return false;
}
const auto& context = p.resolver()->context();
auto converted = ConvertValueToType( context, *condVal, GetValueType< bool >() );
if( holds_alternative< ValUnifyError >( converted ) )
{
|