We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
I want to got foreach Node OriginTextPosition and Text, but ican't got it, why
type FingerprintVisitor struct{}
func (f *FingerprintVisitor) Enter(n ast.Node) (node ast.Node, skipChildren bool) { fmt.Printf("[%T] %d --> %s\n", n, n.OriginTextPosition(), n.Text()) return n, false }
func (f *FingerprintVisitor) Leave(n ast.Node) (node ast.Node, ok bool) { fmt.Printf("[%T] %d <-- %s\n", n, n.OriginTextPosition(), n.Text()) return n, true }
func main(){ sql = select * from tb force index(a) pa := parser.New() if node, err := pa.ParseOneStmt(sql, "", ""); err == nil { var v = &FingerprintVisitor{} node.Accept(v) } else { fmt.Println(err) } }
select * from tb force index(a)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I want to got foreach Node OriginTextPosition and Text, but ican't got it, why
type FingerprintVisitor struct{}
func (f *FingerprintVisitor) Enter(n ast.Node) (node ast.Node, skipChildren bool) {
fmt.Printf("[%T] %d --> %s\n", n, n.OriginTextPosition(), n.Text())
return n, false
}
func (f *FingerprintVisitor) Leave(n ast.Node) (node ast.Node, ok bool) {
fmt.Printf("[%T] %d <-- %s\n", n, n.OriginTextPosition(), n.Text())
return n, true
}
func main(){
sql =
select * from tb force index(a)
pa := parser.New()
if node, err := pa.ParseOneStmt(sql, "", ""); err == nil {
var v = &FingerprintVisitor{}
node.Accept(v)
} else {
fmt.Println(err)
}
}
The text was updated successfully, but these errors were encountered: