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

Struct decl

decl.go:79–104  ·  view source on GitHub ↗

------------------------------------------------------------------------- decl The most important data structure of the whole gocode project. It describes a single declaration and its children. -------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

77//-------------------------------------------------------------------------
78
79type decl struct {
80 // Name starts with '$' if the declaration describes an anonymous type.
81 // '$s_%d' for anonymous struct types
82 // '$i_%d' for anonymous interface types
83 name string
84 typ ast.Expr
85 class decl_class
86 flags decl_flags
87
88 // functions for interface type, fields+methods for struct type
89 children map[string]*decl
90
91 // embedded types
92 embedded []ast.Expr
93
94 // if the type is unknown at AST building time, I'm using these
95 value ast.Expr
96
97 // if it's a multiassignment and the Value is a CallExpr, it is being set
98 // to an index into the return value tuple, otherwise it's a -1
99 value_index int
100
101 // scope where this Decl was declared in (not its visibilty scope!)
102 // Decl uses it for type inference
103 scope *scope
104}
105
106func ast_decl_type(d ast.Decl) ast.Expr {
107 switch t := d.(type) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected