Ignore context in Debug format for AST
This commit is contained in:
parent
e643ebe114
commit
14aa7c242a
@ -7,7 +7,7 @@ pub use statement::*;
|
|||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
collections::VecDeque,
|
collections::VecDeque,
|
||||||
fmt::{self, Display, Formatter},
|
fmt::{self, Debug, Display, Formatter},
|
||||||
num::TryFromIntError,
|
num::TryFromIntError,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ use crate::{Context, ContextError};
|
|||||||
pub type Span = (usize, usize);
|
pub type Span = (usize, usize);
|
||||||
|
|
||||||
/// In-memory representation of a Dust program.
|
/// In-memory representation of a Dust program.
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Clone, Serialize, Deserialize)]
|
||||||
pub struct AbstractSyntaxTree {
|
pub struct AbstractSyntaxTree {
|
||||||
pub statements: VecDeque<Statement>,
|
pub statements: VecDeque<Statement>,
|
||||||
|
|
||||||
@ -26,6 +26,14 @@ pub struct AbstractSyntaxTree {
|
|||||||
pub context: Context,
|
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 Eq for AbstractSyntaxTree {}
|
||||||
|
|
||||||
impl PartialEq for AbstractSyntaxTree {
|
impl PartialEq for AbstractSyntaxTree {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user