modfile: clarify documentation for Parse

Fixes golang/go#45149

Change-Id: Ie76f4b46964a99015bcd5c8166c26b25bc61ce72
Reviewed-on: https://go-review.googlesource.com/c/mod/+/308452
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
diff --git a/modfile/rule.go b/modfile/rule.go
index f8c9384..8843aee 100644
--- a/modfile/rule.go
+++ b/modfile/rule.go
@@ -131,8 +131,15 @@
 	return vers, nil
 }
 
-// Parse parses the data, reported in errors as being from file,
-// into a File struct. It applies fix, if non-nil, to canonicalize all module versions found.
+// Parse parses and returns a go.mod file.
+//
+// file is the name of the file, used in positions and errors.
+//
+// data is the content of the file.
+//
+// fix is an optional function that canonicalizes module versions.
+// If fix is nil, all module versions must be canonical (module.CanonicalVersion
+// must return the same string).
 func Parse(file string, data []byte, fix VersionFixer) (*File, error) {
 	return parseToFile(file, data, fix, true)
 }