From ad0cde67e01a54a138acf760642d62aedbfece46 Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Fri, 29 Mar 2024 17:38:33 +0000 Subject: Add basic array manipulation --- subex/parse.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'subex/parse.go') diff --git a/subex/parse.go b/subex/parse.go index fa98ecc..9602a4b 100644 --- a/subex/parse.go +++ b/subex/parse.go @@ -293,6 +293,18 @@ func parseSubex(l RuneReader, minPower int, inType Type, outType Type) SubexAST panic("Missing matching ~") } lhs = SubexASTEnterString {lhs} + case '@': + if !accept(l, "(") { + panic("Missing ( after @") + } + lhs = parseSubex(l, 0, ValueType, ValueType) + if !accept(l, ")") { + panic("Missing matching )") + } + if !accept(l, "@") { + panic("Missing matching ~") + } + lhs = SubexASTEnterArray {lhs} // TODO // case '[': // rangeParts := parseRangeSubex(l) -- cgit v1.2.3