tree-sitter-dust/corpus/lists.txt
2023-09-30 16:06:01 -04:00

132 lines
2.3 KiB
Plaintext

==================
List Declaration
==================
['answer', 42]
---
(root
(item
(statement
(open_statement
(expression
(value
(list
(value
(string))
(value
(integer)))))))))
==================
List Assignment
==================
foobar = ['answer', 42]
---
(root
(item
(statement
(open_statement
(expression
(operation
(expression
(identifier))
(operator)
(expression
(value
(list
(value
(string))
(value
(integer)))))))))))
==================
List Access
==================
x = foobar.0
---
(root
(item
(statement
(open_statement
(expression
(operation
(expression
(identifier))
(operator)
(expression
(identifier))))))))
==================
List Mutation
==================
foobar = ['answer', 42]
foobar += 'hiya'
---
(root
(item
(statement
(open_statement
(expression
(operation
(expression
(identifier))
(operator)
(expression
(value
(list
(value
(string))
(value
(integer))))))))))
(item
(statement
(open_statement
(expression
(operation
(expression
(identifier))
(operator)
(expression
(value
(string)))))))))
==================
List Nesting
==================
foobar = ['answers', [42, [666]]]
---
(root
(item
(statement
(open_statement
(expression
(operation
(expression
(identifier))
(operator)
(expression
(value
(list
(value
(string))
(value
(list
(value
(integer))
(value
(list
(value
(integer)))))))))))))))