<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/subex/parse.go
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2023-04-19 13:48:15 +0100
committerCharlie Stanton <charlie@shtanton.xyz>2023-04-19 13:48:15 +0100
commitd3d17484012dc603ae326bec419cff990898e6a0 (patch)
tree44aa5b05b6aa3f9b988e6cd59ddacec04660ff32 /subex/parse.go
parent58d50737702adc48604f0a709080dcc587d7145f (diff)
downloadstred-go-d3d17484012dc603ae326bec419cff990898e6a0.tar
Adds the reciprocal operator
Diffstat (limited to 'subex/parse.go')
-rw-r--r--subex/parse.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/subex/parse.go b/subex/parse.go
index 8635186..f5316c9 100644
--- a/subex/parse.go
+++ b/subex/parse.go
@@ -240,6 +240,8 @@ func parseSubex(l *RuneReader, minPower int) SubexAST {
lhs = SubexASTProduct {lhs}
case r == '-' && minPower <= 8:
lhs = SubexASTNegate {lhs}
+ case r == '/' && minPower <= 8:
+ lhs = SubexASTReciprocal {lhs}
case r == '$' && minPower <= 8:
slot := l.next()
if slot == eof {