code: func appendRange(r []rune, lo, hi rune) []rune {
  	// Expand last range or next to last range if it overlaps or abuts.
  	// Checking two ranges helps when appending case-folded
  	// alphabets, so that one range can be expanding A-Z and the
  	// other expanding a-z.
  	n := len(r)
  	for i := 2; i <= 4; i += 2 { // twice, using i=2, i=4
  		if n >= i {
  			rlo, rhi := r[n-i], r[n-i+1]
  			if lo <= rhi+1 && rlo <= hi+1 {
  				if lo < rlo {
  					r[n-i] = lo
  				}
  				if hi > rhi {
  					r[n-i+1] = hi
  				}
  				return r
  			}
  		}
  	}
  
  	return append(r, lo, hi)
  }
docs: // appendRange returns the result of appending the range lo-hi to the class r.