ast: Add Fold, Folder traits, reorganize visit

parser: fix precedence of `BindOp::Let`
This commit is contained in:
2025-10-29 04:39:41 -04:00
parent 9a0d1232a6
commit c1d32f3efc
4 changed files with 298 additions and 24 deletions

View File

@@ -4,6 +4,8 @@ pub mod macro_matcher;
pub mod visit;
pub mod fold;
/// An annotation: extra data added on to important AST nodes.
pub trait Annotation: Clone + std::fmt::Display + std::fmt::Debug + PartialEq + Eq {}
impl<T: Clone + std::fmt::Debug + std::fmt::Display + PartialEq + Eq> Annotation for T {}
@@ -130,6 +132,7 @@ pub enum Op {
XorSet, // Expr ^= Expr
OrSet, // Expr |= Expr
}
/// A qualified identifier
///
/// TODO: qualify identifier