scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 1f09b3f3edd53ace12c72126f5bbad44f4ae8e8b
parent 1c3ae449cdff510ea0a8d628f60f8749442abe10
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 10 Sep 2014 17:19:39 +0200

Fix !, y and j functions of cc2

! is an unary operator, not a binary. y and j are special cases where they don't
push or pop anything. I don't know how to handle them, but this is a good case
where is better mark them as invalid and do it later.

Diffstat:
cc2/parser.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cc2/parser.c b/cc2/parser.c @@ -305,8 +305,9 @@ static void (*optbl[])(char *) = { [']'] = operator, ['['] = operator, ['='] = operator, - ['!'] = operator, - ['y'] = operator, + ['!'] = unary, + ['y'] = NULL, + ['j'] = NULL, ['o'] = operator, ['_'] = unary, ['~'] = unary,