pub struct Stmt {
pub expr: Expr,
pub semicolon: Option<Range<usize>>,
pub span: Range<usize>,
}Expand description
Represents a statement in CalcScript.
Fields§
§expr: ExprThe expression of a statement.
semicolon: Option<Range<usize>>The span of the semicolon that terminates the statement, if any.
When this is None, the statement is an expression, and will return the value of the
expression. Otherwise, the expression is evaluated for side effects, and the statement
returns the unit type ().
span: Range<usize>The region of the source code that this statement was parsed from.
Implementations§
Trait Implementations§
Source§impl Latex for Stmt
impl Latex for Stmt
Source§fn as_display(&self) -> LatexFormatter<'_, Self>
fn as_display(&self) -> LatexFormatter<'_, Self>
Wraps the value in a
LatexFormatter, which implements Display.Source§impl<'source> Parse<'source> for Stmt
impl<'source> Parse<'source> for Stmt
impl StructuralPartialEq for Stmt
Auto Trait Implementations§
impl Freeze for Stmt
impl RefUnwindSafe for Stmt
impl Send for Stmt
impl Sync for Stmt
impl Unpin for Stmt
impl UnwindSafe for Stmt
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