code: func (l *absurllexer) replace() {
  	contentLength := len(l.content)
  
  	prefixes := newPrefixState()
  
  	for {
  		if l.pos >= contentLength {
  			break
  		}
  
  		nextPos := -1
  
  		var match *prefix
  
  		for _, p := range prefixes {
  			if p.disabled {
  				continue
  			}
  			idx := bytes.Index(l.content[l.pos:], p.b)
  
  			if idx == -1 {
  				p.disabled = true
  				// Find the closest match
  			} else if nextPos == -1 || idx < nextPos {
  				nextPos = idx
  				match = p
  			}
  		}
  
  		if nextPos == -1 {
  			// Done!
  			l.pos = contentLength
  			break
  		} else {
  			l.pos += nextPos + len(match.b)
  			match.f(l)
  		}
  	}
  
  	// Done!
  	if l.pos > l.start {
  		l.emit()
  	}
  }
docs: // main loop