// Parse sets the value for optional parse parameter
779813
func (c *ChatUpdateCall) Parse(parse string) *ChatUpdateCall {
	c.parse = parse
	return c
}
790873
func (mf *MultiFlag) Parse(value string) error {
	option, params := parseOptionParams(value)
	if len(option) == 0 {
		return errors.New("Option cannot be empty.")
	}

	mf.Selected = mf.GetOptionFor(option)
	if mf.Selected == nil {
		return fmt.Errorf("Invalid option: %v", option)
	}
	return mf.Selected.Run(params)
}
347320
func Parse(data string) (map[string]interface{}, error) {
	p, err := parse(data, "", false)
	if err != nil {
		return nil, err
	}
	return p.mapping, nil
}
986135
func (p *Parser) Parse(data []byte) (interfaces.Mappable, error) {
	var feed Feed

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

	return feed, nil
}
682065
func (p StringParser) Parse(field string) (result interface{}, err error) {
	return field, nil
}
248036
func (f *Flaeg) Parse(cmd *Command) (*Command, error) {
	if f.calledCommand == nil {
		f.commandArgs = f.args
	}

	if err := LoadWithCommand(cmd, f.commandArgs, f.customParsers, f.commands); err != nil {
		return cmd, err
	}
	return cmd, nil
}
1199124
func Parse(filename string, b []byte, opts ...Option) (interface{}, error) {
	return newParser(filename, b, opts...).parse(g)
}
1069702
func (lp ListParser) Parse(req *http.Request, params imageserver.Params) error {
	for _, subParser := range lp {
		err := subParser.Parse(req, params)
		if err != nil {
			return err
		}
	}
	return nil
}
214157
func (p SeparatorKeyParser) Parse(k string) Key {
	return NewKeySep(k, string(p))
}
1221937
func Parse(v interface{}) ([]string, error) {
	if command, _, err := generateCommand(v, true); err == nil {
		return command, err
	} else {
		return nil, err
	}
}
1167653
func (p *Parser) Parse() error {
	for {
		t, err := p.decoder.Token()
		if err == io.EOF {
			break
		} else if serr, ok := err.(*json.SyntaxError); ok {
			return WithStack(&ParseError{msg: err.Error(), Offset: serr.Offset})
		} else if err != nil {
			return WithStack(&ParseError{msg: err.Error()})
		}
		switch x := t.(type) {
		case nil:
			if err := p.builder.AddValue(NewNullValue()); err != nil {
				return WithStack(err)
			}
		case bool:
			if err := p.builder.AddValue(NewBoolValue(x)); err != nil {
				return WithStack(err)
			}
		case json.Number:
			if xu, err := strconv.ParseUint(string(x), 10, 64); err == nil {
				if err := p.builder.AddValue(NewUIntValue(xu)); err != nil {
					return WithStack(err)
				}
			} else if xi, err := x.Int64(); err == nil {
				if err := p.builder.AddValue(NewIntValue(xi)); err != nil {
					return WithStack(err)
				}
			} else {
				if xf, err := x.Float64(); err == nil {
					if err := p.builder.AddValue(NewDoubleValue(xf)); err != nil {
						return WithStack(err)
					}
				} else {
					return WithStack(&ParseError{msg: err.Error()})
				}
			}
		case string:
			if err := p.builder.AddValue(NewStringValue(x)); err != nil {
				return WithStack(err)
			}
		case json.Delim:
			switch x {
			case '[':
				if err := p.builder.OpenArray(p.options.BuildUnindexedArrays); err != nil {
					return WithStack(err)
				}
			case '{':
				if err := p.builder.OpenObject(p.options.BuildUnindexedObjects); err != nil {
					return WithStack(err)
				}
			case ']', '}':
				if err := p.builder.Close(); err != nil {
					return WithStack(err)
				}
			}
		}
	}
	return nil
}
7505
func (p *Parser) parse() (map[string]string, error) {
	p.scan() // init scannedItems

	labelsMap := map[string]string{}
	for {
		tok, lit := p.lookahead()
		switch tok {
		case IdentifierToken:
			key, value, err := p.parseLabel()
			if err != nil {
				return nil, fmt.Errorf("unable to parse requirement: %v", err)
			}
			labelsMap[key] = value
			t, l := p.consume()
			switch t {
			case EndOfStringToken:
				return labelsMap, nil
			case CommaToken:
				t2, l2 := p.lookahead()
				if t2 != IdentifierToken {
					return nil, fmt.Errorf("found '%s', expected: identifier after ','", l2)
				}
			default:
				return nil, fmt.Errorf("found '%s', expected: ',' or 'end of string'", l)
			}
		case EndOfStringToken:
			return labelsMap, nil
		default:
			return nil, fmt.Errorf("found '%s', expected: identifier or 'end of string'", lit)
		}
	}
}
173824
func Parse(cmd interface{}, opts ...parseOpt) {
	opts = append([]parseOpt{Program(filepath.Base(os.Args[0]))}, opts...)
	ParseArgs(cmd, os.Args[1:], opts...)
}
52530
func (*Bytes) Parse(value string) (i uint64, err error) {
	parts := pattern.FindStringSubmatch(value)
	if len(parts) < 3 {
		return 0, fmt.Errorf("error parsing value=%s", value)
	}
	bytesString := parts[1]
	multiple := parts[2]
	bytes, err := strconv.ParseUint(bytesString, 10, 64)
	if err != nil {
		return
	}

	switch multiple {
	case "B":
		return bytes * B, nil
	case "K", "KB":
		return bytes * KB, nil
	case "M", "MB":
		return bytes * MB, nil
	case "G", "GB":
		return bytes * GB, nil
	case "T", "TB":
		return bytes * TB, nil
	case "P", "PB":
		return bytes * PB, nil
	}

	return
}
1049431
func (parser *TransitionParser) Parse(data []byte, state string) ([]byte, ParserStateID) {
	currentStateID := parser.GetStateID(state)

	if currentStateID == ParserStateStop {
		return nil, currentStateID // ### return, immediate stop ###
	}

	currentState := parser.tokens[currentStateID]
	dataLen := len(data)
	readStartIdx := 0
	continueIdx := 0

	for parseIdx := 0; parseIdx < dataLen; parseIdx++ {
		node := currentState.MatchStart(data[parseIdx:])
		if node == nil {
			continue // ### continue, no match ###
		}

		t := node.Payload.(Transition)
		if t.callback != nil {
			if t.flags&ParserFlagInclude != 0 {
				t.callback(data[readStartIdx:parseIdx+node.PathLen], currentStateID)
			} else {
				t.callback(data[readStartIdx:parseIdx], currentStateID)
			}
		}

		// Move the reader
		if t.flags&ParserFlagContinue == 0 {
			parseIdx += node.PathLen - 1
		} else {
			parseIdx--
		}
		continueIdx = parseIdx + 1

		if t.flags&ParserFlagAppend == 0 {
			readStartIdx = continueIdx
		}

		nextStateID := t.nextState

		// Pop before push to allow both at the same time
		if t.flags&ParserFlagPop != 0 {
			stackLen := len(parser.stack)
			if stackLen > 0 {
				nextStateID = parser.stack[stackLen-1]
				parser.stack = parser.stack[:stackLen-1]
			}
		}

		if t.flags&ParserFlagPush != 0 {
			parser.stack = append(parser.stack, currentStateID)
		}

		// Transition to next
		currentStateID = nextStateID
		if currentStateID == ParserStateStop {
			break // ### break, stop state ###
		}

		currentState = parser.tokens[currentStateID]
	}

	if readStartIdx == dataLen {
		return nil, currentStateID // ### return, everything parsed ###
	}

	return data[readStartIdx:], currentStateID
}
1083139
func (p FloatParser) Parse(field string) (result interface{}, err error) {
	return strconv.ParseFloat(field, 64)
}
640088
func (c *commonFlags) Parse() error {
	if err := c.defaultFlags.Parse(); err != nil {
		return err
	}
	if c.serverURL == "" {
		return errors.Reason("must provide -server").Err()
	}
	s, err := lhttp.CheckURL(c.serverURL)
	if err != nil {
		return err
	}
	c.serverURL = s
	c.parsedAuthOpts, err = c.authFlags.Options()
	return err
}