Fixed a bug which caused a hang when a comma was omitted in a parameter list, followed by an identifier.

git-svn-id: http://picoc.googlecode.com/svn/trunk@297 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
zik.saleeba 2009-05-27 05:59:44 +00:00
parent 8b2fd2c56a
commit 4668c0a80e
2 changed files with 6 additions and 1 deletions

View file

@ -1,5 +1,5 @@
CC=gcc
CFLAGS=-Wall -g -DUNIX_HOST #-DDEBUG_LEXER
CFLAGS=-Wall -g -DUNIX_HOST #-DDEBUG_EXPRESSIONS #-DDEBUG_LEXER
LIBS=-lm
TARGET = picoc

View file

@ -796,6 +796,8 @@ void ExpressionStackCollapse(struct ParseState *Parser, struct ExpressionStack *
break;
case OrderNone:
/* this should never happen */
assert(TopOperatorNode->Order != OrderNone);
break;
}
}
@ -969,6 +971,9 @@ int ExpressionParse(struct ParseState *Parser, struct Value **Result)
else if (Token == TokenIdentifier)
{
/* it's a variable, function or a macro */
if (!PrefixState)
ProgramFail(Parser, "identifier not expected here");
if (LexGetToken(Parser, NULL, FALSE) == TokenOpenBracket)
ExpressionParseFunctionCall(Parser, &StackTop, LexValue->Val->Identifier);
else