From e68331fe0a3e12aa87257f23df11457d7e96e931 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Sat, 23 Oct 2021 21:14:13 -0700 Subject: [PATCH] Make methods on Visitor public And remove comment --- schala-lang/language/src/ast/mod.rs | 17 +---------------- schala-lang/language/src/ast/visitor.rs | 2 +- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/schala-lang/language/src/ast/mod.rs b/schala-lang/language/src/ast/mod.rs index 8e22b2a..55dda76 100644 --- a/schala-lang/language/src/ast/mod.rs +++ b/schala-lang/language/src/ast/mod.rs @@ -5,7 +5,7 @@ mod visitor; mod operators; pub use operators::{PrefixOp, BinOp}; -pub use visitor::{walk_ast, ASTVisitor}; +pub use visitor::{walk_ast, walk_block, ASTVisitor}; use std::rc::Rc; use crate::derivative::Derivative; @@ -119,21 +119,6 @@ pub enum Declaration { } } -/* - * @foo(arg1, arg2) - * fn hello() { - * - * } - * - * Declaration::Annotation { - * name: "foo", - * arguments: vec!["arg1", "arg2"] - * } - * - * - * - */ - #[derive(Debug, PartialEq, Clone)] pub struct Signature { pub name: Rc, diff --git a/schala-lang/language/src/ast/visitor.rs b/schala-lang/language/src/ast/visitor.rs index 8d16ed2..2948c82 100644 --- a/schala-lang/language/src/ast/visitor.rs +++ b/schala-lang/language/src/ast/visitor.rs @@ -19,7 +19,7 @@ pub fn walk_ast(v: &mut V, ast: &AST) { walk_block(v, &ast.statements); } -fn walk_block(v: &mut V, block: &Block) { +pub fn walk_block(v: &mut V, block: &Block) { use StatementKind::*; for statement in block.iter() { match statement.kind {