From 100279cd16c6b468345ffa328b0d9d03f9ebe923 Mon Sep 17 00:00:00 2001 From: Pat Moroney Date: Fri, 12 Jan 2018 11:36:29 -0700 Subject: [PATCH] add comment about tree traversal --- helpers/helpers.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helpers/helpers.go b/helpers/helpers.go index 5e8bbba..da92080 100644 --- a/helpers/helpers.go +++ b/helpers/helpers.go @@ -136,6 +136,8 @@ func InitPathMaps(files []*descriptor.FileDescriptorProto) { } } +// addToPathMap traverses through the AST adding SourceCodeInfo_Location entries to the pathMap. +// Since the AST is a tree, the recursion finishes once it has gone through all the nodes. func addToPathMap(info *descriptor.SourceCodeInfo, i interface{}, path []int32) { loc := findLoc(info, path) if loc != nil {