diff --git a/examples/index.pork b/examples/index.pork new file mode 100644 index 0000000..d3ecdea --- /dev/null +++ b/examples/index.pork @@ -0,0 +1,4 @@ +export func main() { + let items = [["Hello"], ["Goodbye"]] + println(items[0][0]) +} diff --git a/parser/src/main/kotlin/gay/pizza/pork/parser/Parser.kt b/parser/src/main/kotlin/gay/pizza/pork/parser/Parser.kt index 8be465e..e66b8e6 100644 --- a/parser/src/main/kotlin/gay/pizza/pork/parser/Parser.kt +++ b/parser/src/main/kotlin/gay/pizza/pork/parser/Parser.kt @@ -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)