check 'ternaries' count

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-11-21 20:50:27 +01:00
parent 90bd91e294
commit 0787038934

View file

@ -1278,7 +1278,7 @@ static ast_expression* parse_expression_leave(parser_t *parser, bool stopatcomma
}
/* a colon without a pervious question mark cannot be a ternary */
if (op->id == opid2(':','?')) {
if (!ternaries && op->id == opid2(':','?')) {
parser->tok = ':';
break;
}