code: func (p *parser) parseEscape() (result string, err error) {
  	if len(p.s) < p.i+2 || p.s[p.i] != '\\' {
  		return "", errors.New("invalid escape sequence")
  	}
  
  	start := p.i + 1
  	c := p.s[start]
  	switch {
  	case c == '\r' || c == '\n' || c == '\f':
  		return "", errors.New("escaped line ending outside string")
  	case hexDigit(c):
  		// unicode escape (hex)
  		var i int
  		for i = start; i < p.i+6 && i < len(p.s) && hexDigit(p.s[i]); i++ {
  			// empty
  		}
  		v, _ := strconv.ParseUint(p.s[start:i], 16, 21)
  		if len(p.s) > i {
  			switch p.s[i] {
  			case '\r':
  				i++
  				if len(p.s) > i && p.s[i] == '\n' {
  					i++
  				}
  			case ' ', '\t', '\n', '\f':
  				i++
  			}
  		}
  		p.i = i
  		return string(rune(v)), nil
  	}
  
  	// Return the literal character after the backslash.
  	result = p.s[start : start+1]
  	p.i += 2
  	return result, nil
  }
docs: // parseEscape parses a backslash escape.