From 37141ac197eaefeae9dada0bcc1c429ff584df44 Mon Sep 17 00:00:00 2001 From: Ian C Date: Fri, 1 Sep 2006 23:48:25 +0000 Subject: GEMMA largely working. Fixed broken expressions with white space. --- expr.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'expr.c') diff --git a/expr.c b/expr.c index 9369e1d..6cd8237 100644 --- a/expr.c +++ b/expr.c @@ -436,23 +436,30 @@ static Stack *ToPostfix(const char *expr) } else { - /* Found an operand - parse and store the operand - */ - p=buff; - - while(*expr && !IS_OPERAND_END(*expr)) + if (!isspace(*expr)) { - *p++=*expr++; - } + /* Found an operand - parse and store the operand + */ + p=buff; - *p=0; + while(*expr && !IS_OPERAND_END(*expr)) + { + *p++=*expr++; + } - /* Note that operands are marked as unary just to chose one over - the other branch in EvalPostfix() - no other reason - */ - output=Push(output,TYPE_OPERAND,0,TRUE,buff); + *p=0; - prev_was_op=FALSE; + /* Note that operands are marked as unary just to chose one over + the other branch in EvalPostfix() - no other reason + */ + output=Push(output,TYPE_OPERAND,0,TRUE,buff); + + prev_was_op=FALSE; + } + else + { + expr++; + } } } -- cgit v1.2.3