MCPcopy Create free account
hub / github.com/despiteallobjections/amigo / processDelayed

Method processDelayed

types/check.go:373–396  ·  view source on GitHub ↗

processDelayed processes all delayed actions pushed after top.

(top int)

Source from the content-addressed store, hash-verified

371
372// processDelayed processes all delayed actions pushed after top.
373func (check *Checker) processDelayed(top int) {
374 // If each delayed action pushes a new action, the
375 // stack will continue to grow during this loop.
376 // However, it is only processing functions (which
377 // are processed in a delayed fashion) that may
378 // add more actions (such as nested functions), so
379 // this is a sufficiently bounded process.
380 for i := top; i < len(check.delayed); i++ {
381 a := &check.delayed[i]
382 if check.conf.Trace {
383 if a.desc != nil {
384 check.trace(a.desc.pos.Pos(), "-- "+a.desc.format, a.desc.args...)
385 } else {
386 check.trace(nopos, "-- delayed %p", a.f)
387 }
388 }
389 a.f() // may append to check.delayed
390 if check.conf.Trace {
391 fmt.Println()
392 }
393 }
394 assert(top <= len(check.delayed)) // stack must not have shrunk
395 check.delayed = check.delayed[:top]
396}
397
398// cleanup runs cleanup for all collected cleaners.
399func (check *Checker) cleanup() {

Callers 5

shortVarDeclMethod · 0.95
declStmtMethod · 0.95
checkFilesMethod · 0.95
CheckExprFunction · 0.95
stmtMethod · 0.95

Calls 4

traceMethod · 0.95
assertFunction · 0.70
PosMethod · 0.65
fMethod · 0.65

Tested by

no test coverage detected