57 lines
1.4 KiB
Text
57 lines
1.4 KiB
Text
fun fib_rec(f1: f64,
|
|
|
|
fun fib(n: f64) -> f64 {
|
|
fib_rec(1, 1, n)
|
|
}
|
|
|
|
// @concrete:
|
|
// | File
|
|
// | FunctionDecl
|
|
// | Fun:'"fun"'
|
|
// | Identifier:'"fib_rec"'
|
|
// | ParamList
|
|
// | LeftParen:'"("'
|
|
// | Parameter
|
|
// | Identifier:'"f1"'
|
|
// | Colon:'":"'
|
|
// | TypeExpression
|
|
// | Identifier:'"f64"'
|
|
// | Comma:'","'
|
|
// | Error:'"Error at 'fun': expect ')' to end a parameter list"'
|
|
// | FunctionDecl
|
|
// | Fun:'"fun"'
|
|
// | Identifier:'"fib"'
|
|
// | ParamList
|
|
// | LeftParen:'"("'
|
|
// | Parameter
|
|
// | Identifier:'"n"'
|
|
// | Colon:'":"'
|
|
// | TypeExpression
|
|
// | Identifier:'"f64"'
|
|
// | RightParen:'")"'
|
|
// | ReturnType
|
|
// | Arrow:'"->"'
|
|
// | TypeExpression
|
|
// | Identifier:'"f64"'
|
|
// | Block
|
|
// | LeftBrace:'"{"'
|
|
// | ExpressionStatement
|
|
// | CallExpression
|
|
// | Identifier
|
|
// | Identifier:'"fib_rec"'
|
|
// | ArgumentList
|
|
// | LeftParen:'"("'
|
|
// | Argument
|
|
// | LiteralExpression
|
|
// | Number:'"1"'
|
|
// | Comma:'","'
|
|
// | Argument
|
|
// | LiteralExpression
|
|
// | Number:'"1"'
|
|
// | Comma:'","'
|
|
// | Argument
|
|
// | Identifier
|
|
// | Identifier:'"n"'
|
|
// | RightParen:'")"'
|
|
// | RightBrace:'"}"'
|
|
//
|