Lines Matching refs:gen
312 // declImports reports whether gen contains an import of path.
313 func declImports(gen *ast.GenDecl, path string) bool {
314 if gen.Tok != token.IMPORT {
317 for _, spec := range gen.Specs {
588 gen, ok := decl.(*ast.GenDecl)
589 if ok && gen.Tok == token.IMPORT {
593 if declImports(gen, "C") {
598 for j, spec := range gen.Specs {
603 impDecl = gen
650 gen, ok := decl.(*ast.GenDecl)
651 if !ok || gen.Tok != token.IMPORT {
654 for j, spec := range gen.Specs {
663 copy(gen.Specs[j:], gen.Specs[j+1:])
664 gen.Specs = gen.Specs[:len(gen.Specs)-1]
668 if len(gen.Specs) == 0 {
671 } else if len(gen.Specs) == 1 {
672 gen.Lparen = token.NoPos // drop parens
679 gen.Specs[j-1].(*ast.ImportSpec).EndPos = impspec.End()