Something went wrong. Try again.
🌱 A minimal programming language and compiler. git.urbach.dev/cli/q
high-performance programming-language compiler
Something went wrong. Try again.
12345678910111213141516171819202122232425package core
// loopStack remembers all active loops during compilation.type loopStack struct { loops []*Loop}
// Current returns the innermost loop or nil if there is none.func (s *loopStack) Current() *Loop { if len(s.loops) == 0 { return nil }
return s.loops[len(s.loops)-1]}
// Pop removes an element from the stack.func (s *loopStack) Pop() { s.loops = s.loops[:len(s.loops)-1]}
// Push pushes a new element to the stack.func (s *loopStack) Push(loop *Loop) { s.loops = append(s.loops, loop)}