ast: Remove vestigial "ignore" in Expr
This commit is contained in:
parent
ac540ebd22
commit
35d214c9f6
@ -210,9 +210,7 @@ pub mod expression {
|
|||||||
/// # Syntax
|
/// # Syntax
|
||||||
/// [`Expr`]` := `[`math::Operation`]
|
/// [`Expr`]` := `[`math::Operation`]
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct Expr {
|
pub struct Expr (pub math::Operation);
|
||||||
pub ignore: math::Operation,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A [Primary] Expression is the expression with the highest precedence (i.e. the deepest
|
/// A [Primary] Expression is the expression with the highest precedence (i.e. the deepest
|
||||||
/// derivation)
|
/// derivation)
|
||||||
@ -693,7 +691,7 @@ pub mod visitor {
|
|||||||
}
|
}
|
||||||
impl<T: Visitor<Result<(), E>> + ?Sized, E> Walk<T, Result<(), E>> for Expr {
|
impl<T: Visitor<Result<(), E>> + ?Sized, E> Walk<T, Result<(), E>> for Expr {
|
||||||
fn walk(&self, visitor: &mut T) -> Result<(), E> {
|
fn walk(&self, visitor: &mut T) -> Result<(), E> {
|
||||||
visitor.visit_operation(&self.ignore)
|
visitor.visit_operation(&self.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl<T: Visitor<Result<(), E>> + ?Sized, E> Walk<T, Result<(), E>> for Group {
|
impl<T: Visitor<Result<(), E>> + ?Sized, E> Walk<T, Result<(), E>> for Group {
|
||||||
@ -804,7 +802,7 @@ pub mod visitor {
|
|||||||
|
|
||||||
/// Visit an [Expression](Expr)
|
/// Visit an [Expression](Expr)
|
||||||
fn visit_expr(&mut self, expr: &Expr) -> R {
|
fn visit_expr(&mut self, expr: &Expr) -> R {
|
||||||
self.visit_operation(&expr.ignore)
|
self.visit_operation(&expr.0)
|
||||||
}
|
}
|
||||||
// Block expression
|
// Block expression
|
||||||
/// Visit a [Block] expression
|
/// Visit a [Block] expression
|
||||||
|
@ -381,7 +381,7 @@ impl Parser {
|
|||||||
/// Parses an [expression](expression::Expr)
|
/// Parses an [expression](expression::Expr)
|
||||||
fn expr(&mut self) -> PResult<expression::Expr> {
|
fn expr(&mut self) -> PResult<expression::Expr> {
|
||||||
use expression::Expr;
|
use expression::Expr;
|
||||||
Ok(Expr { ignore: self.assign()? })
|
Ok(Expr(self.assign()?))
|
||||||
}
|
}
|
||||||
/// Parses a [block expression](expression::Block)
|
/// Parses a [block expression](expression::Block)
|
||||||
fn block(&mut self) -> PResult<expression::Block> {
|
fn block(&mut self) -> PResult<expression::Block> {
|
||||||
|
Loading…
Reference in New Issue
Block a user