clickhouse-sql-parser icon indicating copy to clipboard operation
clickhouse-sql-parser copied to clipboard

ASTVisitor { enter, leave ) functions are not exported. Is there any specific reason to keep these function name in lowercase

Open dmankotia opened this issue 8 months ago • 1 comments

Hello, I'm implementing custom QueryVisitor struct by embedding DefaultASTVisitor and overridde enter and leave functions to create stack that contains query element as they are visited. Idea is when query is visited by passing QueryVisitor instance, it will invoke my enter and leave function. However, it is not working expected if QueryVisitor is defined in seperate package outside of parser package.

package client QueryVisitor{ DefaultASTVisitor }

Is there any reason to keep enter and leave function name unexported ? Due to this issue, I had to define QueryVisitor in the same package as DefaultASTVisitor to make it work. Can this be fixed ?

dmankotia avatar Apr 03 '25 23:04 dmankotia

@dmankotia No special reason and makes sense to export them.

git-hulk avatar Apr 04 '25 02:04 git-hulk