Enum badger::grammar::Expression
[−]
[src]
pub enum Expression { This, Identifier(OwnedSlice), Literal(LiteralValue), Array(Vec<Expression>), Sequence(Vec<Expression>), Object(Vec<ObjectMember>), Member { object: Box<Expression>, property: OwnedSlice, }, ComputedMember { object: Box<Expression>, property: Box<Expression>, }, Call { callee: Box<Expression>, arguments: Vec<Expression>, }, Binary { left: Box<Expression>, operator: OperatorType, right: Box<Expression>, }, Prefix { operator: OperatorType, operand: Box<Expression>, }, Postfix { operator: OperatorType, operand: Box<Expression>, }, Conditional { test: Box<Expression>, consequent: Box<Expression>, alternate: Box<Expression>, }, ArrowFunction { params: Vec<Parameter>, body: Box<Statement>, }, Function { name: Option<OwnedSlice>, params: Vec<Parameter>, body: Vec<Statement>, }, }
Variants
This
Identifier(OwnedSlice)
Literal(LiteralValue)
Array(Vec<Expression>)
Sequence(Vec<Expression>)
Object(Vec<ObjectMember>)
Member
Fields of Member
object: Box<Expression> | |
property: OwnedSlice |
ComputedMember
Fields of ComputedMember
object: Box<Expression> | |
property: Box<Expression> |
Call
Fields of Call
callee: Box<Expression> | |
arguments: Vec<Expression> |
Binary
Fields of Binary
left: Box<Expression> | |
operator: OperatorType | |
right: Box<Expression> |
Prefix
Fields of Prefix
operator: OperatorType | |
operand: Box<Expression> |
Postfix
Fields of Postfix
operator: OperatorType | |
operand: Box<Expression> |
Conditional
Fields of Conditional
test: Box<Expression> | |
consequent: Box<Expression> | |
alternate: Box<Expression> |
ArrowFunction
Fields of ArrowFunction
params: Vec<Parameter> | |
body: Box<Statement> |
Function
Fields of Function
name: Option<OwnedSlice> | |
params: Vec<Parameter> | |
body: Vec<Statement> |
Methods
impl Expression
[src]
fn binding_power(&self) -> u8
fn binary<E: Into<Expression>>(
left: E,
operator: OperatorType,
right: E
) -> Self
left: E,
operator: OperatorType,
right: E
) -> Self
fn member<E: Into<Expression>, S: Into<OwnedSlice>>(
object: E,
property: S
) -> Self
object: E,
property: S
) -> Self
fn call<E: Into<Expression>>(callee: E, arguments: Vec<Expression>) -> Self
Trait Implementations
impl Debug for Expression
[src]
impl PartialEq for Expression
[src]
fn eq(&self, __arg_0: &Expression) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Expression) -> bool
This method tests for !=
.
impl Clone for Expression
[src]
fn clone(&self) -> Expression
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl From<&'static str> for Expression
[src]
impl From<OwnedSlice> for Expression
[src]
fn from(ident: OwnedSlice) -> Self
Performs the conversion.
impl<'a> From<&'a OwnedSlice> for Expression
[src]
fn from(ident: &'a OwnedSlice) -> Self
Performs the conversion.