mclangc/tests/parser/functions.exp

195 lines
6.5 KiB
Plaintext
Raw Normal View History

2024-12-21 03:10:03 +00:00
Program {
ast: Block(
[
Statement(
Fn {
struct_name: None,
name: Ident(
"main",
),
params: [
(
Ident(
"argc",
),
Owned(
Ident(
"i32",
),
),
),
(
Ident(
"argv",
),
Ref {
inner: Array {
inner: Owned(
Ident(
"Str",
),
),
},
mutable: false,
},
),
],
ret_type: Some(
Owned(
Ident(
"i32",
),
),
),
qual_const: false,
qual_extern: None,
body: Some(
Block(
[
Expr(
Return(
Some(
Literal(
Number(
Number {
val: 0,
base: 10,
signed: false,
},
),
),
),
),
),
],
),
),
},
),
Statement(
Fn {
struct_name: Some(
Ident(
"Baz",
),
),
name: Ident(
"main",
),
params: [
(
Ident(
"self",
),
Ref {
inner: Owned(
Ident(
"Baz",
),
),
mutable: true,
},
),
(
Ident(
"a",
),
Ref {
inner: Owned(
Ident(
"Foo",
),
),
mutable: false,
},
),
(
Ident(
"b",
),
Ref {
inner: Owned(
Ident(
"Bar",
),
),
mutable: true,
},
),
],
ret_type: Some(
Ref {
inner: Owned(
Ident(
"Nya",
),
),
mutable: false,
},
),
qual_const: false,
qual_extern: None,
body: None,
},
),
Statement(
Fn {
struct_name: Some(
Ident(
"Baz",
),
),
name: Ident(
"main",
),
params: [
(
Ident(
"a",
),
Ref {
inner: Owned(
Ident(
"Foo",
),
),
mutable: false,
},
),
(
Ident(
"b",
),
Ref {
inner: Owned(
Ident(
"Bar",
),
),
mutable: true,
},
),
],
ret_type: Some(
Ref {
inner: Owned(
Ident(
"Nya",
),
),
mutable: false,
},
),
qual_const: false,
qual_extern: None,
body: None,
},
),
],
2024-12-21 03:10:03 +00:00
),
structs: {},
enums: {},
types: {},
functions: {},
member_functions: {},
}