parser/tests/0008/ast.txt

132 lines
3.1 KiB
Plaintext
Raw Normal View History

[
Expression {
expr: Infix {
lhs: Variable {
name: "a",
},
op: Assign,
rhs: Infix {
lhs: LiteralInteger {
i: 2,
},
op: Pow,
rhs: LiteralInteger {
i: 2,
},
},
},
},
Expression {
expr: Infix {
lhs: Variable {
name: "b",
},
op: Assign,
rhs: Ternary {
condition: LiteralInteger {
i: 1,
},
then: Some(
LiteralInteger {
i: 2,
},
),
else: LiteralInteger {
i: 3,
},
},
},
},
Expression {
expr: Infix {
lhs: Variable {
name: "c",
},
op: Assign,
rhs: Ternary {
condition: LiteralInteger {
i: 1,
},
then: Some(
Ternary {
condition: LiteralInteger {
i: 2,
},
then: Some(
LiteralInteger {
i: 3,
},
),
else: LiteralInteger {
i: 4,
},
},
),
else: LiteralInteger {
i: 5,
},
},
},
},
Expression {
expr: Infix {
lhs: Variable {
name: "d",
},
op: Assign,
rhs: Ternary {
condition: LiteralInteger {
i: 1,
},
then: None,
else: Ternary {
condition: LiteralInteger {
i: 2,
},
then: None,
else: LiteralInteger {
i: 3,
},
},
},
},
},
Expression {
expr: Infix {
lhs: Variable {
name: "e",
},
op: Assign,
rhs: Coalesce {
lhs: LiteralInteger {
i: 1,
},
rhs: LiteralInteger {
i: 2,
},
},
},
},
Expression {
expr: Infix {
lhs: Variable {
name: "f",
},
op: Assign,
rhs: Coalesce {
lhs: LiteralInteger {
i: 1,
},
rhs: Coalesce {
lhs: LiteralInteger {
i: 2,
},
rhs: LiteralInteger {
i: 3,
},
},
},
},
},
]