projects
/
rmac
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
044e6a2
)
Fix for initial plus in expression throwing a "bad expression error"
author
ggn
<ggn.dbug@gmail.com>
Fri, 13 Nov 2015 08:27:46 +0000
(10:27 +0200)
committer
Shamus Hammons
<jlhamm@acm.org>
Sat, 14 Nov 2015 16:42:31 +0000
(10:42 -0600)
expr.c
patch
|
blob
|
history
diff --git
a/expr.c
b/expr.c
index 0ecaa45316e2e69baa173512a79ab643ecf94b4f..063066ede1dd58ba9265ae1bba965d5789d4593e 100644
(file)
--- 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++;