Documentation ¶
Overview ¶
Package parsecond parses the condition from the function documentation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition struct { Label string // InitStr corresponds to initialization statement in conditions, // e.g., given // _, ok := someMap[3]; ok // // , the initialization is: // _, ok := someMap[3] // // See https://golang.org/ref/spec#If_statements InitStr string CondStr string Cond ast.Expr }
Condition defines a pre- or a post-condition of the function's contract.
func ToCondition ¶
ToCondition tries to parse the condition from text.
If no condition could be matched, cond is nil. Err is set if the text matched the bullet format, but there was an error parsing the condition.
Click to show internal directories.
Click to hide internal directories.