pub struct Expression {
pub span: NodeSpan,
pub kind: ExpressionKind,
}Expand description
A canonical expression, and where it was written.
Same shape as [parser::Expression] — a [NodeSpan] beside a kind — and for the
same reason: the children stay Box<Expression>, so a reader matches &e.kind.
Fields§
§span: NodeSpan§kind: ExpressionKindImplementations§
Source§impl Expression
impl Expression
Sourcepub fn new(span: NodeSpan, kind: ExpressionKind) -> Expression
pub fn new(span: NodeSpan, kind: ExpressionKind) -> Expression
An expression canonicalized from source, keeping the parser node’s position.
Sourcepub fn bare(kind: ExpressionKind) -> Expression
pub fn bare(kind: ExpressionKind) -> Expression
An expression with no position: hand-built by a test, or synthesised by the
compiler with nothing in the user’s text behind it. See [NodeSpan].
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PartialEq for Expression
impl PartialEq for Expression
impl StructuralPartialEq for Expression
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnsafeUnpin for Expression
impl UnwindSafe for Expression
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