HLSL: Fix #96: Support do-while loop substatements with no curly braces.

This commit is contained in:
John Kessenich
2017-04-20 11:08:24 -06:00
parent 670271890d
commit 0c6f9360f5
4 changed files with 180 additions and 77 deletions

View File

@@ -3328,18 +3328,12 @@ bool HlslGrammar::acceptIterationStatement(TIntermNode*& statement)
case EHTokDo:
parseContext.nestLooping();
if (! acceptTokenClass(EHTokLeftBrace))
expected("{");
// statement
if (! peekTokenClass(EHTokRightBrace) && ! acceptScopedStatement(statement)) {
if (! acceptScopedStatement(statement)) {
expected("do sub-statement");
return false;
}
if (! acceptTokenClass(EHTokRightBrace))
expected("}");
// WHILE
if (! acceptTokenClass(EHTokWhile)) {
expected("while");