// Parse parses a string, and returns a completed Config
330333
func Parse(name string, text string) (*Config, error) {
	p := &parser{name: name, text: text}
	err := p.parse()
	if err != nil {
		return nil, err
	}
	return p.config, nil
}
1364037
func (p TimeParser) Parse(field string) (result interface{}, err error) {
	return time.Parse(p.Layout, field)
}
1111785
func Parse(value string) (time.Time, error) {
	for _, ds := range allDateStrings {
		if ds.Match(value) {
			return ds.Parse(value)
		}
	}
	return time.Time{}, &UnknownDateFormatError{value}
}
413873
func parse(input string) ([]*SSHHost, error) {
	sshConfigs := []*SSHHost{}
	var next item
	var sshHost *SSHHost

	lexer := lex(input)
Loop:
	for {
		token := lexer.nextItem()

		if sshHost == nil && token.typ != itemHost {
			return nil, fmt.Errorf("config variable before Host variable")
		}

		switch token.typ {
		case itemHost:
			if sshHost != nil {
				sshConfigs = append(sshConfigs, sshHost)
			}

			sshHost = &SSHHost{Host: []string{}, Port: 22}
		case itemHostValue:
			sshHost.Host = strings.Split(token.val, " ")
		case itemHostName:
			next = lexer.nextItem()
			if next.typ != itemValue {
				return nil, fmt.Errorf(next.val)
			}
			sshHost.HostName = next.val
		case itemUser:
			next = lexer.nextItem()
			if next.typ != itemValue {
				return nil, fmt.Errorf(next.val)
			}
			sshHost.User = next.val
		case itemPort:
			next = lexer.nextItem()
			if next.typ != itemValue {
				return nil, fmt.Errorf(next.val)
			}
			port, err := strconv.Atoi(next.val)
			if err != nil {
				return nil, err
			}
			sshHost.Port = port
		case itemProxyCommand:
			next = lexer.nextItem()
			if next.typ != itemValue {
				return nil, fmt.Errorf(next.val)
			}
			sshHost.ProxyCommand = next.val
		case itemHostKeyAlgorithms:
			next = lexer.nextItem()
			if next.typ != itemValue {
				return nil, fmt.Errorf(next.val)
			}
			sshHost.HostKeyAlgorithms = next.val
		case itemIdentityFile:
			next = lexer.nextItem()
			if next.typ != itemValue {
				return nil, fmt.Errorf(next.val)
			}
			sshHost.IdentityFile = next.val
		case itemError:
			return nil, fmt.Errorf("%s at pos %d", token.val, token.pos)
		case itemEOF:
			if sshHost != nil {
				sshConfigs = append(sshConfigs, sshHost)
			}
			break Loop
		default:
			// continue onwards
		}
	}
	return sshConfigs, nil
}
1151408
func (l *Parser) Parse() int {
	// init
	l.Lexer.Errors = nil
	l.rootNode = nil
	l.positionBuilder = &parser.PositionBuilder{}

	// parse

	return yyParse(l)
}
514080
func Parse(err string) *Error {
	e := new(Error)
	errr := json.Unmarshal([]byte(err), e)
	if errr != nil {
		e.Detail = err
	}
	return e
}
735299
func Parse(md metadata.MD) interface{} {
	if parser == nil {
		return nil
	}
	return parser.Parse(md)
}
259640
func (ini *INI) Parse(data []byte, lineSep, kvSep string) error {
    return ini.parseINI(data, lineSep, kvSep)
}
666003
func Parse(input string) (*Template, error) {
	moot.Lock()
	defer moot.Unlock()
	if t, ok := cache[input]; ok {
		return t, nil
	}
	t, err := NewTemplate(input)

	if err == nil {
		cache[input] = t
	}

	if err != nil {
		return t, errors.WithStack(err)
	}

	return t, nil
}
393985
func Parse(data []byte) (*Config, error) {
	v := struct {
		Image     string
		Build     *Build
		Workspace *Workspace
		Services  containerList
		Pipeline  containerList
		Networks  networkList
		Volumes   volumeList
	}{}

	err := yaml.Unmarshal(data, &v)
	if err != nil {
		return nil, err
	}

	for _, c := range v.Services.containers {
		c.Detached = true
	}

	return &Config{
		Image:     v.Image,
		Build:     v.Build,
		Workspace: v.Workspace,
		Services:  v.Services.containers,
		Pipeline:  v.Pipeline.containers,
		Networks:  v.Networks.networks,
		Volumes:   v.Volumes.volumes,
	}, nil
}
694224
func Parse(cfg API, reader io.Reader, bufSize int) *Iterator {
	return &Iterator{
		cfg:    cfg.(*frozenConfig),
		reader: reader,
		buf:    make([]byte, bufSize),
		head:   0,
		tail:   0,
	}
}
682065
func (p StringParser) Parse(field string) (result interface{}, err error) {
	return field, nil
}
726849
func Parse(raw []byte) (types_exp.Config, report.Report, error) {
	if len(raw) == 0 {
		return types_exp.Config{}, report.Report{}, errors.ErrEmpty
	}

	stub := versionStub{}
	rpt, err := util.HandleParseErrors(raw, &stub)
	if err != nil {
		return types_exp.Config{}, rpt, err
	}

	version, err := semver.NewVersion(stub.Ignition.Version)
	if err != nil {
		return types_exp.Config{}, report.Report{}, errors.ErrInvalidVersion
	}

	switch *version {
	case types_exp.MaxVersion:
		return v3_1_experimental.Parse(raw)
	case types_3_0.MaxVersion:
		return from3_0(v3_0.Parse(raw))
	default:
		return types_exp.Config{}, report.Report{}, errors.ErrUnknownVersion
	}
}
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)
}
911263
func Parse(s string) UUID {
	gu, err := guuid.Parse(s)
	if err == nil {
		return gu[:]
	}
	return nil
}
599461
func (c *Configure) Parse() {
	c.setup()
	for _, opt := range c.options {
		changed := false
		for _, checker := range c.stack {
			switch opt.typ {
			case stringType:
				s, err := checker.String(opt.name)
				if err != nil {
					continue
				}

				opt.set(s)
			case intType:
				i, err := checker.Int(opt.name)
				if err != nil {
					continue
				}

				opt.set(i)
			case boolType:
				b, err := checker.Bool(opt.name)
				if err != nil {
					continue
				}

				opt.set(b)
			}

			changed = true
			break
		}

		if !changed {
			opt.set(opt.def)
		}
	}
}
298492
func Parse(args ...string) (Value, error) {
	v, _, err := ParseWithAliases(args...)
	return v, err
}