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

Method parse_export

package_text.go:671–685  ·  view source on GitHub ↗

Export = PackageClause { Decl } "$$" . PackageClause = "package" identifier [ "safe" ] "\n" .

(callback func(string, ast.Decl))

Source from the content-addressed store, hash-verified

669// Export = PackageClause { Decl } "$$" .
670// PackageClause = "package" identifier [ "safe" ] "\n" .
671func (p *gc_parser) parse_export(callback func(string, ast.Decl)) {
672 p.expect_keyword("package")
673 p.pfc.defalias = p.expect(scanner.Ident)
674 if p.tok != '\n' {
675 p.expect_keyword("safe")
676 }
677 p.expect('\n')
678
679 for p.tok != '$' && p.tok != scanner.EOF {
680 pkg, decl := p.parse_decl()
681 if decl != nil {
682 callback(pkg, decl)
683 }
684 }
685}

Callers

nothing calls this directly

Calls 3

expect_keywordMethod · 0.95
expectMethod · 0.95
parse_declMethod · 0.95

Tested by

no test coverage detected