Documentation
¶
Overview ¶
Package functioncontracts implements a sub-analyzer to analyze function contracts in a package, i.e., parsing specified function contracts written as special comments before function declarations, or automatically inferring function contracts from the function body.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Analyzer = &analysis.Analyzer{ Name: "nilaway_function_contracts_analyzer", Doc: _doc, Run: analysishelper.WrapRun(run), ResultType: reflect.TypeOf((*analysishelper.Result[Map])(nil)), FactTypes: []analysis.Fact{new(Contracts)}, Requires: []*analysis.Analyzer{config.Analyzer, buildssa.Analyzer}, }
Analyzer here is the analyzer than reads function contracts. It returns the map generated from reading the function contracts in the source code.
Functions ¶
This section is empty.
Types ¶
type Contract ¶
type Contract struct { // Ins is the list of input contract values, where the index is the index of the parameter. Ins []ContractVal // Outs is the list of output contract values, where the index is the index of the return. Outs []ContractVal }
Contract represents a function contract.
type ContractVal ¶
type ContractVal string
ContractVal represents the possible value appearing in a function contract.
const ( // NonNil has keyword "nonnil". NonNil ContractVal = "nonnil" // False has keyword "false". False ContractVal = "false" // True has keyword "true". True ContractVal = "true" // Any has keyword "_". Any ContractVal = "_" )
Click to show internal directories.
Click to hide internal directories.