parser/tests/0012/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

429 lines
12 KiB
Plaintext

[
Expression {
expr: Call {
target: Identifier {
name: "define",
},
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: Infix {
lhs: Variable {
name: "a",
},
op: Equals,
rhs: Variable {
name: "b",
},
},
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier {
name: "define",
},
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: Infix {
lhs: Variable {
name: "a",
},
op: Identical,
rhs: Variable {
name: "b",
},
},
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier {
name: "define",
},
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: Infix {
lhs: Variable {
name: "a",
},
op: NotEquals,
rhs: Variable {
name: "b",
},
},
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier {
name: "define",
},
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: Infix {
lhs: Variable {
name: "a",
},
op: NotIdentical,
rhs: Variable {
name: "b",
},
},
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier {
name: "define",
},
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: Infix {
lhs: Variable {
name: "a",
},
op: Add,
rhs: Variable {
name: "b",
},
},
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier {
name: "define",
},
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: Infix {
lhs: Variable {
name: "a",
},
op: Sub,
rhs: Variable {
name: "b",
},
},
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier {
name: "define",
},
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: Infix {
lhs: Variable {
name: "a",
},
op: Div,
rhs: Variable {
name: "b",
},
},
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier {
name: "define",
},
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: Infix {
lhs: Variable {
name: "a",
},
op: BitwiseXor,
rhs: Variable {
name: "b",
},
},
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier {
name: "define",
},
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: Infix {
lhs: Variable {
name: "a",
},
op: Mul,
rhs: Variable {
name: "b",
},
},
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier {
name: "define",
},
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: Infix {
lhs: Variable {
name: "a",
},
op: RightShift,
rhs: Variable {
name: "b",
},
},
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier {
name: "define",
},
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: Infix {
lhs: Variable {
name: "a",
},
op: LeftShift,
rhs: Variable {
name: "b",
},
},
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier {
name: "define",
},
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: Infix {
lhs: Variable {
name: "a",
},
op: BitwiseOr,
rhs: Variable {
name: "b",
},
},
unpack: false,
},
],
},
},
Expression {
expr: Call {
target: Identifier {
name: "define",
},
args: [
Arg {
name: None,
value: LiteralString {
value: "a",
},
unpack: false,
},
Arg {
name: None,
value: Infix {
lhs: Variable {
name: "a",
},
op: BitwiseAnd,
rhs: Variable {
name: "b",
},
},
unpack: false,
},
],
},
},
Echo {
values: [
Infix {
lhs: Infix {
lhs: Variable {
name: "a",
},
op: Add,
rhs: Variable {
name: "b",
},
},
op: Mul,
rhs: Infix {
lhs: Infix {
lhs: Variable {
name: "c",
},
op: Div,
rhs: Variable {
name: "d",
},
},
op: Sub,
rhs: DynamicVariable {
name: Ternary {
condition: Infix {
lhs: LiteralString {
value: "foo",
},
op: Concat,
rhs: Variable {
name: "c",
},
},
then: Some(
LiteralInteger {
i: 4,
},
),
else: LiteralInteger {
i: 3,
},
},
},
},
},
],
},
]