summary refs log tree commit diff
path: root/bin/order.y
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-05-19 19:08:21 -0400
committerJune McEnroe <june@causal.agency>2019-05-19 19:08:21 -0400
commit44e7342cc3b13404df73945a9304dcc52b9aae10 (patch)
tree201f566f24df0abe9c82da1c2d217d9bef89dee9 /bin/order.y
parentAdd compound assignment operators to order (diff)
downloadsrc-44e7342cc3b13404df73945a9304dcc52b9aae10.tar.gz
src-44e7342cc3b13404df73945a9304dcc52b9aae10.zip
Specify precedence of unary versions of operators
Diffstat (limited to 'bin/order.y')
-rw-r--r--bin/order.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/order.y b/bin/order.y
index 78051fe1..5bb93f9b 100644
--- a/bin/order.y
+++ b/bin/order.y
@@ -80,9 +80,9 @@ expr:
 	| Dec expr { $$ = fmt("(--%s)", $2); }
 	| expr Inc { $$ = fmt("(%s++)", $1); }
 	| expr Dec { $$ = fmt("(%s--)", $1); }
-	| '-' expr { $$ = fmt("(-%s)", $2); }
-	| '*' expr { $$ = fmt("(*%s)", $2); }
-	| '&' expr { $$ = fmt("(&%s)", $2); }
+	| '-' expr %prec '!' { $$ = fmt("(-%s)", $2); }
+	| '*' expr %prec '!' { $$ = fmt("(*%s)", $2); }
+	| '&' expr %prec '!' { $$ = fmt("(&%s)", $2); }
 	| Sizeof expr { $$ = fmt("(sizeof %s)", $2); }
 	| expr '*' expr { $$ = fmt("(%s * %s)", $1, $3); }
 	| expr '/' expr { $$ = fmt("(%s / %s)", $1, $3); }