diff --git a/dust-lang/src/ast/mod.rs b/dust-lang/src/ast/mod.rs index 4aab44e..3906081 100644 --- a/dust-lang/src/ast/mod.rs +++ b/dust-lang/src/ast/mod.rs @@ -7,7 +7,7 @@ pub use statement::*; use std::{ collections::VecDeque, - fmt::{self, Display, Formatter}, + fmt::{self, Debug, Display, Formatter}, num::TryFromIntError, }; @@ -18,7 +18,7 @@ use crate::{Context, ContextError}; pub type Span = (usize, usize); /// In-memory representation of a Dust program. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Serialize, Deserialize)] pub struct AbstractSyntaxTree { pub statements: VecDeque, @@ -26,6 +26,14 @@ pub struct AbstractSyntaxTree { pub context: Context, } +impl Debug for AbstractSyntaxTree { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + f.debug_struct("AbstractSyntaxTree") + .field("statements", &self.statements) + .finish() + } +} + impl Eq for AbstractSyntaxTree {} impl PartialEq for AbstractSyntaxTree {