Struct muse_lang::compiler::syntax::IfExpression
source · pub struct IfExpression {
pub if: Ranged<Token>,
pub condition: Ranged<Expression>,
pub then: Option<Ranged<Token>>,
pub when_true: Ranged<Expression>,
pub when_false: Option<Else>,
}Expand description
The syntax components of an if expression.
Fields§
§if: Ranged<Token>The if keyword.
condition: Ranged<Expression>The condition being checked.
then: Option<Ranged<Token>>If a then keyword is provided instead of when_true being a block,
this contains it.
when_true: Ranged<Expression>The expression to evaluate if condition is truthy.
when_false: Option<Else>The expression to evaluate if condition is falsey.
Trait Implementations§
source§impl Clone for IfExpression
impl Clone for IfExpression
source§fn clone(&self) -> IfExpression
fn clone(&self) -> IfExpression
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 IfExpression
impl Debug for IfExpression
source§impl PartialEq for IfExpression
impl PartialEq for IfExpression
source§impl TokenizeInto for IfExpression
impl TokenizeInto for IfExpression
impl StructuralPartialEq for IfExpression
Auto Trait Implementations§
impl Freeze for IfExpression
impl RefUnwindSafe for IfExpression
impl Send for IfExpression
impl Sync for IfExpression
impl Unpin for IfExpression
impl UnwindSafe for IfExpression
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
§impl<A> Cast for A
impl<A> Cast for A
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> TokenizeRanged for Twhere
T: TokenizeInto,
impl<T> TokenizeRanged for Twhere
T: TokenizeInto,
source§fn tokenize_ranged(
&self,
_range: SourceRange,
tokens: &mut VecDeque<Ranged<Token>>,
)
fn tokenize_ranged( &self, _range: SourceRange, tokens: &mut VecDeque<Ranged<Token>>, )
Tokenize
self into tokens within the enclosing range.