mclangc/tests/parser/loops.exp

212 lines
8.6 KiB
Plaintext
Raw Permalink Normal View History

2024-12-21 03:10:03 +00:00
Program {
ast: Block(
[
Expr(
LocBox {
inner: ForLoop {
init: Statement(
LocBox {
inner: Let {
name: Ident(
"i",
),
typ: None,
val: Some(
LocBox {
inner: Literal(
Number(
Number {
val: 0,
base: 10,
signed: false,
},
),
),
loc: Loc {
file: "parser/loops.mcl",
line: 1,
col: 14,
},
},
),
},
loc: Loc {
file: "parser/loops.mcl",
line: 1,
col: 8,
},
},
),
test: LocBox {
inner: BinOp {
typ: Lt,
left: LocBox {
inner: Path(
Path(
[
Ident(
"i",
),
],
),
),
loc: Loc {
file: "parser/loops.mcl",
line: 1,
col: 17,
},
},
right: LocBox {
inner: Literal(
Number(
Number {
val: 10,
base: 10,
signed: false,
},
),
),
loc: Loc {
file: "parser/loops.mcl",
line: 1,
col: 22,
},
},
},
loc: Loc {
file: "parser/loops.mcl",
line: 1,
col: 19,
},
},
on_loop: LocBox {
inner: BinOp {
typ: AddEq,
left: LocBox {
inner: Path(
Path(
[
Ident(
"i",
),
],
),
),
loc: Loc {
file: "parser/loops.mcl",
line: 1,
col: 25,
},
},
right: LocBox {
inner: Literal(
Number(
Number {
val: 1,
base: 10,
signed: false,
},
),
),
loc: Loc {
file: "parser/loops.mcl",
line: 1,
col: 29,
},
},
},
loc: Loc {
file: "parser/loops.mcl",
line: 1,
col: 27,
},
},
body: Block(
[],
),
},
loc: Loc {
file: "parser/loops.mcl",
line: 1,
col: 4,
},
},
),
Expr(
LocBox {
inner: WhileLoop {
test: LocBox {
inner: BinOp {
typ: Gt,
left: LocBox {
inner: Path(
Path(
[
Ident(
"i",
),
],
),
),
loc: Loc {
file: "parser/loops.mcl",
line: 2,
col: 8,
},
},
right: LocBox {
inner: Literal(
Number(
Number {
val: 3,
base: 10,
signed: false,
},
),
),
loc: Loc {
file: "parser/loops.mcl",
line: 2,
col: 12,
},
},
},
loc: Loc {
file: "parser/loops.mcl",
line: 2,
col: 10,
},
},
body: Block(
[],
),
},
loc: Loc {
file: "parser/loops.mcl",
line: 2,
col: 6,
},
},
),
Expr(
LocBox {
inner: InfLoop {
body: Block(
[],
),
},
loc: Loc {
file: "parser/loops.mcl",
line: 3,
col: 5,
},
},
),
],
2024-12-21 03:10:03 +00:00
),
structs: {},
enums: {},
types: {},
functions: {},
member_functions: {},
}