// ByGroups emits a token for each matching group in the rule's regex.
ByGroups emits a token for each matching group in the rule's regex.
// ByGroups emits a token for each matching group in the rule ' s regex .
func ByGroups(emitters ...Emitter) Emitter {
	return EmitterFunc(func(groups []string, lexer Lexer) Iterator {
		iterators := make([]Iterator, 0, len(groups)-1)
		for i, group := range groups[1:] {
			iterators = append(iterators, emitters[i].Emit([]string{group}, lexer))
		}
		return Concaterator(iterators...)
	})
}
func ByGroups ( emitters ... Emitter ) Emitter { return EmitterFunc ( func ( groups [ ] string , lexer Lexer ) Iterator { iterators := make ( [ ] Iterator , 0 , len ( groups ) - 1 ) for i , group := range groups [ 1 : ] { iterators = append ( iterators , emitters [ i ] . Emit ( [ ] string { group } , lexer ) ) } return Concaterator ( iterators ... ) } ) }
ByGroups emits a token for each matching group in the rule's regex.
ByGroups emits a token for each matching group in the rule ' s regex .
// NOTE: If this panics, there is a mismatch with groups