| 456 | } |
| 457 | |
| 458 | static Required parse_pattern(std::string const& source, std::vector<Option>& options) |
| 459 | { |
| 460 | auto tokens = Tokens::from_pattern(source); |
| 461 | auto result = parse_expr(tokens, options); |
| 462 | |
| 463 | if (tokens) |
| 464 | throw DocoptLanguageError("Unexpected ending: '" + tokens.the_rest() + "'"); |
| 465 | |
| 466 | assert(result.size() == 1 && "top level is always one big"); |
| 467 | return Required{ std::move(result) }; |
| 468 | } |
| 469 | |
| 470 | |
| 471 | static std::string formal_usage(std::string const& section) { |
no test coverage detected