| 4185 | } |
| 4186 | |
| 4187 | StatusOr<Shape> HloParserImpl::ParseShapeOnly() { |
| 4188 | lexer_.Lex(); |
| 4189 | Shape shape; |
| 4190 | if (!ParseShape(&shape)) { |
| 4191 | return InvalidArgument("Syntax error:\n%s", GetError()); |
| 4192 | } |
| 4193 | if (lexer_.GetKind() != TokKind::kEof) { |
| 4194 | return InvalidArgument("Syntax error:\nExtra content after shape"); |
| 4195 | } |
| 4196 | return shape; |
| 4197 | } |
| 4198 | |
| 4199 | StatusOr<HloSharding> HloParserImpl::ParseShardingOnly() { |
| 4200 | lexer_.Lex(); |
no test coverage detected