parser/tests/0023/ast.txt
Saif Eddin Gmati 558ce71563
feat: add test generator (#134)
Co-authored-by: Ryan Chandler <ryangjchandler@gmail.com>
closes https://github.com/ryangjchandler/php-parser-rs/issues/130
2022-11-29 23:19:51 +00:00

112 lines
2.3 KiB
Plaintext

[
Foreach {
expr: Variable {
name: "a",
},
by_ref: true,
key_var: None,
value_var: Variable {
name: "b",
},
body: [],
},
Foreach {
expr: Variable {
name: "a",
},
by_ref: true,
key_var: Some(
Variable {
name: "b",
},
),
value_var: Variable {
name: "c",
},
body: [],
},
Switch {
condition: Variable {
name: "a",
},
cases: [
Case {
condition: Some(
LiteralInteger {
i: 0,
},
),
body: [
Break {
num: None,
},
],
},
Case {
condition: Some(
LiteralInteger {
i: 1,
},
),
body: [],
},
Case {
condition: None,
body: [],
},
],
},
Foreach {
expr: Variable {
name: "foo",
},
by_ref: false,
key_var: None,
value_var: Array {
items: [
ArrayItem {
key: None,
value: Variable {
name: "baz",
},
unpack: false,
},
ArrayItem {
key: None,
value: Variable {
name: "car",
},
unpack: false,
},
],
},
body: [],
},
Foreach {
expr: Variable {
name: "foo",
},
by_ref: false,
key_var: Some(
Variable {
name: "bar",
},
),
value_var: Variable {
name: "baz",
},
body: [],
},
Foreach {
expr: Variable {
name: "foo",
},
by_ref: false,
key_var: None,
value_var: Variable {
name: "bar",
},
body: [],
},
]