tree-sitter-dust/corpus/lists.txt

132 lines
2.3 KiB
Plaintext
Raw Normal View History

2023-09-29 21:19:23 +00:00
==================
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
==================
2023-09-30 19:47:21 +00:00
x = foobar.0
2023-09-29 21:19:23 +00:00
---
(root
(item
(statement
(open_statement
(expression
(operation
(expression
(identifier))
(operator)
(expression
2023-09-30 19:50:20 +00:00
(identifier))))))))
2023-09-29 21:19:23 +00:00
==================
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)))))))))))))))