MCPcopy
hub / github.com/google/go-jsonnet / tailCallTrimStack

Method tailCallTrimStack

interpreter.go:132–144  ·  view source on GitHub ↗

** If there is a trimmable frame followed by some locals, pop them all. */

()

Source from the content-addressed store, hash-verified

130
131/** If there is a trimmable frame followed by some locals, pop them all. */
132func (s *callStack) tailCallTrimStack() {
133 for i := len(s.stack) - 1; i >= 0; i-- {
134 if s.stack[i].cleanEnv {
135 if !s.stack[i].trimmable {
136 return
137 }
138 // Remove this stack frame and everything above it
139 s.stack = s.stack[:i]
140 s.calls--
141 return
142 }
143 }
144}
145
146func (s *callStack) setCurrentTrace(trace traceElement) {
147 if s.currentTrace != (traceElement{}) {

Callers 1

evaluateTailCallMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected