| 31 | namespace { |
| 32 | |
| 33 | bool InExemptFunction(const NavigableAstNode& node, |
| 34 | const std::vector<std::string>& exempt_functions) { |
| 35 | const NavigableAstNode* parent = node.parent(); |
| 36 | while (parent != nullptr) { |
| 37 | if (parent->node_kind() == NodeKind::kCall) { |
| 38 | absl::string_view fn_name = parent->expr()->call_expr().function(); |
| 39 | for (const auto& exempt : exempt_functions) { |
| 40 | if (exempt == fn_name) { |
| 41 | return true; |
| 42 | } |
| 43 | } |
| 44 | } |
| 45 | parent = parent->parent(); |
| 46 | } |
| 47 | return false; |
| 48 | } |
| 49 | |
| 50 | bool IsOptional(const TypeSpec& t) { |
| 51 | return t.has_abstract_type() && t.abstract_type().name() == "optional_type"; |
no test coverage detected