Struct wagon_parser::parser::rhs::Rhs
source · pub struct Rhs {
pub weight: Option<SpannableNode<Expression>>,
pub chunks: Vec<SpannableNode<Chunk>>,
}
Expand description
Fields§
§weight: Option<SpannableNode<Expression>>
The weight expression of this alternative.
chunks: Vec<SpannableNode<Chunk>>
The chunks of this alternative.
Implementations§
source§impl Rhs
impl Rhs
sourcepub fn new_unspanned(weight: Option<Expression>, chunks: Vec<Chunk>) -> Self
pub fn new_unspanned(weight: Option<Expression>, chunks: Vec<Chunk>) -> Self
Constructs a Self
with dummy span information.
Trait Implementations§
source§impl Parse for Rhs
impl Parse for Rhs
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,
impl Eq for Rhs
impl StructuralPartialEq for Rhs
Auto Trait Implementations§
impl Freeze for Rhs
impl RefUnwindSafe for Rhs
impl Send for Rhs
impl Sync for Rhs
impl Unpin for Rhs
impl UnwindSafe for Rhs
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
.