Enum php_parser_rs::parser::ast::Expression
source · pub enum Expression {
Show 59 variants
Eval {
value: Box<Expression>,
},
Die {
value: Option<Box<Expression>>,
},
Exit {
value: Option<Box<Expression>>,
},
ArithmeticOperation(ArithmeticOperation),
AssignmentOperation(AssignmentOperation),
BitwiseOperation(BitwiseOperation),
ComparisonOperation(ComparisonOperation),
LogicalOperation(LogicalOperation),
Concat {
left: Box<Expression>,
span: Span,
right: Box<Expression>,
},
Instanceof {
left: Box<Expression>,
span: Span,
right: Box<Expression>,
},
Reference {
span: Span,
right: Box<Expression>,
},
Parenthesized {
start: Span,
expr: Box<Expression>,
end: Span,
},
List {
items: Vec<ListItem>,
},
Empty,
ErrorSuppress {
span: Span,
expr: Box<Self>,
},
LiteralInteger {
span: Span,
value: ByteString,
},
LiteralFloat {
span: Span,
value: ByteString,
},
Identifier(Identifier),
Variable(Variable),
Include {
span: Span,
kind: IncludeKind,
path: Box<Expression>,
},
FunctionCall {
target: Box<Self>,
arguments: ArgumentList,
},
FunctionClosureCreation {
target: Box<Self>,
placeholder: ArgumentPlaceholder,
},
MethodCall {
target: Box<Self>,
span: Span,
method: Box<Self>,
arguments: ArgumentList,
},
MethodClosureCreation {
target: Box<Self>,
span: Span,
method: Box<Self>,
placeholder: ArgumentPlaceholder,
},
NullsafeMethodCall {
target: Box<Self>,
span: Span,
method: Box<Self>,
arguments: ArgumentList,
},
StaticMethodCall {
target: Box<Self>,
span: Span,
method: Box<Self>,
arguments: ArgumentList,
},
StaticMethodClosureCreation {
target: Box<Self>,
span: Span,
method: Box<Self>,
placeholder: ArgumentPlaceholder,
},
Static,
Self_,
Parent,
Array {
items: Vec<ArrayItem>,
},
Closure(Closure),
ArrowFunction(ArrowFunction),
New {
span: Span,
target: Box<Self>,
arguments: Option<ArgumentList>,
},
LiteralString {
span: Span,
value: ByteString,
},
InterpolatedString {
parts: Vec<StringPart>,
},
Heredoc {
parts: Vec<StringPart>,
},
Nowdoc {
value: ByteString,
},
ShellExec {
parts: Vec<StringPart>,
},
PropertyFetch {
target: Box<Self>,
property: Box<Self>,
},
NullsafePropertyFetch {
target: Box<Self>,
property: Box<Self>,
},
StaticPropertyFetch {
target: Box<Self>,
property: Box<Self>,
},
ConstFetch {
target: Box<Self>,
constant: SimpleIdentifier,
},
AnonymousClass(AnonymousClass),
Bool {
value: bool,
},
ArrayIndex {
array: Box<Self>,
index: Option<Box<Self>>,
},
Null,
MagicConst {
span: Span,
constant: MagicConst,
},
Ternary {
condition: Box<Self>,
then: Box<Self>,
else: Box<Self>,
},
ShortTernary {
condition: Box<Self>,
span: Span,
else: Box<Self>,
},
Coalesce {
lhs: Box<Self>,
rhs: Box<Self>,
},
Clone {
target: Box<Self>,
},
Match {
condition: Box<Self>,
default: Option<Box<DefaultMatchArm>>,
arms: Vec<MatchArm>,
},
Throw {
value: Box<Expression>,
},
Yield {
key: Option<Box<Self>>,
value: Option<Box<Self>>,
},
YieldFrom {
value: Box<Self>,
},
BitwiseNot {
span: Span,
value: Box<Self>,
},
Print {
span: Span,
value: Box<Self>,
},
Cast {
span: Span,
kind: CastKind,
value: Box<Self>,
},
}
Variants§
Eval
Fields
§
value: Box<Expression>
Die
Fields
§
value: Option<Box<Expression>>
Exit
Fields
§
value: Option<Box<Expression>>
ArithmeticOperation(ArithmeticOperation)
AssignmentOperation(AssignmentOperation)
BitwiseOperation(BitwiseOperation)
ComparisonOperation(ComparisonOperation)
LogicalOperation(LogicalOperation)
Concat
Instanceof
Reference
Parenthesized
List
Empty
ErrorSuppress
LiteralInteger
LiteralFloat
Identifier(Identifier)
Variable(Variable)
Include
FunctionCall
FunctionClosureCreation
MethodCall
MethodClosureCreation
NullsafeMethodCall
StaticMethodCall
StaticMethodClosureCreation
Static
Self_
Parent
Array
Closure(Closure)
ArrowFunction(ArrowFunction)
New
LiteralString
InterpolatedString
Fields
§
parts: Vec<StringPart>
Heredoc
Fields
§
parts: Vec<StringPart>
Nowdoc
Fields
§
value: ByteString
ShellExec
Fields
§
parts: Vec<StringPart>
PropertyFetch
NullsafePropertyFetch
StaticPropertyFetch
ConstFetch
AnonymousClass(AnonymousClass)
Bool
ArrayIndex
Null
MagicConst
Ternary
ShortTernary
Coalesce
Clone
Match
Throw
Fields
§
value: Box<Expression>
Yield
YieldFrom
BitwiseNot
Cast
Trait Implementations§
source§impl Clone for Expression
impl Clone for Expression
source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Expression
impl Debug for Expression
source§impl<'de> Deserialize<'de> for Expression
impl<'de> Deserialize<'de> for Expression
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more