pub enum Expression<'src> {
And {
lhs: Box<Expression<'src>>,
rhs: Box<Expression<'src>>,
},
Assert {
condition: Condition<'src>,
error: Box<Expression<'src>>,
},
Backtick {
contents: String,
token: Token<'src>,
},
Call {
thunk: Thunk<'src>,
},
Concatenation {
lhs: Box<Expression<'src>>,
rhs: Box<Expression<'src>>,
},
Conditional {
condition: Condition<'src>,
then: Box<Expression<'src>>,
otherwise: Box<Expression<'src>>,
},
Group {
contents: Box<Expression<'src>>,
},
Join {
lhs: Option<Box<Expression<'src>>>,
rhs: Box<Expression<'src>>,
},
Or {
lhs: Box<Expression<'src>>,
rhs: Box<Expression<'src>>,
},
StringLiteral {
string_literal: StringLiteral<'src>,
},
Variable {
name: Name<'src>,
},
}
Expand description
An expression. Note that the Just language grammar has both an expression
production of additions (a + b
) and values, and a value
production of
all other value types (for example strings, function calls, and
parenthetical groups).
The parser parses both values and expressions into Expression
s.
Variantsยง
And
lhs && rhs
Assert
assert(condition, error)
Backtick
contents
Call
name(arguments)
Concatenation
lhs + rhs
Conditional
if condition { then } else { otherwise }
Group
(contents)
Fields
ยง
contents: Box<Expression<'src>>
Join
lhs / rhs
Or
lhs || rhs
StringLiteral
"string_literal"
or 'string_literal'
Fields
ยง
string_literal: StringLiteral<'src>
Variable
variable
Implementationsยง
Trait Implementationsยง
Sourceยงimpl<'src> Clone for Expression<'src>
impl<'src> Clone for Expression<'src>
Sourceยงfn clone(&self) -> Expression<'src>
fn clone(&self) -> Expression<'src>
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<'src> Debug for Expression<'src>
impl<'src> Debug for Expression<'src>
Sourceยงimpl<'src> Display for Expression<'src>
impl<'src> Display for Expression<'src>
Sourceยงimpl<'src> PartialEq for Expression<'src>
impl<'src> PartialEq for Expression<'src>
Sourceยงimpl<'src> Serialize for Expression<'src>
impl<'src> Serialize for Expression<'src>
impl<'src> StructuralPartialEq for Expression<'src>
Auto Trait Implementationsยง
impl<'src> Freeze for Expression<'src>
impl<'src> RefUnwindSafe for Expression<'src>
impl<'src> Send for Expression<'src>
impl<'src> Sync for Expression<'src>
impl<'src> Unpin for Expression<'src>
impl<'src> UnwindSafe for Expression<'src>
Blanket Implementationsยง
Sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more