From 8c987f6bf9dd485d05dfcd538a6bc65a17fdadbd Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 9 Jun 2007 22:30:16 +0000 Subject: [PATCH] Fixed the comma operator to function correctly. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2513 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/qcc_pr_comp.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/engine/qclib/qcc_pr_comp.c b/engine/qclib/qcc_pr_comp.c index 1ba37e0d8..71b60a98e 100644 --- a/engine/qclib/qcc_pr_comp.c +++ b/engine/qclib/qcc_pr_comp.c @@ -4239,11 +4239,6 @@ QCC_def_t *QCC_PR_Expression (int priority, pbool allowcomma) elsej->a = &statements[numstatements] - elsej; return e2; } - if (allowcomma && QCC_PR_CheckToken (",")) - { - QCC_FreeTemp(e); - return QCC_PR_Expression(TOP_PRIORITY, true); - } } opnum=0; @@ -4601,6 +4596,13 @@ QCC_def_t *QCC_PR_Expression (int priority, pbool allowcomma) } if (e == NULL) QCC_PR_ParseError(ERR_INTERNAL, "e == null"); + + if (allowcomma && priority == TOP_PRIORITY && QCC_PR_CheckToken (",")) + { + QCC_FreeTemp(e); + return QCC_PR_Expression(TOP_PRIORITY, true); + } + return e; }