From d3d17484012dc603ae326bec419cff990898e6a0 Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Wed, 19 Apr 2023 13:48:15 +0100 Subject: Adds the reciprocal operator --- subex/parse.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'subex/parse.go') 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 { -- cgit v1.2.3