tree-sitter-dust/corpus/tables.txt

94 lines
1.4 KiB
Plaintext
Raw Normal View History

2023-09-29 18:32:18 +00:00
==================
2023-09-29 20:34:20 +00:00
Table Declaration
2023-09-29 18:32:18 +00:00
==================
table <text, number> {
2023-09-29 20:34:20 +00:00
['answer', 42]
2023-09-29 18:32:18 +00:00
}
---
(root
(item
(statement
2023-10-01 04:01:02 +00:00
(expression
(value
(table
(identifier)
(identifier)
(list
(value
(string))
(value
(integer)))))))))
2023-09-29 20:34:20 +00:00
==================
Table Assignment
==================
foobar = table <text, number> {
['answer', 42]
}
---
(root
(item
(statement
2023-10-06 02:05:18 +00:00
(assignment
(identifier)
2023-10-06 10:18:02 +00:00
(statement
(expression
(value
(table
(identifier)
(identifier)
(list
(value
(string))
(value
(integer)))))))))))
2023-10-06 02:05:18 +00:00
2023-09-29 20:54:13 +00:00
==================
Table Access
==================
select number from foobar where text == 'answer'
---
(root
(item
(statement
2023-10-06 02:05:18 +00:00
(select
(identifier)
(identifier)
(expression
(logic
(expression
(identifier))
(logic_operator)
2023-10-06 02:05:18 +00:00
(expression
(value
(string)))))))))
2023-09-30 20:06:01 +00:00
2023-09-29 20:54:13 +00:00
==================
Table Insert
==================
insert ['bob was here', 0] into foobar
---
(root
(item
(statement
2023-10-06 02:05:18 +00:00
(insert
(list
(value
(string))
(value
(integer)))
(identifier)))))