implement support for multiple index operations

This commit is contained in:
alex committed 2025-07-26 16:31:12 -07:00
1 parent b451f74239
commit 48e19a8068
2 files changed
+5 -1

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
export func main() {
let items = [["Hello"], ["Goodbye"]]
println(items[0][0])
}
@@ -63,7 +63,7 @@ class Parser(source: TokenSource, attribution: NodeAttribution) :
}
}
if (peek(TokenType.LeftBracket)) {
while (peek(TokenType.LeftBracket)) {
expression = produce(NodeType.IndexedBy) {
attribution.adopt(expression)
expect(TokenType.LeftBracket)