parser/tests/0008/ast.txt
Saif Eddin Gmati 0e04f157f7
chore: consistent naming (#135)
Signed-off-by: azjezz <azjezz@protonmail.com>

Signed-off-by: azjezz <azjezz@protonmail.com>
2022-11-29 21:25:17 +00:00

132 lines
3.1 KiB
Plaintext

[
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,
},
},
},
},
},
]