code: func (m *matcher) computeNext(d *dstate, c int) *dstate {
  	this, next := &m.z1, &m.z2
  	this.dec(d.enc)
  
  	// compute flags in effect before c
  	flag := syntax.EmptyOp(0)
  	if this.flag&flagBOL != 0 {
  		flag |= syntax.EmptyBeginLine
  	}
  	if this.flag&flagBOT != 0 {
  		flag |= syntax.EmptyBeginText
  	}
  	if this.flag&flagWord != 0 {
  		if !isWordByte(c) {
  			flag |= syntax.EmptyWordBoundary
  		} else {
  			flag |= syntax.EmptyNoWordBoundary
  		}
  	} else {
  		if isWordByte(c) {
  			flag |= syntax.EmptyWordBoundary
  		} else {
  			flag |= syntax.EmptyNoWordBoundary
  		}
  	}
  	if c == '\n' {
  		flag |= syntax.EmptyEndLine
  	}
  	if c == endText {
  		flag |= syntax.EmptyEndLine | syntax.EmptyEndText
  	}
  
  	// re-expand queue using new flags.
  	// TODO: only do this when it matters
  	// (something is gating on word boundaries).
  	m.stepEmpty(&this.q, &next.q, flag)
  	this, next = next, this
  
  	// now compute flags after c.
  	flag = 0
  	next.flag = 0
  	if c == '\n' {
  		flag |= syntax.EmptyBeginLine
  		next.flag |= flagBOL
  	}
  	if isWordByte(c) {
  		next.flag |= flagWord
  	}
  
  	// re-add start, process rune + expand according to flags.
  	if m.stepByte(&this.q, &next.q, c, flag) {
  		return &dmatch
  	}
  	return m.cache(next)
  }
docs: // computeNext computes the next DFA state if we're in d reading c (an input byte or endText).