MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / generateOpsFile

Function generateOpsFile

pkg/sql/sem/tree/evalgen/op.go:21–34  ·  view source on GitHub ↗
(fileName string, files []*ast.File, byName map[string]*ast.File)

Source from the content-addressed store, hash-verified

19)
20
21func generateOpsFile(fileName string, files []*ast.File, byName map[string]*ast.File) (err error) {
22 return writeFile(fileName, func(f *os.File) error {
23 return opsTemplate.Execute(f, struct {
24 UnaryOps, BinaryOps []string
25 }{
26 UnaryOps: findEvalOps(
27 files, byName[unaryOpsDefinitionsFile], isUnaryEvalMethod,
28 ).ordered(),
29 BinaryOps: findEvalOps(
30 files, byName[binaryOpsDefinitionsFile], isBinaryEvalMethod,
31 ).ordered(),
32 })
33 })
34}
35
36func findEvalOps(
37 files []*ast.File, definitionFile *ast.File, existingMethodFilter func(decl *ast.FuncDecl) bool,

Callers 1

mainFunction · 0.85

Calls 3

writeFileFunction · 0.85
findEvalOpsFunction · 0.85
orderedMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…