diff --git a/src/ast.rs b/src/ast.rs index de220e6..bac3b71 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -46,6 +46,12 @@ pub struct GlobalBlock { statements: Vec>, } +impl GlobalBlock { + pub fn push_node(&mut self, node: Box) { + self.statements.push(node); + } +} + impl ToString for GlobalBlock { fn to_string(&self) -> String { let mut s = String::new(); @@ -64,6 +70,12 @@ pub struct Block { statements: Vec>, } +impl Block { + pub fn push_node(&mut self, node: Box) { + self.statements.push(node); + } +} + impl ToString for Block { fn to_string(&self) -> String { let mut s = String::from("{ ");