MCPcopy
hub / github.com/docopt/docopt / parse_pattern

Function parse_pattern

docopt.py:370–376  ·  view source on GitHub ↗
(source, options)

Source from the content-addressed store, hash-verified

368
369
370def parse_pattern(source, options):
371 tokens = TokenStream(re.sub(r'([\[\]\(\)\|]|\.\.\.)', r' \1 ', source),
372 DocoptLanguageError)
373 result = parse_expr(tokens, options)
374 if tokens.current() is not None:
375 raise tokens.error('unexpected ending: %r' % ' '.join(tokens))
376 return Required(*result)
377
378
379def parse_expr(tokens, options):

Callers 2

test_parse_patternFunction · 0.90
docoptFunction · 0.85

Calls 4

currentMethod · 0.95
TokenStreamClass · 0.85
parse_exprFunction · 0.85
RequiredClass · 0.85

Tested by 1

test_parse_patternFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…