parser/tests/fixtures/0011/ast.txt
Saif Eddin Gmati 6a6d4d0e5f
chore: refactor ident and dynamic var parsers (#192)
Signed-off-by: azjezz <azjezz@protonmail.com>
2022-12-10 15:24:55 +01:00

928 lines
32 KiB
Plaintext

[
Expression {
expr: Call {
target: Identifier(
SimpleIdentifier(
SimpleIdentifier {
span: (
3,
1,
),
name: "define",
},
),
),
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: ComparisonOperation(
Equal {
left: Variable(
SimpleVariable(
SimpleVariable {
span: (
3,
13,
),
name: "a",
},
),
),
span: (
3,
16,
),
right: Variable(
SimpleVariable(
SimpleVariable {
span: (
3,
19,
),
name: "b",
},
),
),
},
),
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier(
SimpleIdentifier(
SimpleIdentifier {
span: (
4,
1,
),
name: "define",
},
),
),
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: ComparisonOperation(
Identical {
left: Variable(
SimpleVariable(
SimpleVariable {
span: (
4,
13,
),
name: "a",
},
),
),
span: (
4,
16,
),
right: Variable(
SimpleVariable(
SimpleVariable {
span: (
4,
20,
),
name: "b",
},
),
),
},
),
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier(
SimpleIdentifier(
SimpleIdentifier {
span: (
5,
1,
),
name: "define",
},
),
),
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: ComparisonOperation(
NotEqual {
left: Variable(
SimpleVariable(
SimpleVariable {
span: (
5,
13,
),
name: "a",
},
),
),
span: (
5,
16,
),
right: Variable(
SimpleVariable(
SimpleVariable {
span: (
5,
19,
),
name: "b",
},
),
),
},
),
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier(
SimpleIdentifier(
SimpleIdentifier {
span: (
6,
1,
),
name: "define",
},
),
),
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: ComparisonOperation(
NotIdentical {
left: Variable(
SimpleVariable(
SimpleVariable {
span: (
6,
13,
),
name: "a",
},
),
),
span: (
6,
16,
),
right: Variable(
SimpleVariable(
SimpleVariable {
span: (
6,
20,
),
name: "b",
},
),
),
},
),
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier(
SimpleIdentifier(
SimpleIdentifier {
span: (
7,
1,
),
name: "define",
},
),
),
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: ArithmeticOperation(
Addition {
left: Variable(
SimpleVariable(
SimpleVariable {
span: (
7,
13,
),
name: "a",
},
),
),
span: (
7,
16,
),
right: Variable(
SimpleVariable(
SimpleVariable {
span: (
7,
18,
),
name: "b",
},
),
),
},
),
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier(
SimpleIdentifier(
SimpleIdentifier {
span: (
8,
1,
),
name: "define",
},
),
),
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: ArithmeticOperation(
Subtraction {
left: Variable(
SimpleVariable(
SimpleVariable {
span: (
8,
13,
),
name: "a",
},
),
),
span: (
8,
16,
),
right: Variable(
SimpleVariable(
SimpleVariable {
span: (
8,
18,
),
name: "b",
},
),
),
},
),
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier(
SimpleIdentifier(
SimpleIdentifier {
span: (
9,
1,
),
name: "define",
},
),
),
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: ArithmeticOperation(
Division {
left: Variable(
SimpleVariable(
SimpleVariable {
span: (
9,
13,
),
name: "a",
},
),
),
span: (
9,
16,
),
right: Variable(
SimpleVariable(
SimpleVariable {
span: (
9,
18,
),
name: "b",
},
),
),
},
),
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier(
SimpleIdentifier(
SimpleIdentifier {
span: (
10,
1,
),
name: "define",
},
),
),
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: BitwiseOperation(
Xor {
left: Variable(
SimpleVariable(
SimpleVariable {
span: (
10,
13,
),
name: "a",
},
),
),
span: (
10,
16,
),
right: Variable(
SimpleVariable(
SimpleVariable {
span: (
10,
18,
),
name: "b",
},
),
),
},
),
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier(
SimpleIdentifier(
SimpleIdentifier {
span: (
11,
1,
),
name: "define",
},
),
),
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: ArithmeticOperation(
Multiplication {
left: Variable(
SimpleVariable(
SimpleVariable {
span: (
11,
13,
),
name: "a",
},
),
),
span: (
11,
16,
),
right: Variable(
SimpleVariable(
SimpleVariable {
span: (
11,
18,
),
name: "b",
},
),
),
},
),
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier(
SimpleIdentifier(
SimpleIdentifier {
span: (
12,
1,
),
name: "define",
},
),
),
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: BitwiseOperation(
RightShift {
left: Variable(
SimpleVariable(
SimpleVariable {
span: (
12,
13,
),
name: "a",
},
),
),
span: (
12,
16,
),
right: Variable(
SimpleVariable(
SimpleVariable {
span: (
12,
19,
),
name: "b",
},
),
),
},
),
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier(
SimpleIdentifier(
SimpleIdentifier {
span: (
13,
1,
),
name: "define",
},
),
),
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: BitwiseOperation(
LeftShift {
left: Variable(
SimpleVariable(
SimpleVariable {
span: (
13,
13,
),
name: "a",
},
),
),
span: (
13,
16,
),
right: Variable(
SimpleVariable(
SimpleVariable {
span: (
13,
19,
),
name: "b",
},
),
),
},
),
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier(
SimpleIdentifier(
SimpleIdentifier {
span: (
14,
1,
),
name: "define",
},
),
),
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: BitwiseOperation(
Or {
left: Variable(
SimpleVariable(
SimpleVariable {
span: (
14,
13,
),
name: "a",
},
),
),
span: (
14,
16,
),
right: Variable(
SimpleVariable(
SimpleVariable {
span: (
14,
18,
),
name: "b",
},
),
),
},
),
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier(
SimpleIdentifier(
SimpleIdentifier {
span: (
15,
1,
),
name: "define",
},
),
),
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: BitwiseOperation(
And {
left: Variable(
SimpleVariable(
SimpleVariable {
span: (
15,
13,
),
name: "a",
},
),
),
span: (
15,
16,
),
right: Variable(
SimpleVariable(
SimpleVariable {
span: (
15,
18,
),
name: "b",
},
),
),
},
),
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier(
SimpleIdentifier(
SimpleIdentifier {
span: (
16,
1,
),
name: "define",
},
),
),
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: BitwiseOperation(
Not {
span: (
16,
13,
),
right: Variable(
SimpleVariable(
SimpleVariable {
span: (
16,
14,
),
name: "b",
},
),
),
},
),
unpack: false,
},
],
},
},
Echo {
values: [
ArithmeticOperation(
Subtraction {
left: ArithmeticOperation(
Addition {
left: Variable(
SimpleVariable(
SimpleVariable {
span: (
18,
6,
),
name: "a",
},
),
),
span: (
18,
9,
),
right: ArithmeticOperation(
Division {
left: ArithmeticOperation(
Multiplication {
left: Variable(
SimpleVariable(
SimpleVariable {
span: (
18,
11,
),
name: "b",
},
),
),
span: (
18,
14,
),
right: Variable(
SimpleVariable(
SimpleVariable {
span: (
18,
16,
),
name: "c",
},
),
),
},
),
span: (
18,
19,
),
right: Variable(
SimpleVariable(
SimpleVariable {
span: (
18,
21,
),
name: "d",
},
),
),
},
),
},
),
span: (
18,
24,
),
right: Variable(
BracedVariableVariable(
BracedVariableVariable {
start: (
18,
26,
),
variable: Ternary {
condition: Concat {
left: LiteralString {
value: "foo",
},
span: (
18,
34,
),
right: Variable(
SimpleVariable(
SimpleVariable {
span: (
18,
36,
),
name: "c",
},
),
),
},
then: Some(
LiteralInteger {
i: "4",
},
),
else: LiteralInteger {
i: "3",
},
},
end: (
18,
46,
),
},
),
),
},
),
],
},
]