diff options
author | Charlie Stanton <charlie@shtanton.xyz> | 2023-07-21 19:53:14 +0100 |
---|---|---|
committer | Charlie Stanton <charlie@shtanton.xyz> | 2023-07-21 19:53:14 +0100 |
commit | e832b30f31c56614afe689035af4e04a29e77896 (patch) | |
tree | 5f49bc944b9505717541d774f1df3fa537720477 /subex/parse.go | |
parent | bed0e712deda5038f52e495bacae003098df7a55 (diff) | |
download | stred-go-e832b30f31c56614afe689035af4e04a29e77896.tar |
Adds an incredibly simple equality operator
Diffstat (limited to 'subex/parse.go')
-rw-r--r-- | subex/parse.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/subex/parse.go b/subex/parse.go index 2392b22..35baaa2 100644 --- a/subex/parse.go +++ b/subex/parse.go @@ -260,7 +260,7 @@ func parseSubex(l RuneReader, minPower int, runic bool) SubexAST { // case '[': // rangeParts := parseRangeSubex(l) // lhs = SubexASTRange {rangeParts} - case ')', ']', '"', '|', ';', '{', '+', '-', '*', '/', '!', '$': + case ')', ']', '"', '|', ';', '{', '+', '-', '*', '/', '!', '=', '$': l.Rewind() return SubexASTEmpty{} // case '=': @@ -366,6 +366,8 @@ func parseSubex(l RuneReader, minPower int, runic bool) SubexAST { lhs = SubexASTReciprocal {lhs} case r == '!' && minPower <= 4: lhs = SubexASTNot {lhs} + case r == '=' && minPower <= 4: + lhs = SubexASTEqual {lhs} case r == '$' && minPower <= 4: slot := l.Next() if slot == eof { |