Index: src/Common/CodeLocationTools.cpp
===================================================================
--- src/Common/CodeLocationTools.cpp	(revision c86b08de42d13ee7646e48f36c60ff65633dc0ea)
+++ src/Common/CodeLocationTools.cpp	(revision 6f774be1d5e97d459b38dc756b61b836cddc73f0)
@@ -210,9 +210,9 @@
 
 struct LeafKindVisitor : public ast::Visitor {
-	LeafKind kind;
+	LeafKind result;
 
 #define VISIT(node_type, return_type) \
 	const ast::return_type * visit( const ast::node_type * ) final { \
-		kind = LeafKind::node_type; \
+		result = LeafKind::node_type; \
 		return nullptr; \
 	}
@@ -224,7 +224,5 @@
 
 LeafKind get_leaf_kind( ast::Node const * node ) {
-	LeafKindVisitor visitor;
-	node->accept( visitor );
-	return visitor.kind;
+	return ast::Pass<LeafKindVisitor>::read( node );
 }
 
Index: src/Common/Iterate.hpp
===================================================================
--- src/Common/Iterate.hpp	(revision c86b08de42d13ee7646e48f36c60ff65633dc0ea)
+++ src/Common/Iterate.hpp	(revision 6f774be1d5e97d459b38dc756b61b836cddc73f0)
@@ -20,5 +20,5 @@
 #include <iterator>
 
-// it's nice to actually be able to increment iterators by an arbitrary amount
+// Returns an iterator that is it advanced n times.
 template< class InputIt, class Distance >
 InputIt operator+( InputIt it, Distance n ) {
@@ -50,4 +50,8 @@
 
 // -----------------------------------------------------------------------------
+// Helper struct and function to support
+// for ( val_and_index : enumerate( container ) ) {}
+// which iterates through the container and tracks the index as well.
+
 template< typename T >
 struct enumerate_t {
@@ -109,4 +113,6 @@
 
 // -----------------------------------------------------------------------------
+// Helper function to transform one iterable container into another.
+
 template< typename OutType, typename Range, typename Functor >
 OutType map_range( const Range& range, Functor&& functor ) {
@@ -206,5 +212,7 @@
 // Helper struct and function to support
 // for ( val : lazy_map( container1, f ) ) {}
-// syntax to have a for each that iterates a container, mapping each element by applying f
+// syntax to have a for each that iterates a container,
+// mapping each element by applying f.
+
 template< typename T, typename Func >
 struct lambda_iterate_t {
