MCPcopy Create free account
hub / github.com/nsf/gocode / ast_decl_split

Function ast_decl_split

decl.go:1311–1327  ·  view source on GitHub ↗
(d ast.Decl)

Source from the content-addressed store, hash-verified

1309}
1310
1311func ast_decl_split(d ast.Decl) []ast.Decl {
1312 var decls []ast.Decl
1313 if t, ok := d.(*ast.GenDecl); ok {
1314 decls = make([]ast.Decl, len(t.Specs))
1315 for i, s := range t.Specs {
1316 decl := new(ast.GenDecl)
1317 *decl = *t
1318 decl.Specs = make([]ast.Spec, 1)
1319 decl.Specs[0] = s
1320 decls[i] = decl
1321 }
1322 } else {
1323 decls = make([]ast.Decl, 1)
1324 decls[0] = d
1325 }
1326 return decls
1327}
1328
1329//-------------------------------------------------------------------------
1330// decl_pack

Callers 1

foreach_declFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected