parser/tests/0001/ast.txt
2022-11-30 00:43:37 +00:00

161 lines
3.9 KiB
Plaintext

[
Function {
name: Identifier {
name: "foo",
},
params: [
Param {
name: Variable {
name: "a",
},
type: Some(
String,
),
variadic: false,
default: Some(
LiteralString {
value: "",
},
),
flags: [],
by_ref: false,
},
Param {
name: Variable {
name: "b",
},
type: Some(
Array,
),
variadic: false,
default: Some(
Array {
items: [],
},
),
flags: [],
by_ref: false,
},
],
body: [
Expression {
expr: Call {
target: Identifier {
name: "exit",
},
args: [
Arg {
name: None,
value: LiteralInteger {
i: 1,
},
unpack: false,
},
],
},
},
],
return_type: Some(
Never,
),
by_ref: false,
},
Function {
name: Identifier {
name: "bar",
},
params: [
Param {
name: Variable {
name: "a",
},
type: Some(
Integer,
),
variadic: false,
default: None,
flags: [],
by_ref: false,
},
Param {
name: Variable {
name: "b",
},
type: Some(
Float,
),
variadic: false,
default: None,
flags: [],
by_ref: false,
},
Param {
name: Variable {
name: "c",
},
type: Some(
String,
),
variadic: false,
default: None,
flags: [],
by_ref: false,
},
Param {
name: Variable {
name: "d",
},
type: Some(
True,
),
variadic: false,
default: None,
flags: [],
by_ref: false,
},
Param {
name: Variable {
name: "e",
},
type: Some(
False,
),
variadic: false,
default: None,
flags: [],
by_ref: false,
},
Param {
name: Variable {
name: "f",
},
type: Some(
Null,
),
variadic: false,
default: None,
flags: [],
by_ref: false,
},
],
body: [
Return {
value: Some(
Null,
),
},
],
return_type: Some(
Union(
[
Null,
String,
Integer,
Float,
],
),
),
by_ref: false,
},
]