summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-05-15 23:19:00 -0400
committerJune McEnroe <june@causal.agency>2019-05-15 23:19:00 -0400
commit43730738b397cf1a501dde5d9aad0da0215d9fc7 (patch)
tree13d402082b94d04259c067251199318efcb70a9a /bin
parentImplement sizeof in order (diff)
downloadsrc-43730738b397cf1a501dde5d9aad0da0215d9fc7.tar.gz
src-43730738b397cf1a501dde5d9aad0da0215d9fc7.zip
Support simple assignment in order
Diffstat (limited to '')
-rw-r--r--bin/man1/order.12
-rw-r--r--bin/order.y4
2 files changed, 4 insertions, 2 deletions
diff --git a/bin/man1/order.1 b/bin/man1/order.1
index 5a01ab4b..2eb730f1 100644
--- a/bin/man1/order.1
+++ b/bin/man1/order.1
@@ -31,4 +31,4 @@ $ order 'a & b << 1'
 does not support the
 .Sy (type)
 operator
-or the assignment operators.
+or the compound assignment operators.
diff --git a/bin/order.y b/bin/order.y
index 83d6a37f..a7bb817f 100644
--- a/bin/order.y
+++ b/bin/order.y
@@ -44,9 +44,10 @@ static int yylex(void);
 
 %}
 
-%token Var Arr Inc Dec Sizeof Shl Shr Le Ge Eq Ne And Or
+%token Var
 
 %left ','
+%right '='
 %right '?' ':'
 %left Or
 %left And
@@ -102,6 +103,7 @@ expr:
 	| expr And expr { $$ = fmt("(%s && %s)", $1, $3); }
 	| expr Or expr { $$ = fmt("(%s || %s)", $1, $3); }
 	| expr '?' expr ':' expr { $$ = fmt("(%s ? %s : %s)", $1, $3, $5); }
+	| expr '=' expr { $$ = fmt("(%s = %s)", $1, $3); }
 	| expr ',' expr { $$ = fmt("(%s, %s)", $1, $3); }
 	;
 
p with /bin/shJune McEnroe 2018-08-18Use whence instead of typeJune McEnroe type is an alias for whence -v and is more for human consumption. 2018-08-18Cut off path components until right prompt fitsJune McEnroe Keeps paths valid (from somehwere) rather than abrupt truncation. 2018-08-17Add "private" alias to source encrypted fileJune McEnroe Why is there no easy way to *edit* an encrypted file? 2018-08-17Add vim mapping to add a #includeJune McEnroe