| 3519 | } |
| 3520 | |
| 3521 | bool HloParserImpl::ParseList(const TokKind start, const TokKind end, |
| 3522 | const TokKind delim, |
| 3523 | const std::function<bool()>& parse_and_add_item) { |
| 3524 | if (!ParseToken(start, StrCat("expects a list starting with ", |
| 3525 | TokKindToString(start)))) { |
| 3526 | return false; |
| 3527 | } |
| 3528 | if (lexer_.GetKind() == end) { |
| 3529 | // empty |
| 3530 | } else { |
| 3531 | do { |
| 3532 | if (!parse_and_add_item()) { |
| 3533 | return false; |
| 3534 | } |
| 3535 | } while (EatIfPresent(delim)); |
| 3536 | } |
| 3537 | return ParseToken( |
| 3538 | end, StrCat("expects a list to end with ", TokKindToString(end))); |
| 3539 | } |
| 3540 | |
| 3541 | // param_list_to_shape ::= param_list '->' shape |
| 3542 | bool HloParserImpl::ParseParamListToShape(Shape* shape, LocTy* shape_loc) { |
nothing calls this directly
no test coverage detected