diff options
Diffstat (limited to 'lr.c')
-rw-r--r-- | lr.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lr.c b/lr.c index b7c8d1b..8db5916 100644 --- a/lr.c +++ b/lr.c @@ -164,6 +164,8 @@ parse_op() return 0; } +struct expr *parse_cmp(); + struct expr * parse_inner() { @@ -171,6 +173,12 @@ parse_inner() struct expr *e = malloc (sizeof (struct expr)); e->op = EXPR_PRUNE; return e; + } else if (token("!")) { + struct expr *e = parse_cmp(); + struct expr *not = malloc (sizeof (struct expr)); + not->op = EXPR_NOT; + not->a.expr = e; + return not; } else return 0; // TODO negation |