// Parse converts a regex string into a parse tree
502323
func Parse(re string, op RegexOptions) (*RegexTree, error) {
	p := parser{
		options: op,
		caps:    make(map[int]int),
	}
	p.setPattern(re)

	if err := p.countCaptures(); err != nil {
		return nil, err
	}

	p.reset(op)
	root, err := p.scanRegex()

	if err != nil {
		return nil, err
	}
	tree := &RegexTree{
		root:       root,
		caps:       p.caps,
		capnumlist: p.capnumlist,
		captop:     p.captop,
		Capnames:   p.capnames,
		Caplist:    p.capnamelist,
		options:    op,
	}

	if tree.options&Debug > 0 {
		os.Stdout.WriteString(tree.Dump())
	}

	return tree, nil
}
10348
func (parser StringTypeParser) Parse(d DataType) error {
	if value, ok := AsString(d); ok {
		parser.setter(value)
	} else {
		return fmt.Errorf("Error parsing type of %#v as a String", d)
	}
	return nil
}
735299
func Parse(md metadata.MD) interface{} {
	if parser == nil {
		return nil
	}
	return parser.Parse(md)
}
495912
func (s *State) Parse(args []string) error {
	pc := matcher.NewParseContext()
	ok := s.apply(args, pc)
	if !ok {
		return fmt.Errorf("incorrect usage")
	}

	if err := fillContainers(pc.Opts); err != nil {
		return err
	}

	return fillContainers(pc.Args)
}
1135819
func (p *Parser) Parse(data []byte) (interfaces.Mappable, error) {
	r := bytes.NewReader(data)
	decoder := xmlp.NewDecoder(r)
	err := decoder.RootElement()
	if err != nil {
		return nil, err
	}

	var feed Feed
	err = p.decode(decoder, &feed)
	if err != nil {
		return nil, err
	}

	return feed, nil
}
683891
func parse(expr string) node {
	r := &scanner{text: expr}
	r.nextChar()
	r.nextItem()
	p := &parser{r: r}
	return p.parseExpression(nil)
}
537678
func (t *Tree) Parse() error {
	go t.lex.tokenize()
	for {
		n, err := t.parse()
		if err != nil {
			return t.enrichError(err)
		}
		if n == nil {
			break
		}
		t.root.Append(n)
	}
	t.traverse(t.root)
	return nil
}
214157
func (p SeparatorKeyParser) Parse(k string) Key {
	return NewKeySep(k, string(p))
}
946893
func Parse(pair string) (k, v string) {
	parts := strings.SplitN(pair, ":", 2)
	k = parts[0]
	if len(parts) > 1 {
		v = parts[1]
	} else {
		// this pair is invalid. This should not happen in practice.
		// Do not panic because this function is used for externally-supplied
		// data.
	}
	return
}
858116
func (p *Parser) Parse() (*ast.File, error) {
	f := &ast.File{}
	var err, scerr error
	p.sc.Error = func(pos token.Pos, msg string) {
		scerr = &PosError{Pos: pos, Err: errors.New(msg)}
	}

	f.Node, err = p.objectList(false)
	if scerr != nil {
		return nil, scerr
	}
	if err != nil {
		return nil, err
	}

	f.Comments = p.comments
	return f, nil
}
779813
func (c *ChatUpdateCall) Parse(parse string) *ChatUpdateCall {
	c.parse = parse
	return c
}
928956
func Parse(args []string, argv interface{}) error {
	clr := color.Color{}
	fset := parseArgv(args, argv, clr)
	return fset.err
}
514080
func Parse(err string) *Error {
	e := new(Error)
	errr := json.Unmarshal([]byte(err), e)
	if errr != nil {
		e.Detail = err
	}
	return e
}
777377
func (t *ParseTree) Parse(p *Parser) (Statement, error) {
	for {
		tok, pos, lit := p.ScanIgnoreWhitespace()
		if subtree := t.Tokens[tok]; subtree != nil {
			t = subtree
			continue
		}

		if stmt := t.Handlers[tok]; stmt != nil {
			return stmt(p)
		}

		// There were no registered handlers. Return the valid tokens in the order they were added.
		return nil, newParseError(tokstr(tok, lit), t.Keys, pos)
	}
}
673769
func Parse(s string) (r T, err error) {
	_, err = fmt.Sscan(s,
		&r[0][0], &r[0][1], &r[0][2],
		&r[1][0], &r[1][1], &r[1][2],
		&r[2][0], &r[2][1], &r[2][2],
	)
	return r, err
}
298492
func Parse(args ...string) (Value, error) {
	v, _, err := ParseWithAliases(args...)
	return v, err
}
787113
func (t *tree) parse() (_ Node, err error) {
	defer func() {
		if p := recover(); p != nil {
			err = fmt.Errorf("parse error: %v", p)
		}
	}()
	return t.O(0), err
}