From: ggn Date: Fri, 13 Nov 2015 08:27:46 +0000 (+0200) Subject: Fix for initial plus in expression throwing a "bad expression error" X-Git-Tag: v2.1.0~180 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=commitdiff_plain;h=00b03aec5bf5c5b866d971a9c29e43acd276c87e Fix for initial plus in expression throwing a "bad expression error" --- diff --git a/expr.c b/expr.c index 0ecaa45..063066e 100644 --- a/expr.c +++ b/expr.c @@ -122,6 +122,9 @@ int expr0(void) // // Unary operators (detect unary '-') +// ggn: If expression starts with a plus then also eat it up. +// For some reason the parser gets confused when this happens and +// emits a "bad expression". // int expr1(void) { @@ -134,7 +137,7 @@ int expr1(void) class = tokenClass[*tok]; - if (*tok == '-' || class == UNARY) + if (*tok == '-' || *tok == '+' || class == UNARY) { t = *tok++;