MCPcopy
hub / github.com/tinylib/msgp / rangeBlock

Method rangeBlock

gen/spec.go:487–496  ·  view source on GitHub ↗

does: for idx := range iter { {{generate inner}} }

(ctx *Context, idx string, iter string, t traversal, inner Elem)

Source from the content-addressed store, hash-verified

485// {{generate inner}}
486// }
487func (p *printer) rangeBlock(ctx *Context, idx string, iter string, t traversal, inner Elem) {
488 ctx.PushVar(idx)
489 // Tags on slices do not extend to the elements, so we always disable allownil on elements.
490 // If we want this to happen in the future, it should be a unique tag.
491 inner.SetIsAllowNil(false)
492 p.printf("\n for %s := range %s {", idx, iter)
493 next(t, inner)
494 p.closeblock()
495 ctx.Pop()
496}
497
498func (p *printer) nakedReturn() {
499 if p.ok() {

Callers 10

gSliceMethod · 0.80
gArrayMethod · 0.80
gArrayMethod · 0.80
gSliceMethod · 0.80
gSliceMethod · 0.80
gArrayMethod · 0.80
gSliceMethod · 0.80
gArrayMethod · 0.80
gSliceMethod · 0.80
gArrayMethod · 0.80

Calls 6

printfMethod · 0.95
closeblockMethod · 0.95
nextFunction · 0.85
PushVarMethod · 0.80
PopMethod · 0.80
SetIsAllowNilMethod · 0.65

Tested by

no test coverage detected