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

105 lines
1.8 KiB
Plaintext
Raw Normal View History

==================
Table Declaration
==================
table <text, number> {
['answer', 42]
}
---
(root
(item
(statement
(expression
(value
(table
(identifier)
(identifier)
(expression
(value
(list
(expression
(value
(string)))
(expression
(value
(integer))))))))))))
==================
Table Assignment
==================
foobar = table <text, number> {
['answer', 42]
}
---
(root
(item
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(expression
(value
(table
(identifier)
(identifier)
(expression
(value
(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)))))