From f1e5bc37723a4faa30bbfeed392c31489914eb50 Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Fri, 21 Apr 2023 09:53:04 +0100 Subject: Add subex syntax to copy across booleans, numbers, strings and values --- subex/parse.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'subex/parse.go') diff --git a/subex/parse.go b/subex/parse.go index 5675ae0..106663d 100644 --- a/subex/parse.go +++ b/subex/parse.go @@ -281,7 +281,7 @@ func parseSubex(l RuneReader, minPower int) SubexAST { case '[': rangeParts := parseRangeSubex(l) lhs = SubexASTRange {rangeParts} - case ')', '|', ';', '{', '+', '-', '*', '/', '$': + case ')', '|', ';', '{', '+', '-', '*', '/', '!', '$': l.Rewind() return nil case '=': @@ -289,6 +289,16 @@ func parseSubex(l RuneReader, minPower int) SubexAST { lhs = SubexASTOutput{replacement} case '.': lhs = SubexASTCopyAny{} + case '?': + lhs = SubexASTCopyBool{} + case '%': + lhs = SubexASTCopyNumber{} + case '_': + lhs = SubexASTCopyStringAtom{} + case '#': + lhs = SubexASTCopyString{} + case ',': + lhs = SubexASTCopyValue{} case '"': lhs = SubexASTCopyAtom {walk.StringTerminal{}} case '`': -- cgit v1.2.3