1
0
dust/tree-sitter-dust/corpus/tables.txt

110 lines
2.1 KiB
Plaintext
Raw Normal View History

==================
Table Declaration
==================
2023-10-18 23:26:49 +00:00
table <text, number> [
['answer', 42]
2023-10-18 23:26:49 +00:00
]
---
(root
(item
(statement
(expression
(value
(table
(identifier)
(identifier)
(expression
(value
(list
(expression
(value
2023-10-18 23:26:49 +00:00
(list
(expression
(value
(string)))
(expression
(value
(integer)))))))))))))))
==================
Table Assignment
==================
2023-10-18 23:26:49 +00:00
foobar = table <text, number> [
['answer', 42]
2023-10-18 23:26:49 +00:00
]
---
(root
(item
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(expression
(value
(table
(identifier)
(identifier)
(expression
(value
(list
(expression
(value
2023-10-18 23:26:49 +00:00
(list
(expression
(value
(string)))
(expression
(value
(integer)))))))))))))))))
==================
Table Access
==================
select number from foobar where text == 'answer'
---
(root
(item
(statement
(select
(identifier)
(identifier)
(expression
(logic
(expression
(identifier))
(logic_operator)
(expression
(value
(string)))))))))
==================
Table Insert
==================
insert ['bob was here', 0] into foobar
---
(root
(item
(statement
(insert
(list
(expression
(value
(string)))
(expression
(value
(integer))))
(identifier)))))