parser/tests/fixtures/0018/ast.txt
Saif Eddin Gmati 9a2a903fb9
chore: refactor ast (#162)
Signed-off-by: azjezz <azjezz@protonmail.com>
2022-12-06 09:33:29 +01:00

140 lines
3.1 KiB
Plaintext

[
Function(
Function {
start: (
3,
1,
),
end: (
9,
1,
),
name: Identifier {
start: (
3,
10,
),
name: "a",
end: (
3,
11,
),
},
attributes: [],
parameters: FunctionParameterList {
start: (
3,
11,
),
end: (
3,
13,
),
members: [],
},
return_type: Some(
Null,
),
by_ref: false,
body: [
Echo {
values: [
LiteralString {
value: "looping..\n",
},
],
},
Return {
value: Some(
Null,
),
},
],
},
),
Expression {
expr: Infix {
lhs: Variable(
Variable {
start: (
9,
1,
),
name: "bar",
end: (
9,
6,
),
},
),
op: Assign,
rhs: Call {
target: Identifier(
Identifier {
start: (
9,
8,
),
name: "a",
end: (
9,
9,
),
},
),
args: [
Arg {
name: None,
value: VariadicPlaceholder,
unpack: false,
},
],
},
},
},
Label {
label: Identifier {
start: (
11,
1,
),
name: "foo",
end: (
11,
4,
),
},
},
Expression {
expr: Call {
target: Variable(
Variable {
start: (
12,
5,
),
name: "bar",
end: (
12,
9,
),
},
),
args: [],
},
},
Goto {
label: Identifier {
start: (
13,
10,
),
name: "foo",
end: (
13,
13,
),
},
},
]