Skip to content

Commit e10bc92

Browse files
committed
Add comments
1 parent 1a3f6f6 commit e10bc92

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gazelle/python/file_parser.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,12 @@ func ParseCode(code []byte, path string) (*sitter.Node, error) {
7777
for i := 0; i < int(root.ChildCount()); i++ {
7878
child := root.Child(i)
7979
if child.IsError() {
80+
// Example logs:
81+
// gazelle: Parse error at {Row:1 Column:0}:
82+
// def search_one_more_level[T]():
8083
log.Printf("Parse error at %+v:\n%+v", child.StartPoint(), child.Content(code))
84+
// Log the internal tree-sitter representation of what was parsed. Eg:
85+
// gazelle: The above was parsed as: (ERROR (identifier) (call function: (list (identifier)) arguments: (argument_list)))
8186
log.Printf("The above was parsed as: %v", child.String())
8287
}
8388
}

0 commit comments

Comments
 (0)