mclangc/tests/parser/loops.exp

114 lines
3.6 KiB
Plaintext

Program {
ast: Block(
[
Expr(
ForLoop {
init: Statement(
Let {
name: Ident(
"i",
),
typ: None,
val: Some(
Literal(
Number(
Number {
val: 0,
base: 10,
signed: false,
},
),
),
),
},
),
test: BinOp {
typ: Lt,
left: Path(
Path(
[
Ident(
"i",
),
],
),
),
right: Literal(
Number(
Number {
val: 10,
base: 10,
signed: false,
},
),
),
},
on_loop: BinOp {
typ: AddEq,
left: Path(
Path(
[
Ident(
"i",
),
],
),
),
right: Literal(
Number(
Number {
val: 1,
base: 10,
signed: false,
},
),
),
},
body: Block(
[],
),
},
),
Expr(
WhileLoop {
test: BinOp {
typ: Gt,
left: Path(
Path(
[
Ident(
"i",
),
],
),
),
right: Literal(
Number(
Number {
val: 3,
base: 10,
signed: false,
},
),
),
},
body: Block(
[],
),
},
),
Expr(
InfLoop {
body: Block(
[],
),
},
),
],
),
structs: {},
enums: {},
types: {},
functions: {},
member_functions: {},
}