parseExpr wraps a call to ParseExprAsProducer with two additional bits of useful handling: 1. check for the empty expression and return nil when passed it 2. if parsing fails with a panic, return nil (This can happen because handling for the sake of contracts is less refined than handling in the mor
(rootNode *RootAssertionNode, expr ast.Expr)
| 269 | // here we don't check for library identifiers which cannot be found in the set of sources for this |
| 270 | // analysis pass before we call ParseExprAsProducer below) |
| 271 | func parseExpr(rootNode *RootAssertionNode, expr ast.Expr) TrackableExpr { |
| 272 | defer func() { |
| 273 | // This handles unexpected panics during parsing. |
| 274 | // TODO: consider removing this hack. |
| 275 | _ = recover() |
| 276 | }() |
| 277 | // this handles being passed the empty expression |
| 278 | if asthelper.IsEmptyExpr(expr) { |
| 279 | return nil |
| 280 | } |
| 281 | parsed, _ := rootNode.ParseExprAsProducer(expr, false) |
| 282 | return parsed |
| 283 | } |
| 284 | |
| 285 | // NodeTriggersOkRead is a case of a node creating a rich bool effect for map reads, channel receives, and user-defined |
| 286 | // functions in the "ok" form. Specifically, it matches on `AssignStmt`s of the form |
no test coverage detected