Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var InspectorAnalyzer = &Analyzer{ Run: func(pass *Pass) interface{} { return ast.NewInspector(pass.Program.Program) }, }
Functions ¶
This section is empty.
Types ¶
type Analyzer ¶
type Analyzer struct { Description string Run func(*Pass) interface{} // Requires is a set of analyzers that must run before this one. // This analyzer may inspect the outputs produced by each analyzer in Requires. // The graph over analyzers implied by Requires edges must be acyclic Requires []*Analyzer }
Analyzer describes an analysis function and its options
type Config ¶
type Config struct { // Mode controls the level of information returned for each program. Mode LoadMode // ResolveAddressContractNames is called to resolve the contract names of an address location. ResolveAddressContractNames func(address common.Address) ([]string, error) // ResolveCode is called to resolve an import to its source code. ResolveCode func( location common.Location, importingLocation common.Location, importRange ast.Range, ) (string, error) }
A Config specifies details about how programs should be loaded. The zero value is a valid configuration. Calls to Load do not modify this struct.
type Diagnostic ¶
type LoadMode ¶
type LoadMode int
LoadMode controls the amount of detail to return when loading. The bits below can be combined to specify what information is required.
type ParsingCheckingError ¶
type ParsingCheckingError struct {
// contains filtered or unexported fields
}
func (ParsingCheckingError) ChildErrors ¶
func (e ParsingCheckingError) ChildErrors() []error
func (ParsingCheckingError) ImportLocation ¶
func (e ParsingCheckingError) ImportLocation() common.Location
func (ParsingCheckingError) Unwrap ¶
func (e ParsingCheckingError) Unwrap() error
type Pass ¶
type Pass struct { Program *Program // Report reports a Diagnostic, a finding about a specific location // in the analyzed source code such as a potential mistake. // It may be called by the Analyzer.Run function. Report func(Diagnostic) // ResultOf provides the inputs to this analysis pass, // which are the corresponding results of its prerequisite analyzers. // The map keys are the elements of Analyzer.Requires. ResultOf map[*Analyzer]interface{} }
Pass provides information to the Analyzer.Run function, which applies a specific analyzer to a single location.
Click to show internal directories.
Click to hide internal directories.