1
0

Fix IF parsing

This commit is contained in:
otya128
2016-12-24 16:53:49 +09:00
parent be9afb82ca
commit 0aff0e5821

View File

@@ -1583,7 +1583,10 @@ class Parser
then = ifStatements();
}
token = lex.front();
lex.popFront();
if (multiline || token.type != TokenType.NewLine)
{
lex.popFront();
}
import std.typecons;
Tuple!(Statements, Expression)[] elseif = new Tuple!(Statements, Expression)[0];
while(token.type == TokenType.Elseif)
@@ -1643,7 +1646,10 @@ class Parser
{
else_ = ifStatements();
}
lex.popFront();
if (multiline || lex.front.type != TokenType.NewLine)
{
lex.popFront();
}
}
auto if_ = new If(expr, then, else_, elseif, lex.location);
return if_;