MCPcopy
hub / github.com/cube2222/octosql / Walk

Function Walk

parser/sqlparser/ast.go:238–255  ·  view source on GitHub ↗

Walk calls visit on every node. If visit returns true, the underlying nodes are also visited. If it returns an error, walking is interrupted, and the error is returned.

(visit Visit, nodes ...SQLNode)

Source from the content-addressed store, hash-verified

236// are also visited. If it returns an error, walking
237// is interrupted, and the error is returned.
238func Walk(visit Visit, nodes ...SQLNode) error {
239 for _, node := range nodes {
240 if node == nil {
241 continue
242 }
243 kontinue, err := visit(node)
244 if err != nil {
245 return err
246 }
247 if kontinue {
248 err = node.walkSubtree(visit)
249 if err != nil {
250 return err
251 }
252 }
253 }
254 return nil
255}
256
257// String returns a string representation of an SQLNode.
258func String(node SQLNode) string {

Callers 15

walkSubtreeMethod · 0.85
walkSubtreeMethod · 0.85
walkSubtreeMethod · 0.85
walkSubtreeMethod · 0.85
walkSubtreeMethod · 0.85
walkSubtreeMethod · 0.85
walkSubtreeMethod · 0.85
walkSubtreeMethod · 0.85
walkSubtreeMethod · 0.85
walkSubtreeMethod · 0.85
walkSubtreeMethod · 0.85
walkSubtreeMethod · 0.85

Calls 1

walkSubtreeMethod · 0.65

Tested by 1

TestReplaceExprFunction · 0.68