Home | History | Annotate | Download | only in strings

Lines Matching full:oldnew

23 func NewReplacer(oldnew ...string) *Replacer {
24 if len(oldnew)%2 == 1 {
28 if len(oldnew) == 2 && len(oldnew[0]) > 1 {
29 return &Replacer{r: makeSingleStringReplacer(oldnew[0], oldnew[1])}
33 for i := 0; i < len(oldnew); i += 2 {
34 if len(oldnew[i]) != 1 {
35 return &Replacer{r: makeGenericReplacer(oldnew)}
37 if len(oldnew[i+1]) != 1 {
49 for i := len(oldnew) - 2; i >= 0; i -= 2 {
50 o := oldnew[i][0]
51 n := oldnew[i+1][0]
60 for i := len(oldnew) - 2; i >= 0; i -= 2 {
61 o := oldnew[i][0]
62 n := oldnew[i+1]
240 func makeGenericReplacer(oldnew []string) *genericReplacer {
243 for i := 0; i < len(oldnew); i += 2 {
244 key := oldnew[i]
266 for i := 0; i < len(oldnew); i += 2 {
267 r.root.add(oldnew[i], oldnew[i+1], len(oldnew)-i, r)