tree-sitter-dust/corpus/tables.txt
2023-09-30 16:17:09 -04:00

102 lines
1.7 KiB
Plaintext

==================
Table Declaration
==================
table <text, number> {
['answer', 42]
}
---
(root
(item
(statement
(open_statement
(expression
(value
(table
(identifier)
(identifier)
(list
(value
(string))
(value
(integer))))))))))
==================
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
(integer))))))))))))
==================
Table Access
==================
select number from foobar where text == 'answer'
---
(root
(item
(statement
(open_statement
(expression
(select
(identifier)
(identifier)
(expression
(operation
(expression
(identifier))
(operator)
(expression
(value
(string)))))))))))
==================
Table Insert
==================
insert ['bob was here', 0] into foobar
---
(root
(item
(statement
(open_statement
(expression
(insert
(list
(value
(string))
(value
(integer)))
(identifier)))))))