AST cleanup

This commit is contained in:
d0cd 2023-02-21 10:17:57 -08:00
parent 4b3b4a83ff
commit 707cd3cfce
2 changed files with 5 additions and 2 deletions

View File

@ -65,7 +65,7 @@ pub trait ExpressionReconstructor {
index: tuple.index,
span: tuple.span,
}),
expr => expr,
AccessExpression::AssociatedConstant(constant) => AccessExpression::AssociatedConstant(constant),
}),
Default::default(),
)
@ -255,12 +255,13 @@ pub trait StatementReconstructor: ExpressionReconstructor {
)
}
// TODO: Reconstructor should visit this.
fn reconstruct_decrement(&mut self, input: DecrementStatement) -> (Statement, Self::AdditionalOutput) {
(
Statement::Decrement(DecrementStatement {
mapping: input.mapping,
index: input.index,
amount: input.amount,
index: input.index,
span: input.span,
}),
Default::default(),
@ -290,6 +291,7 @@ pub trait StatementReconstructor: ExpressionReconstructor {
)
}
// TODO: Reconstructor should visit this.
fn reconstruct_increment(&mut self, input: IncrementStatement) -> (Statement, Self::AdditionalOutput) {
(
Statement::Increment(IncrementStatement {

View File

@ -25,6 +25,7 @@ use std::fmt;
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]
pub struct AssignStatement {
/// The place to assign to.
/// Note that `place` can either be an identifier or tuple.
pub place: Expression,
/// The value to assign to the `assignee`.
pub value: Expression,