dust/tree-sitter-dust/corpus/functions.txt

112 lines
1.9 KiB
Plaintext
Raw Normal View History

==================
Simple Function
==================
function { "Hiya" }
---
(root
2023-10-31 13:31:10 +00:00
(block
(statement
(expression
(value
(function
(block
(statement
(expression
(value
(string)))))))))))
==================
Function Call
==================
(foobar "Hiya")
---
(root
2023-10-31 13:31:10 +00:00
(block
(statement
(expression
(function_call
(identifier)
(expression
(value
(string))))))))
==================
Complex Function
==================
function <message number> {
(output message)
(output number)
}
---
(root
2023-10-31 13:31:10 +00:00
(block
(statement
(expression
(value
(function
(identifier)
(identifier)
(block
(statement
(expression
2023-10-31 17:04:22 +00:00
(function_call
(built_in_function)
2023-10-31 13:31:10 +00:00
(expression
(identifier)))))
(statement
(expression
2023-10-31 17:04:22 +00:00
(function_call
(built_in_function)
2023-10-31 13:31:10 +00:00
(expression
(identifier))))))))))))
==================
Complex Function Call
==================
(foobar
"hi"
42
{
x = 1
y = 2
}
)
---
(root
2023-10-31 13:31:10 +00:00
(block
(statement
(expression
(function_call
(identifier)
(expression
(value
(string)))
(expression
(value
(integer)))
(expression
(value
(map
(identifier)
2023-10-31 17:04:22 +00:00
(statement
(expression
(value
(integer))))
2023-10-31 13:31:10 +00:00
(identifier)
2023-10-31 17:04:22 +00:00
(statement
(expression
(value
(integer))))))))))))