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

Method parse_var_decl

package_text.go:554–567  ·  view source on GitHub ↗

VarDecl = "var" ExportedName Type .

()

Source from the content-addressed store, hash-verified

552
553// VarDecl = "var" ExportedName Type .
554func (p *gc_parser) parse_var_decl() (string, *ast.GenDecl) {
555 p.expect_keyword("var")
556 name := p.parse_exported_name()
557 typ := p.parse_type()
558 return name.X.(*ast.Ident).Name, &ast.GenDecl{
559 Tok: token.VAR,
560 Specs: []ast.Spec{
561 &ast.ValueSpec{
562 Names: []*ast.Ident{name.Sel},
563 Type: typ,
564 },
565 },
566 }
567}
568
569// FuncBody = "{" ... "}" .
570func (p *gc_parser) parse_func_body() {

Callers 1

parse_declMethod · 0.95

Calls 3

expect_keywordMethod · 0.95
parse_exported_nameMethod · 0.95
parse_typeMethod · 0.95

Tested by

no test coverage detected