| 312 | }; |
| 313 | |
| 314 | Expect<PkgPath> parsePkgPath(std::string_view &Next, |
| 315 | std::string_view StopChars) { |
| 316 | std::string_view Namespace; |
| 317 | if (!readUntil(Next, ':', Namespace)) |
| 318 | return reportError("expected ':' in namespace"sv); |
| 319 | if (!isLowercaseKebabString(Namespace)) |
| 320 | return reportError("invalid namespace"sv); |
| 321 | |
| 322 | size_t PkgEnd = Next.find_first_of(StopChars); |
| 323 | if (PkgEnd == Next.npos) |
| 324 | return reportError("unterminated package name"sv); |
| 325 | std::string_view Package = Next.substr(0, PkgEnd); |
| 326 | Next.remove_prefix(PkgEnd); |
| 327 | if (!isLowercaseKebabString(Package)) |
| 328 | return reportError("invalid package name"sv); |
| 329 | |
| 330 | return PkgPath{Namespace, Package}; |
| 331 | } |
| 332 | |
| 333 | } // anonymous namespace |
| 334 |
nothing calls this directly
no test coverage detected