(body string, prim It, primOffset int, ranges []It)
| 212 | } |
| 213 | |
| 214 | func (ctx *NaiveFile) specializeCounterAccess(body string, prim It, primOffset int, ranges []It) string { |
| 215 | return rxVariable.ReplaceAllStringFunc(body, func(ref string) string { |
| 216 | ref = ref[1:] |
| 217 | |
| 218 | for _, it := range ranges { |
| 219 | if it.Name == ref { |
| 220 | at := it.Name + "[i" + it.Name |
| 221 | if primOffset > 0 { |
| 222 | at += "+" + mul(Const(primOffset), it.Inc).String() |
| 223 | } |
| 224 | at += "]" |
| 225 | return at |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | panic("did not find " + ref) |
| 230 | }) |
| 231 | } |
| 232 | |
| 233 | func (ctx *NaiveFile) specializePointerAccess(body string, prim It, primOffset int, ranges []It) string { |
| 234 | return rxVariable.ReplaceAllStringFunc(body, func(ref string) string { |
no test coverage detected