Made parser more fault-tolerant for DCD
This commit is contained in:
parent
d7498ffb7f
commit
c9eb658412
|
@ -851,8 +851,10 @@ alias core.sys.posix.stdio.fileno fileno;
|
||||||
if (!currentIs(TokenType.rBrace))
|
if (!currentIs(TokenType.rBrace))
|
||||||
node.declarationsAndStatements = parseDeclarationsAndStatements();
|
node.declarationsAndStatements = parseDeclarationsAndStatements();
|
||||||
auto closeBrace = expect(TokenType.rBrace);
|
auto closeBrace = expect(TokenType.rBrace);
|
||||||
if (closeBrace is null) return null;
|
if (closeBrace !is null)
|
||||||
node.endLocation = closeBrace.startIndex;
|
node.endLocation = closeBrace.startIndex;
|
||||||
|
else
|
||||||
|
node.endLocation = size_t.max;
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue