aboutsummaryrefslogtreecommitdiff
path: root/pc.y
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-09-02 13:34:06 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-09-03 16:26:04 -0400
commit4fced0fc39d3aeacb3c6d434aeeb622468a857cc (patch)
treec92a2fa59466efd83d58448159c959ae5ae97343 /pc.y
parent389c2765afebb0b6112493e53117405488a4f3f1 (diff)
Add unary minus to parsing
Diffstat (limited to 'pc.y')
-rw-r--r--pc.y6
1 files changed, 6 insertions, 0 deletions
diff --git a/pc.y b/pc.y
index d679c18..ca94f5d 100644
--- a/pc.y
+++ b/pc.y
@@ -402,5 +402,11 @@ factor
{
$$ = mktree(NOT, $2, NULL);
}
+ |ADDOP factor{
+ if ($1 != SUB)
+ yyerror("SUB NOT CORRECT\n");
+ else
+ $$ = mktree(SUB, $2, NULL);
+ }
;