Enum php_parser_rs::parser::ast::Expression
source · pub enum Expression {
Show 62 variants
Eval {
value: Box<Self>,
},
Die {
value: Option<Box<Self>>,
},
Exit {
value: Option<Box<Self>>,
},
Echo {
values: Vec<Self>,
},
Literal(Literal),
ArithmeticOperation(ArithmeticOperation),
AssignmentOperation(AssignmentOperation),
BitwiseOperation(BitwiseOperation),
ComparisonOperation(ComparisonOperation),
LogicalOperation(LogicalOperation),
Concat {
left: Box<Self>,
span: Span,
right: Box<Self>,
},
Instanceof {
left: Box<Self>,
span: Span,
right: Box<Self>,
},
Reference {
span: Span,
right: Box<Self>,
},
Parenthesized {
start: Span,
expr: Box<Self>,
end: Span,
},
List {
items: Vec<ListItem>,
},
Empty,
ErrorSuppress {
span: Span,
expr: Box<Self>,
},
Identifier(Identifier),
Variable(Variable),
Include {
span: Span,
path: Box<Self>,
},
IncludeOnce {
span: Span,
path: Box<Self>,
},
Require {
span: Span,
path: Box<Self>,
},
RequireOnce {
span: Span,
path: Box<Self>,
},
FunctionCall {
target: Box<Self>,
arguments: ArgumentList,
},
FunctionClosureCreation {
target: Box<Self>,
placeholder: ArgumentPlaceholder,
},
MethodCall {
target: Box<Self>,
arrow: Span,
method: Box<Self>,
arguments: ArgumentList,
},
MethodClosureCreation {
target: Box<Self>,
arrow: Span,
method: Box<Self>,
placeholder: ArgumentPlaceholder,
},
NullsafeMethodCall {
target: Box<Self>,
question_arrow: Span,
method: Box<Self>,
arguments: ArgumentList,
},
StaticMethodCall {
target: Box<Self>,
double_colon: Span,
method: Box<Self>,
arguments: ArgumentList,
},
StaticMethodClosureCreation {
target: Box<Self>,
double_colon: Span,
method: Box<Self>,
placeholder: ArgumentPlaceholder,
},
Static,
Self_,
Parent,
ShortArray(Bracketed<CommaSeparated<ArrayItem>>),
Array {
span: Span,
start: Span,
items: Vec<ArrayItem>,
end: Span,
},
Closure(Closure),
ArrowFunction(ArrowFunction),
New {
new: Span,
target: Box<Self>,
arguments: Option<ArgumentList>,
},
InterpolatedString {
parts: Vec<StringPart>,
},
Heredoc {
parts: Vec<StringPart>,
},
Nowdoc {
value: ByteString,
},
ShellExec {
parts: Vec<StringPart>,
},
PropertyFetch {
target: Box<Self>,
arrow: Span,
property: Box<Self>,
},
NullsafePropertyFetch {
target: Box<Self>,
question_arrow: Span,
property: Box<Self>,
},
StaticPropertyFetch {
target: Box<Self>,
double_colon: Span,
property: Box<Self>,
},
ConstFetch {
target: Box<Self>,
constant: SimpleIdentifier,
},
AnonymousClass(AnonymousClass),
Bool {
value: bool,
},
ArrayIndex {
array: Box<Self>,
left_bracket: Span,
index: Option<Box<Self>>,
right_bracket: Span,
},
Null,
MagicConstant(MagicConstant),
ShortTernary {
condition: Box<Self>,
question_colon: Span,
else: Box<Self>,
},
Ternary {
condition: Box<Self>,
question: Span,
then: Box<Self>,
colon: Span,
else: Box<Self>,
},
Coalesce {
lhs: Box<Self>,
double_question: Span,
rhs: Box<Self>,
},
Clone {
target: Box<Self>,
},
Match {
keyword: Span,
condition: Parenthesized<Box<Self>>,
default: Option<Box<DefaultMatchArm>>,
arms: Vec<MatchArm>,
},
Throw {
value: Box<Self>,
},
Yield {
key: Option<Box<Self>>,
value: Option<Box<Self>>,
},
YieldFrom {
value: Box<Self>,
},
Print {
span: Span,
value: Box<Self>,
},
Cast {
span: Span,
kind: CastKind,
value: Box<Self>,
},
Noop,
}
Variants§
Eval
Die
Exit
Echo
Literal(Literal)
ArithmeticOperation(ArithmeticOperation)
AssignmentOperation(AssignmentOperation)
BitwiseOperation(BitwiseOperation)
ComparisonOperation(ComparisonOperation)
LogicalOperation(LogicalOperation)
Concat
Instanceof
Reference
Parenthesized
List
Empty
ErrorSuppress
Identifier(Identifier)
Variable(Variable)
Include
IncludeOnce
Require
RequireOnce
FunctionCall
FunctionClosureCreation
MethodCall
MethodClosureCreation
NullsafeMethodCall
StaticMethodCall
StaticMethodClosureCreation
Static
Self_
Parent
ShortArray(Bracketed<CommaSeparated<ArrayItem>>)
Array
Closure(Closure)
ArrowFunction(ArrowFunction)
New
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
MagicConstant(MagicConstant)
ShortTernary
Ternary
Coalesce
Clone
Match
Throw
Yield
YieldFrom
Cast
Noop
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
source§impl JsonSchema for Expression
impl JsonSchema for Expression
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl PartialEq<Expression> for Expression
impl PartialEq<Expression> for Expression
source§fn eq(&self, other: &Expression) -> bool
fn eq(&self, other: &Expression) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.