MCPcopy Create free account
hub / github.com/docopt/docopt.go / parsePattern

Function parsePattern

docopt.go:184–194  ·  view source on GitHub ↗
(source string, options *patternList)

Source from the content-addressed store, hash-verified

182}
183
184func parsePattern(source string, options *patternList) (*pattern, error) {
185 tokens := tokenListFromPattern(source)
186 result, err := parseExpr(tokens, options)
187 if err != nil {
188 return nil, err
189 }
190 if tokens.current() != nil {
191 return nil, tokens.errorFunc("unexpected ending: %s" + strings.Join(tokens.tokens, " "))
192 }
193 return newRequired(result...), nil
194}
195
196func parseArgv(tokens *tokenList, options *patternList, optionsFirst bool) (patternList, error) {
197 /*

Callers 2

parseFunction · 0.85
TestParsePatternFunction · 0.85

Calls 4

tokenListFromPatternFunction · 0.85
parseExprFunction · 0.85
newRequiredFunction · 0.85
currentMethod · 0.80

Tested by 1

TestParsePatternFunction · 0.68