Problem with ending expressions fixed in new expression system.

Problem with handling ternary operators in case values fixed (those colons are tricky).


git-svn-id: http://picoc.googlecode.com/svn/trunk@233 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
zik.saleeba 2009-04-14 23:44:49 +00:00
parent 9fdee50576
commit 031edfb7ab

View file

@ -1090,8 +1090,13 @@ int ExpressionParse(struct ParseState *Parser, struct Value **Result)
{
struct ParseState PreState = *Parser;
enum LexToken Token = LexGetToken(Parser, &LexValue, TRUE);
if ((int)Token > TokenComma && (int)Token <= (int)TokenCloseBracket && (Token != TokenColon || TernaryDepth != 0))
if ( ( ( (int)Token > TokenComma && (int)Token <= (int)TokenOpenBracket) ||
(Token == TokenCloseBracket && BracketPrecedence != 0)) &&
(Token != TokenColon || TernaryDepth != 0) )
{
if (Token == TokenColon)
printf("It's a colon\n");
/* it's an operator with precedence */
if (PrefixState)
{