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

114 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
==================
2023-10-21 17:04:17 +00:00
select <number> from foobar {
text == 'answer'
}
---
(root
(item
(statement
(select
(identifier)
2023-10-21 17:04:17 +00:00
(expression
(identifier))
(item
(statement
(expression
2023-10-21 17:04:17 +00:00
(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)))))