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

76 lines
2.6 KiB
Plaintext
Raw Permalink Normal View History

2024-01-28 22:46:15 +00:00
================================================================================
Fibonacci
================================================================================
fib = (i <int>) <int> {
if i <= 1 {
1
} else {
self(i - 1) + self(i - 2)
}
}
--------------------------------------------------------------------------------
(root
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(expression
(value
(function
(identifier)
(type_specification
(type))
(type_specification
(type))
(block
(statement
(if_else
(if
(expression
(logic
(expression
(identifier))
(logic_operator)
(expression
(value
(integer)))))
(block
(statement
(expression
(value
(integer))))))
(else
(block
(statement
(expression
(math
(expression
(function_call
(function_expression
(identifier))
(expression
(math
(expression
(identifier))
(math_operator)
(expression
(value
(integer)))))))
(math_operator)
(expression
(function_call
(function_expression
(identifier))
(expression
(math
(expression
(identifier))
(math_operator)
(expression
(value
(integer))))))))))))))))))))))