HLSL: Fix binary-expression associativity and termination issue.

This commit is contained in:
John Kessenich
2016-07-28 21:43:17 -06:00
parent fea226ba43
commit 64076ed7e9
8 changed files with 243 additions and 180 deletions

View File

@@ -1675,12 +1675,12 @@ bool HlslGrammar::acceptBinaryExpression(TIntermTyped*& node, PrecedenceLevel pr
if (! acceptBinaryExpression(node, (PrecedenceLevel)(precedenceLevel + 1)))
return false;
TOperator op = HlslOpMap::binary(peek());
PrecedenceLevel tokenLevel = HlslOpMap::precedenceLevel(op);
if (tokenLevel < precedenceLevel)
return true;
do {
TOperator op = HlslOpMap::binary(peek());
PrecedenceLevel tokenLevel = HlslOpMap::precedenceLevel(op);
if (tokenLevel < precedenceLevel)
return true;
// ... op
TSourceLoc loc = token.loc;
advanceToken();
@@ -1697,9 +1697,6 @@ bool HlslGrammar::acceptBinaryExpression(TIntermTyped*& node, PrecedenceLevel pr
parseContext.error(loc, "Could not perform requested binary operation", "", "");
return false;
}
if (! peekTokenClass(EHTokComma))
return true;
} while (true);
}