Include ?: in the tests for flow control.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@29348 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2015-01-07 06:36:55 +00:00
parent 05a62bf528
commit 548ec2c12c
4 changed files with 63 additions and 9 deletions

View file

@ -568,15 +568,19 @@ logical_or_expression
conditional_expression
: logical_or_expression { $$ = $1; }
| logical_or_expression QUESTION expression COLON assignment_expression {
| logical_or_expression QUESTION {
++parseContext.controlFlowNestingLevel;
}
expression COLON assignment_expression {
--parseContext.controlFlowNestingLevel;
parseContext.boolCheck($2.loc, $1);
parseContext.rValueErrorCheck($2.loc, "?", $1);
parseContext.rValueErrorCheck($4.loc, ":", $3);
parseContext.rValueErrorCheck($4.loc, ":", $5);
$$ = parseContext.intermediate.addSelection($1, $3, $5, $2.loc);
parseContext.rValueErrorCheck($5.loc, ":", $4);
parseContext.rValueErrorCheck($5.loc, ":", $6);
$$ = parseContext.intermediate.addSelection($1, $4, $6, $2.loc);
if ($$ == 0) {
parseContext.binaryOpError($2.loc, ":", $3->getCompleteString(), $5->getCompleteString());
$$ = $5;
parseContext.binaryOpError($2.loc, ":", $4->getCompleteString(), $6->getCompleteString());
$$ = $6;
}
}
;