10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
namespace empathy::builtins
{
void SetupIfStmt( Env& e )
{
auto handleIf = []( Parser& p, uint32_t locationId, uint32_t prec )
{
auto& dm = DiagnosticsManager::GetInstance();
auto pPrecBB = p.currentBB();
auto np = p.makeNestedParser();
if( !np.parseExpression( precedence::IfStmt ) )
{
dm.emitSyntaxErrorMessage( locationId, "expected an expression following the if statement.", 0 );
|
>
>
>
>
>
>
|
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
namespace empathy::builtins
{
void SetupIfStmt( Env& e )
{
auto handleIf = []( Parser& p, uint32_t locationId, uint32_t prec )
{
auto& dm = DiagnosticsManager::GetInstance();
if( p.isInParenExpr() )
{
dm.emitSyntaxErrorMessage( locationId, "the if statement is not allowed here.", 0 );
return false;
}
auto pPrecBB = p.currentBB();
auto np = p.makeNestedParser();
if( !np.parseExpression( precedence::IfStmt ) )
{
dm.emitSyntaxErrorMessage( locationId, "expected an expression following the if statement.", 0 );
|