MCPcopy Create free account
hub / github.com/docopt/docopt.cpp / parse_pattern

Function parse_pattern

docopt.cpp:458–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456}
457
458static 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
471static std::string formal_usage(std::string const& section) {

Callers 1

create_pattern_treeFunction · 0.85

Calls 3

parse_exprFunction · 0.85
DocoptLanguageErrorClass · 0.85
the_restMethod · 0.80

Tested by

no test coverage detected