tree-sitter-dust/corpus/tables.txt

102 lines
1.7 KiB
Plaintext
Raw Normal View History

2023-09-29 18:32:18 +00:00
==================
2023-09-29 20:34:20 +00:00
Table Declaration
2023-09-29 18:32:18 +00:00
==================
table <text, number> {
2023-09-29 20:34:20 +00:00
['answer', 42]
2023-09-29 18:32:18 +00:00
}
---
(root
(item
(statement
(open_statement
(expression
(value
(table
(identifier)
(identifier)
(list
(value
(string))
(value
(integer))))))))))
2023-09-29 20:34:20 +00:00
==================
Table Assignment
==================
foobar = table <text, number> {
['answer', 42]
}
---
(root
(item
(statement
(open_statement
(expression
(operation
(expression
(identifier))
(operator)
(expression
(value
(table
(identifier)
(identifier)
(list
(value
(string))
(value
2023-09-30 19:47:21 +00:00
(integer))))))))))))
2023-09-29 20:54:13 +00:00
==================
Table Access
==================
select number from foobar where text == 'answer'
---
(root
(item
(statement
(open_statement
(expression
2023-09-30 20:06:01 +00:00
(select
(identifier)
(identifier)
2023-09-29 20:54:13 +00:00
(expression
2023-09-30 20:06:01 +00:00
(operation
(expression
(identifier))
(operator)
(expression
(value
(string)))))))))))
2023-09-29 20:54:13 +00:00
==================
Table Insert
==================
insert ['bob was here', 0] into foobar
---
(root
(item
(statement
(open_statement
(expression
2023-09-30 20:17:09 +00:00
(insert
(list
2023-09-30 19:47:21 +00:00
(value
2023-09-30 20:17:09 +00:00
(string))
(value
(integer)))
(identifier)))))))