HLSL: Fix a grammar error related to constructors in parenthetical expressions

This commit is contained in:
steve-lunarg
2016-07-30 07:38:55 -06:00
parent ff13213547
commit 5964c64b2a
7 changed files with 212 additions and 34 deletions

View File

@@ -39,27 +39,29 @@ namespace glslang {
void HlslTokenStream::pushPreToken(const HlslToken& tok)
{
assert(preTokenStackSize == 0);
preTokenStack = tok;
++preTokenStackSize;
assert(preTokenStackSize < tokenBufferSize);
preTokenStack[preTokenStackSize++] = tok;
}
HlslToken HlslTokenStream::popPreToken()
{
assert(preTokenStackSize == 1);
--preTokenStackSize;
assert(preTokenStackSize > 0);
return preTokenStack;
return preTokenStack[--preTokenStackSize];
}
void HlslTokenStream::pushTokenBuffer(const HlslToken& tok)
{
tokenBuffer = tok;
tokenBuffer[tokenBufferPos] = tok;
tokenBufferPos = (tokenBufferPos+1) % tokenBufferSize;
}
HlslToken HlslTokenStream::popTokenBuffer()
{
return tokenBuffer;
// Back up
tokenBufferPos = (tokenBufferPos+tokenBufferSize-1) % tokenBufferSize;
return tokenBuffer[tokenBufferPos];
}
// Load 'token' with the next token in the stream of tokens.