81 lines
3.1 KiB
Plaintext
81 lines
3.1 KiB
Plaintext
================================================================================
|
|
Fibonacci
|
|
================================================================================
|
|
|
|
fib = (i <int>) <int> {
|
|
if i <= 1 {
|
|
1
|
|
} else {
|
|
self(i - 1) + self(i - 2)
|
|
}
|
|
}
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(root
|
|
(statement
|
|
(statement_kind
|
|
(assignment
|
|
(identifier)
|
|
(assignment_operator)
|
|
(statement
|
|
(statement_kind
|
|
(expression
|
|
(value
|
|
(anonymous_function
|
|
(identifier)
|
|
(type_specification
|
|
(type))
|
|
(type_specification
|
|
(type))
|
|
(block
|
|
(statement
|
|
(statement_kind
|
|
(if_else
|
|
(if
|
|
(expression
|
|
(logic
|
|
(expression
|
|
(identifier))
|
|
(logic_operator)
|
|
(expression
|
|
(value
|
|
(integer)))))
|
|
(block
|
|
(statement
|
|
(statement_kind
|
|
(expression
|
|
(value
|
|
(integer)))))))
|
|
(else
|
|
(block
|
|
(statement
|
|
(statement_kind
|
|
(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))))))))))))))))))))))))))
|