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

Method parse_import_decl

package_text.go:471–478  ·  view source on GitHub ↗

------------------------------------------------------------------------------- gc_parser.declarations ------------------------------------------------------------------------------- ImportDecl = "import" identifier string_lit .

()

Source from the content-addressed store, hash-verified

469
470// ImportDecl = "import" identifier string_lit .
471func (p *gc_parser) parse_import_decl() {
472 p.expect_keyword("import")
473 alias := p.expect(scanner.Ident)
474 path := p.parse_package()
475 fullName := "!" + path.Name + "!" + alias
476 p.path_to_name[path.Name] = fullName
477 p.pfc.add_package_to_scope(fullName, path.Name)
478}
479
480// ConstDecl = "const" ExportedName [ Type ] "=" Literal .
481// Literal = bool_lit | int_lit | float_lit | complex_lit | string_lit .

Callers 1

parse_declMethod · 0.95

Calls 4

expect_keywordMethod · 0.95
expectMethod · 0.95
parse_packageMethod · 0.95
add_package_to_scopeMethod · 0.80

Tested by

no test coverage detected