mirror of
https://github.com/danog/parser.git
synced 2024-12-12 09:09:37 +01:00
218 lines
8.8 KiB
Plaintext
218 lines
8.8 KiB
Plaintext
[
|
|
Function(
|
|
Function {
|
|
start: (
|
|
3,
|
|
1,
|
|
),
|
|
end: (
|
|
9,
|
|
1,
|
|
),
|
|
name: Identifier {
|
|
start: (
|
|
3,
|
|
10,
|
|
),
|
|
name: "fib",
|
|
end: (
|
|
3,
|
|
13,
|
|
),
|
|
},
|
|
attributes: [],
|
|
parameters: FunctionParameterList {
|
|
start: (
|
|
3,
|
|
13,
|
|
),
|
|
end: (
|
|
3,
|
|
18,
|
|
),
|
|
members: [
|
|
FunctionParameter {
|
|
start: (
|
|
3,
|
|
14,
|
|
),
|
|
end: (
|
|
3,
|
|
16,
|
|
),
|
|
name: Variable {
|
|
start: (
|
|
3,
|
|
14,
|
|
),
|
|
name: "n",
|
|
end: (
|
|
3,
|
|
16,
|
|
),
|
|
},
|
|
attributes: [],
|
|
type: None,
|
|
variadic: false,
|
|
default: None,
|
|
by_ref: false,
|
|
},
|
|
],
|
|
},
|
|
return_type: None,
|
|
by_ref: false,
|
|
body: [
|
|
If {
|
|
condition: ComparisonOperation(
|
|
LessThan {
|
|
left: Variable(
|
|
Variable {
|
|
start: (
|
|
4,
|
|
9,
|
|
),
|
|
name: "n",
|
|
end: (
|
|
4,
|
|
12,
|
|
),
|
|
},
|
|
),
|
|
span: (
|
|
4,
|
|
12,
|
|
),
|
|
right: LiteralInteger {
|
|
i: "2",
|
|
},
|
|
},
|
|
),
|
|
then: [
|
|
Return {
|
|
value: Some(
|
|
Variable(
|
|
Variable {
|
|
start: (
|
|
5,
|
|
16,
|
|
),
|
|
name: "n",
|
|
end: (
|
|
5,
|
|
18,
|
|
),
|
|
},
|
|
),
|
|
),
|
|
},
|
|
],
|
|
else_ifs: [],
|
|
else: None,
|
|
},
|
|
Return {
|
|
value: Some(
|
|
ArithmeticOperation(
|
|
Addition {
|
|
left: Call {
|
|
target: Identifier(
|
|
Identifier {
|
|
start: (
|
|
8,
|
|
12,
|
|
),
|
|
name: "fib",
|
|
end: (
|
|
8,
|
|
15,
|
|
),
|
|
},
|
|
),
|
|
args: [
|
|
Arg {
|
|
name: None,
|
|
value: ArithmeticOperation(
|
|
Subtraction {
|
|
left: Variable(
|
|
Variable {
|
|
start: (
|
|
8,
|
|
16,
|
|
),
|
|
name: "n",
|
|
end: (
|
|
8,
|
|
19,
|
|
),
|
|
},
|
|
),
|
|
span: (
|
|
8,
|
|
19,
|
|
),
|
|
right: LiteralInteger {
|
|
i: "1",
|
|
},
|
|
},
|
|
),
|
|
unpack: false,
|
|
},
|
|
],
|
|
},
|
|
span: (
|
|
8,
|
|
24,
|
|
),
|
|
right: Call {
|
|
target: Identifier(
|
|
Identifier {
|
|
start: (
|
|
8,
|
|
26,
|
|
),
|
|
name: "fib",
|
|
end: (
|
|
8,
|
|
29,
|
|
),
|
|
},
|
|
),
|
|
args: [
|
|
Arg {
|
|
name: None,
|
|
value: ArithmeticOperation(
|
|
Subtraction {
|
|
left: Variable(
|
|
Variable {
|
|
start: (
|
|
8,
|
|
30,
|
|
),
|
|
name: "n",
|
|
end: (
|
|
8,
|
|
33,
|
|
),
|
|
},
|
|
),
|
|
span: (
|
|
8,
|
|
33,
|
|
),
|
|
right: LiteralInteger {
|
|
i: "2",
|
|
},
|
|
},
|
|
),
|
|
unpack: false,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
),
|
|
),
|
|
},
|
|
],
|
|
},
|
|
),
|
|
]
|