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

121 lines
2.3 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 into foobar [
['bob was here', 0]
]
---
(root
(item
(statement
(insert
(identifier)
2023-10-22 18:29:07 +00:00
(expression
(value
(list
(expression
(value
(list
(expression
(value
(string)))
(expression
(value
(integer)))))))))))))