tree-sitter-dust/corpus/functions.txt

106 lines
1.6 KiB
Plaintext
Raw Normal View History

2023-09-29 18:32:18 +00:00
==================
Simple Function
==================
2023-10-06 10:18:02 +00:00
function { "Hiya" }
2023-09-29 18:32:18 +00:00
---
(root
(item
(statement
2023-10-01 05:13:29 +00:00
(expression
(value
(function
(statement
(expression
(value
(string))))))))))
2023-09-29 18:32:18 +00:00
2023-10-01 01:12:35 +00:00
==================
Function Call
==================
2023-10-06 12:16:34 +00:00
foobar("Hiya")
2023-10-01 01:12:35 +00:00
---
(root
(item
(statement
2023-10-01 05:13:29 +00:00
(expression
(function_call
(identifier)
2023-10-01 10:09:29 +00:00
(expression
(value
(string))))))))
2023-10-01 01:12:35 +00:00
2023-09-29 18:32:18 +00:00
==================
Complex Function
==================
2023-10-06 10:18:02 +00:00
function <message number> {
2023-09-29 18:32:18 +00:00
output message
output number
}
---
(root
(item
(statement
2023-10-01 05:13:29 +00:00
(expression
(value
(function
(identifier)
(identifier)
(statement
(expression
(identifier)))
(statement
(expression
(identifier)))
(statement
(expression
(identifier)))
(statement
(expression
2023-10-06 12:16:34 +00:00
(identifier)))))))))
==================
Complex Function Call
==================
foobar (
"hi"
42
{
x = 1
y = 2
}
)
---
(root
(item
(statement
(expression
(function_call
(identifier)
(expression
(value
(string)))
(expression
(value
(integer)))
(expression
(value
(map
(identifier)
(value
(integer))
(identifier)
(value
(integer))))))))))