Struct wagon_parser::parser::assignment::Assignment
source · pub struct Assignment {
pub ident: SpannableNode<Ident>,
pub expr: SpannableNode<Expression>,
}
Expand description
Assigns the result of an expression to an attribute.
§Grammar
Assignment -> “{” (Ident “=” Expression “;”)* “}”;
Fields§
§ident: SpannableNode<Ident>
The left-hand side.
expr: SpannableNode<Expression>
The right-hand side.
Implementations§
source§impl Assignment
impl Assignment
sourcepub fn new_unspanned(ident: Ident, expr: Expression) -> Self
pub fn new_unspanned(ident: Ident, expr: Expression) -> Self
Constructs a Self
with dummy span information.
Trait Implementations§
source§impl Clone for Assignment
impl Clone for Assignment
source§fn clone(&self) -> Assignment
fn clone(&self) -> Assignment
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 Assignment
impl Debug for Assignment
source§impl Display for Assignment
impl Display for Assignment
source§impl Hash for Assignment
impl Hash for Assignment
source§impl Parse for Assignment
impl Parse for Assignment
source§fn parse(lexer: &mut LexerBridge<'_>) -> ParseResult<Self>
fn parse(lexer: &mut LexerBridge<'_>) -> ParseResult<Self>
Given a lexer, try to parse a valid instance of this node. Read more
source§fn parse_sep(
lexer: &mut LexerBridge<'_>,
join: Tokens
) -> ParseResult<Vec<Self>>where
Self: Sized,
fn parse_sep(
lexer: &mut LexerBridge<'_>,
join: Tokens
) -> ParseResult<Vec<Self>>where
Self: Sized,
source§fn parse_sep_end(
lexer: &mut LexerBridge<'_>,
join: Tokens,
end: Tokens
) -> ParseResult<Vec<Self>>where
Self: Sized,
fn parse_sep_end(
lexer: &mut LexerBridge<'_>,
join: Tokens,
end: Tokens
) -> ParseResult<Vec<Self>>where
Self: Sized,
source§impl PartialEq for Assignment
impl PartialEq for Assignment
source§fn eq(&self, other: &Assignment) -> bool
fn eq(&self, other: &Assignment) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for Assignment
impl StructuralPartialEq for Assignment
Auto Trait Implementations§
impl Freeze for Assignment
impl RefUnwindSafe for Assignment
impl Send for Assignment
impl Sync for Assignment
impl Unpin for Assignment
impl UnwindSafe for Assignment
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> WrapSpannable<T, SpannableNode<T>> for Twhere
T: Parse,
impl<T> WrapSpannable<T, SpannableNode<T>> for Twhere
T: Parse,
source§fn wrap_spannable(self) -> SpannableNode<T>
fn wrap_spannable(self) -> SpannableNode<T>
Wrap dummy span information around the node.
source§fn into_spanned(self, span: Range<usize>) -> SpannableNode<T>
fn into_spanned(self, span: Range<usize>) -> SpannableNode<T>
Convert the node into a
SpannableNode
with the specified Span
.