Documentation ¶
Index ¶
- func ImportsOnly(path string) ([]string, error)
- type ArrayLit
- type ArrayType
- type BlockLit
- type Call
- type CaseDef
- type CaseVal
- type CharLit
- type Comment
- type Convert
- type Def
- type Expr
- type FieldDef
- type FieldVal
- type File
- type FloatLit
- type FuncDecl
- type FuncDef
- type FuncParm
- type FuncType
- type Ident
- type IfaceDef
- type Import
- type IntLit
- type ModSel
- type NamedType
- type Parser
- type PrintOpt
- type RefType
- type StrLit
- type StructLit
- type StructType
- type SubExpr
- type TestDef
- type Type
- type TypeDef
- type TypeVar
- type UnionLit
- type UnionType
- type VarDef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImportsOnly ¶
ImportsOnly returns just the paths imported by a source file. Imports only parses the imports and ignores the rest of the file; syntax errors after import statements are not reported.
Types ¶
type File ¶
type FuncDef ¶
type FuncDef struct { Exp bool Name Ident Parms []FuncParm Ret Type // nil if no return // Constraints is an interface constraint to satisfy // after the return type is determined. // Each element is either a *FuncDecl // or a *NamedType naming an interface. Constraints []interface{} Exprs []Expr // nil if unspecified, non-nil, len()==0 if empty L loc.Loc }
type Ident ¶
type IfaceDef ¶
type IfaceDef struct { Exp bool Opaque bool TypeParms []TypeVar Name Ident // Iface and Alias are mutually exclusive. // Iface is the defintition of a non-alias interface. // Each element is either a *FuncDecl // or a *NamedType naming an interface. Iface []interface{} // Alias is the name of an interface that this one aliases. Alias *NamedType L loc.Loc }
type Parser ¶
type Parser struct { Files []*File // TrimErrorPathPrefix is trimmed from path names // in parse error messages. TrimErrorPathPrefix string // contains filtered or unexported fields }
A Parser parses source code files.
func NewWithOffset ¶
NewWithOffset returns a new parser with the given location offset.
type StructType ¶
func (*StructType) Loc ¶
func (t *StructType) Loc() loc.Loc
Click to show internal directories.
Click to hide internal directories.