Closed apstndb closed 1 month ago
@apstndb If these PRs are merged, do you rewrite existing implementations with them as well?
If these PRs are merged, do you rewrite existing implementations with them as well?
If you want to unify style of existing implementation immediately, I can rewrite them. If not, we will rewrite them as necessary, like the Boy Scout rule.
I may be better to place functions into sql.go
and pos.go
rather than util.go
.
These functions won't be used in other files, and these files should be self-contained as possible.
I may be better to place functions into sql.go and pos.go rather than util.go.
This sounds good 👍
Contributors need to maintain comments in
ast/ast.go
and implementations ofSQL()
,Pos()
, andEnd()
methods inast/sql.go
andast/pos.go
. I believe productability is improved if comments and implementations can be written as similar structure.I propose to add helper functions to implement the methods. I believe these functions are useful as long as memefish have
ast.Node
interface .Note These helper functions are already used in PRs(#99, #101, #111).
sqlOpt
needscomparable
after Go 1.20, so this PR bump Go version to 1.20. I have refacotoredast.Select
,ast.Path
andast.CallExpr
to demonstrate the usage and effect of helper functions.