func()

in parse/parse.go [167:199]


func (p *flagParser) parseValue(stopSet string) (interface{}, error) {
	p.ignoreWhitespace()
	in := p.input

	if in == "" {
		return nil, nil
	}

	switch in[0] {
	case '[':
		if p.cfg.Array {
			return p.parseArray()
		}
		return p.parsePrimitive(stopSet)
	case '{':
		if p.cfg.Object {
			return p.parseObj()
		}
		return p.parsePrimitive(stopSet)
	case '"':
		if p.cfg.StringDQuote {
			return p.parseStringDQuote()
		}
		return p.parsePrimitive(stopSet)
	case '\'':
		if p.cfg.StringSQuote {
			return p.parseStringSQuote()
		}
		return p.parsePrimitive(stopSet)
	default:
		return p.parsePrimitive(stopSet)
	}
}