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
import ( "git.urbach.dev/cli/q/src/ssa" "git.urbach.dev/cli/q/src/token")
// loopNext starts the next iteration of the loop.func (f *Function) loopNext(loop *Loop) { if loop.IteratorName != "" { endOfLoopValue, _, _ := f.findIdentifier(loop.IteratorName) one := f.Append(&ssa.Int{Int: 1})
nextIteration := &ssa.BinaryOp{ Op: token.Add, Left: endOfLoopValue, Right: one, }
f.Block().Append(nextIteration) f.Block().Identify(loop.IteratorName, nextIteration) }
f.jump(loop.Head)}