MCPcopy
hub / github.com/sqlc-dev/sqlc / Walk

Function Walk

internal/sql/astutils/walk.go:20–2200  ·  view source on GitHub ↗
(f Visitor, node ast.Node)

Source from the content-addressed store, hash-verified

18}
19
20func Walk(f Visitor, node ast.Node) {
21 if f = f.Visit(node); f == nil {
22 return
23 }
24 switch n := node.(type) {
25
26 case *ast.AlterTableSetSchemaStmt:
27 if n.Table != nil {
28 Walk(f, n.Table)
29 }
30
31 case *ast.AlterTableStmt:
32 if n.Relation != nil {
33 Walk(f, n.Relation)
34 }
35 if n.Table != nil {
36 Walk(f, n.Table)
37 }
38 if n.Cmds != nil {
39 Walk(f, n.Cmds)
40 }
41
42 case *ast.AlterTypeAddValueStmt:
43 if n.Type != nil {
44 Walk(f, n.Type)
45 }
46
47 case *ast.AlterTypeSetSchemaStmt:
48 if n.Type != nil {
49 Walk(f, n.Type)
50 }
51
52 case *ast.AlterTypeRenameValueStmt:
53 if n.Type != nil {
54 Walk(f, n.Type)
55 }
56
57 case *ast.CommentOnColumnStmt:
58 if n.Table != nil {
59 Walk(f, n.Table)
60 }
61 if n.Col != nil {
62 Walk(f, n.Col)
63 }
64
65 case *ast.CommentOnSchemaStmt:
66 if n.Schema != nil {
67 Walk(f, n.Schema)
68 }
69
70 case *ast.CommentOnTableStmt:
71 if n.Table != nil {
72 Walk(f, n.Table)
73 }
74
75 case *ast.CommentOnTypeStmt:
76 if n.Type != nil {
77 Walk(f, n.Type)

Callers 9

flattenFunction · 0.92
SqlcFunctionsFunction · 0.92
FuncCallFunction · 0.92
ParamRefFunction · 0.92
InFunction · 0.92
sourceTablesMethod · 0.92
findParametersFunction · 0.92
rangeVarsFunction · 0.92
SearchFunction · 0.85

Calls 1

VisitMethod · 0.65

Tested by

no test coverage detected