mirror of
https://github.com/danog/parser.git
synced 2024-12-13 17:37:20 +01:00
93 lines
2.9 KiB
Plaintext
93 lines
2.9 KiB
Plaintext
|
[
|
||
|
Function {
|
||
|
name: Identifier {
|
||
|
name: "fib",
|
||
|
},
|
||
|
params: [
|
||
|
Param {
|
||
|
name: Variable {
|
||
|
name: "n",
|
||
|
},
|
||
|
type: None,
|
||
|
variadic: false,
|
||
|
default: None,
|
||
|
flags: [],
|
||
|
by_ref: false,
|
||
|
},
|
||
|
],
|
||
|
body: [
|
||
|
If {
|
||
|
condition: Infix {
|
||
|
lhs: Variable {
|
||
|
name: "n",
|
||
|
},
|
||
|
op: LessThan,
|
||
|
rhs: LiteralInteger {
|
||
|
i: 2,
|
||
|
},
|
||
|
},
|
||
|
then: [
|
||
|
Return {
|
||
|
value: Some(
|
||
|
Variable {
|
||
|
name: "n",
|
||
|
},
|
||
|
),
|
||
|
},
|
||
|
],
|
||
|
else_ifs: [],
|
||
|
else: None,
|
||
|
},
|
||
|
Return {
|
||
|
value: Some(
|
||
|
Infix {
|
||
|
lhs: Call {
|
||
|
target: Identifier {
|
||
|
name: "fib",
|
||
|
},
|
||
|
args: [
|
||
|
Arg {
|
||
|
name: None,
|
||
|
value: Infix {
|
||
|
lhs: Variable {
|
||
|
name: "n",
|
||
|
},
|
||
|
op: Sub,
|
||
|
rhs: LiteralInteger {
|
||
|
i: 1,
|
||
|
},
|
||
|
},
|
||
|
unpack: false,
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
op: Add,
|
||
|
rhs: Call {
|
||
|
target: Identifier {
|
||
|
name: "fib",
|
||
|
},
|
||
|
args: [
|
||
|
Arg {
|
||
|
name: None,
|
||
|
value: Infix {
|
||
|
lhs: Variable {
|
||
|
name: "n",
|
||
|
},
|
||
|
op: Sub,
|
||
|
rhs: LiteralInteger {
|
||
|
i: 2,
|
||
|
},
|
||
|
},
|
||
|
unpack: false,
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
),
|
||
|
},
|
||
|
],
|
||
|
return_type: None,
|
||
|
by_ref: false,
|
||
|
},
|
||
|
]
|