Skip to content

Commit

Permalink
perf: Add default implementation for Visit in ParseTreeVisitor. (#3569)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenquan authored Mar 7, 2022
1 parent 219ab7e commit c693010
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions contributors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -326,3 +326,4 @@ YYYY/MM/DD, github id, Full name, email
2021/12/16, Ketler13, Oleksandr Martyshchenko, [email protected]
2021/12/25, Tinker1024, Tinker1024, [email protected]
2021/12/31, Biswa96, Biswapriyo Nath, [email protected]
2022/03/07, chenquan, chenquan, [email protected]
2 changes: 1 addition & 1 deletion runtime/Go/antlr/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type BaseParseTreeVisitor struct{}

var _ ParseTreeVisitor = &BaseParseTreeVisitor{}

func (v *BaseParseTreeVisitor) Visit(tree ParseTree) interface{} { return nil }
func (v *BaseParseTreeVisitor) Visit(tree ParseTree) interface{} { return tree.Accept(v) }
func (v *BaseParseTreeVisitor) VisitChildren(node RuleNode) interface{} { return nil }
func (v *BaseParseTreeVisitor) VisitTerminal(node TerminalNode) interface{} { return nil }
func (v *BaseParseTreeVisitor) VisitErrorNode(node ErrorNode) interface{} { return nil }
Expand Down

0 comments on commit c693010

Please sign in to comment.