Skip to content

Commit 22e86e8

Browse files
committed
Make Visitor/Visitable trait for mutable.
Signed-off-by: James Goppert <james.goppert@gmail.com>
1 parent 2ccc1b1 commit 22e86e8

File tree

7 files changed

+742
-559
lines changed

7 files changed

+742
-559
lines changed

src/lib.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ extern crate macro_rules_attribute;
88
pub use s1_parser::ast;
99
pub use s2_analysis::parser_helper::parse_file;
1010
pub use s2_analysis::print_visitor::PrintVisitor;
11-
pub use s2_analysis::visitable::Visitable;
12-
pub use s2_analysis::visitor::Visitor;
11+
pub use s2_analysis::Visitable;
12+
pub use s2_analysis::VisitableMut;
13+
pub use s2_analysis::Visitor;
14+
pub use s2_analysis::VisitorMut;

src/s2_analysis/mod.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
pub mod parser_helper;
22
pub mod print_visitor;
33
pub mod visitable;
4+
pub mod visitable_mut;
45
pub mod visitor;
6+
pub mod visitor_mut;
57

68
pub use parser_helper::parse_file;
79
pub use print_visitor::PrintVisitor;
810
pub use visitable::Visitable;
11+
pub use visitable_mut::VisitableMut;
12+
pub use visitor::Visitor;
13+
pub use visitor_mut::VisitorMut;

src/s2_analysis/print_visitor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl Default for PrintVisitor {
2121
}
2222
}
2323

24-
impl Visitor for PrintVisitor {
24+
impl Visitor<'_> for PrintVisitor {
2525
fn enter_any(&mut self) {
2626
self.level += 1;
2727
}

0 commit comments

Comments
 (0)