diff options
author | Charlie Stanton <charlie@shtanton.xyz> | 2024-03-29 17:38:33 +0000 |
---|---|---|
committer | Charlie Stanton <charlie@shtanton.xyz> | 2024-03-29 17:38:33 +0000 |
commit | ad0cde67e01a54a138acf760642d62aedbfece46 (patch) | |
tree | a0c680a93cb5042f89bb7552943fb210c4d6ae57 /subex/parse.go | |
parent | 080a24e894f125d4f1741cfdcba7cb722304d209 (diff) | |
download | stred-go-ad0cde67e01a54a138acf760642d62aedbfece46.tar |
Add basic array manipulation
Diffstat (limited to 'subex/parse.go')
-rw-r--r-- | subex/parse.go | 12 |
1 files changed, 12 insertions, 0 deletions
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) |