summary refs log tree commit diff
path: root/bin/bit.y
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-12-30 18:31:36 -0500
committerJune McEnroe <june@causal.agency>2020-12-30 18:31:36 -0500
commitb3d41d6df5a1f49ea7f3a2be1279a1c63e2d30fc (patch)
tree1b5996c5ef866eb77ded663c77950d365b6dc038 /bin/bit.y
parentAdd make lexer (diff)
downloadsrc-b3d41d6df5a1f49ea7f3a2be1279a1c63e2d30fc.tar.gz
src-b3d41d6df5a1f49ea7f3a2be1279a1c63e2d30fc.zip
Add postfix $ operator to bit
Diffstat (limited to '')
-rw-r--r--bin/bit.y2
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/bit.y b/bin/bit.y
index 7843419e..583a0280 100644
--- a/bin/bit.y
+++ b/bin/bit.y
@@ -35,6 +35,7 @@ static uint64_t vars[128];
 
 %}
 
+%left '$'
 %right '='
 %left '|'
 %left '^'
@@ -75,6 +76,7 @@ expr:
 	| expr '^' expr { $$ = $1 ^ $3; }
 	| expr '|' expr { $$ = $1 | $3; }
 	| Var '=' expr { $$ = vars[$1] = $3; }
+	| expr '$' { $$ = $1; }
 	;
 
 %%