code: func (p *parser) parseName() (result string, err error) {
  	i := p.i
  loop:
  	for i < len(p.s) {
  		c := p.s[i]
  		switch {
  		case nameChar(c):
  			start := i
  			for i < len(p.s) && nameChar(p.s[i]) {
  				i++
  			}
  			result += p.s[start:i]
  		case c == '\\':
  			p.i = i
  			val, err := p.parseEscape()
  			if err != nil {
  				return "", err
  			}
  			i = p.i
  			result += val
  		default:
  			break loop
  		}
  	}
  
  	if result == "" {
  		return "", errors.New("expected name, found EOF instead")
  	}
  
  	p.i = i
  	return result, nil
  }
docs: // parseName parses a name (which is like an identifier, but doesn't have
  // extra restrictions on the first character).