Skip to content

Commit fc0deb1

Browse files
committed
docs typos
Signed-off-by: xermicus <[email protected]>
1 parent d1415ab commit fc0deb1

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

crates/yul/src/visitor.rs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,28 @@ pub trait AstNode: std::fmt::Debug {
3333
///
3434
/// This is supposed visit child nodes in the correct order.
3535
///
36-
/// Visitor implementations are supposed to call this method for traversing.
36+
/// Visitor implementations call this method for traversing.
3737
fn visit_children(&self, _ast_visitor: &mut impl AstVisitor) {}
3838

3939
/// Returns the lexer (source) location of the node.
4040
fn location(&self) -> Location;
4141
}
4242

43-
/// This trait allows implementing custom AST visitor logic for each node type,
44-
/// without needing to worry about how the nodes must be traversed.
43+
/// This trait allows implementing custom AST visitor logic for each node type.
4544
///
46-
/// The only thing the visitor needs to ensure is to call the nodes
47-
/// [AstNode::visit_children] method (in any trait method).
48-
/// This simplifies the implementation fo AST visitors a lot (see below example).
45+
/// The visitor can call the nodes [AstNode::visit_children] method (from any
46+
/// other trait method). This simplifies the implementation of AST visitors.
4947
///
50-
/// Default implementations which do nothing except for visiting children
51-
/// are provided for each node type.
48+
/// Default implementations which do nothing except accepting the visitor via the
49+
/// [AstVisitor::visit] method are provided for each node type.
5250
///
53-
/// The [AstVisitor::visit] method is the generic visitor method,
54-
/// which is seen by all nodes.
51+
/// The [AstVisitor::visit] method is the generic visitor method, seen by all
52+
/// nodes.
5553
///
56-
/// Visited nodes are given read only access (non-mutable refernces) on purpose,
57-
/// as it's a compiler design best practice to not mutate the AST after parsing.
58-
/// Instead, mutable access to the [AstVisitor] instance itself is,
59-
/// provided, allowing to build a new representation instead if needed.
54+
/// Visited nodes are given read only access (non-mutable references); it's a
55+
/// compiler design practice to not mutate the AST after parsing.
56+
/// Instead, mutable access to the [AstVisitor] instance itself is provided,
57+
/// allowing to build a new representation if needed.
6058
///
6159
/// # Example
6260
///

0 commit comments

Comments
 (0)