// Parse returns an AST representation of TOML.
// The toplevel is represented by a table.
353609
func Parse(data []byte) (*ast.Table, error) {
	d := &parseState{p: &tomlParser{Buffer: string(data)}}
	d.init()

	if err := d.parse(); err != nil {
		return nil, err
	}

	return d.p.toml.table, nil
}
212694
func Parse(s string) (map[string]interface{}, error) {
	vals := map[string]interface{}{}
	scanner := bytes.NewBufferString(s)
	t := newParser(scanner, vals, false)
	err := t.parse()
	return vals, err
}
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
}
682470
func (d DefaultURLParser) Parse(val map[string][]string, body interface{}, tag string) error {
	return ValuesToStruct(val, body, tag)
}
786641
func (s *HTTPServer) parse(resp http.ResponseWriter, req *http.Request, dc *string, b *structs.QueryOptions) bool {
	return s.parseInternal(resp, req, dc, b, true)
}
899825
func (parser *Parser) Parse(sql, charset, collation string) ([]ast.StmtNode, error) {
	if charset == "" {
		charset = mysql.DefaultCharset
	}
	if collation == "" {
		collation = mysql.DefaultCollationName
	}
	parser.charset = charset
	parser.collation = collation
	parser.src = sql
	parser.result = parser.result[:0]

	var l yyLexer
	parser.lexer.reset(sql)
	l = &parser.lexer
	yyParse(l, parser)

	if len(l.Errors()) != 0 {
		return nil, errors.Trace(l.Errors()[0])
	}
	for _, stmt := range parser.result {
		ast.SetFlag(stmt)
	}
	return parser.result, nil
}
1102249
func (s *HTTPServer) parse(resp http.ResponseWriter, req *http.Request, r *string, b *structs.QueryOptions) bool {
	s.parseRegion(req, r)
	s.parseToken(req, &b.AuthToken)
	parseConsistency(req, b)
	parsePrefix(req, b)
	parseNamespace(req, &b.Namespace)
	return parseWait(resp, req, b)
}
1275844
func Parse(v string) (r Version, err error) {
	parts := semVerRegex.FindStringSubmatch(v)
	if parts == nil {
		return r, fmt.Errorf(`cannot parse as semantic version: %q`, v)
	}

	if r.Major, err = parseUint(parts[1]); err != nil {
		return r, err
	}
	if r.Minor, err = parseUint(parts[2]); err != nil {
		return r, err
	}
	if r.Patch, err = parseUint(parts[3]); err != nil {
		return r, err
	}

	if parts[4] != "" {
		r.Pre = strings.Split(parts[4], ".")
	}
	r.Meta = parts[5]
	return r, nil
}
244299
func Parse(lvl string) (Level, error) {
	switch lvl {
	case "fatal":
		return Fatal, nil
	case "panic":
		return Panic, nil
	case "error":
		return Error, nil
	case "warn":
		return Warn, nil
	case "info":
		return Info, nil
	case "debug":
		return Debug, nil
	}

	level, err := strconv.Atoi(lvl)
	if level > maxLevel {
		err = fmt.Errorf("invalid level value: %s", lvl)
	}
	return Level(level), err
}
1363119
func Parse(ast *parser.Node) (stages []Stage, metaArgs []ArgCommand, err error) {
	for _, n := range ast.Children {
		cmd, err := ParseInstruction(n)
		if err != nil {
			return nil, nil, &parseError{inner: err, node: n}
		}
		if len(stages) == 0 {
			// meta arg case
			if a, isArg := cmd.(*ArgCommand); isArg {
				metaArgs = append(metaArgs, *a)
				continue
			}
		}
		switch c := cmd.(type) {
		case *Stage:
			stages = append(stages, *c)
		case Command:
			stage, err := CurrentStage(stages)
			if err != nil {
				return nil, nil, err
			}
			stage.AddCommand(c)
		default:
			return nil, nil, errors.Errorf("%T is not a command type", cmd)
		}

	}
	return stages, metaArgs, nil
}
140898
func (t *Tree) Parse(text string) (err error) {
	defer t.recover(&err)
	t.startParse(lex(text))
	t.Text = text
	t.parse()
	t.stopParse()
	return nil
}
474365
func Parse(s []byte) (*ast.Program, error) {
	lex := newLexer(s)
	e := yyParse(lex)
	if e == 0 && !lex.parseFailed {
		return lex.program, nil
	}
	return nil, lex.err
}
979397
func (c *ChatPostMessageCall) Parse(parse string) *ChatPostMessageCall {
	c.parse = parse
	return c
}
996649
func (parser *Parser) Parse() error {
	err := parser.parse()
	if err != nil {
		return err
	}

	if len(parser.previous) > 0 {
		return parser.syntaxError("expected end of section, instead found EOF")
	}

	return nil
}
871432
func Parse(qStr string) (Q, error) {
	b := []byte(qStr)

	qs, _, err := parseExprList(b)
	if err != nil {
		return nil, err
	}

	q, err := parseOperators(qs)
	if err != nil {
		return nil, err
	}

	return Simplify(q), nil
}
69847
func Parse(query string) (*Ast, error) {
	l := lex.NewLexer(query, InfluxQlDialect)
	p := Parser{l: l, qryText: query}
	return p.parse()
}
161493
func (p *Parser) Parse() ([]Revisioner, error) {
	var rev Revisioner
	var revs []Revisioner
	var tok token
	var err error

	for {
		tok, _, err = p.scan()

		if err != nil {
			return nil, err
		}

		switch tok {
		case at:
			rev, err = p.parseAt()
		case tilde:
			rev, err = p.parseTilde()
		case caret:
			rev, err = p.parseCaret()
		case colon:
			rev, err = p.parseColon()
		case eof:
			err = p.validateFullRevision(&revs)

			if err != nil {
				return []Revisioner{}, err
			}

			return revs, nil
		default:
			p.unscan()
			rev, err = p.parseRef()
		}

		if err != nil {
			return []Revisioner{}, err
		}

		revs = append(revs, rev)
	}
}