From 00b03aec5bf5c5b866d971a9c29e43acd276c87e Mon Sep 17 00:00:00 2001 From: ggn Date: Fri, 13 Nov 2015 10:27:46 +0200 Subject: [PATCH] Fix for initial plus in expression throwing a "bad expression error" --- expr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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++; -- 2.37.2