1
0
dust/tree-sitter-dust/corpus/lists.txt
2023-10-29 19:31:06 -04:00

144 lines
2.5 KiB
Plaintext

==================
List Declaration
==================
['answer', 42]
---
(root
(item
(statement
(expression
(value
(list
(expression
(value
(string)))
(expression
(value
(integer)))))))))
==================
List Assignment
==================
empty = []
foobar = ['foobar']
---
(root
(item
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(expression
(value
(list)))))))
(item
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(expression
(value
(list
(expression
(value
(string)))))))))))
==================
List Nesting
==================
['answers', [42, [666]]]
---
(root
(item
(statement
(expression
(value
(list
(expression
(value
(string)))
(expression
(value
(list
(expression
(value
(integer)))
(expression
(value
(list
(expression
(value
(integer)))))))))))))))
==================
List Index
==================
['answers', 42, 666].{1}
---
(root
(item
(statement
(expression
(index
(expression
(value
(list
(expression
(value
(string)))
(expression
(value
(integer)))
(expression
(value
(integer))))))
(expression
(value
(integer))))))))
==================
Sublist
==================
['answers', 42, 666].{1..2}
---
(root
(item
(statement
(expression
(index
(expression
(value
(list
(expression
(value
(string)))
(expression
(value
(integer)))
(expression
(value
(integer))))))
(expression
(value
(integer)))
(expression
(value
(integer))))))))