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 ( "fmt"
"git.urbach.dev/cli/q/src/expression" "git.urbach.dev/cli/q/src/token")
// parseLoopHeader parses the loop header.func (f *Function) parseLoopHeader(head *expression.Expression) (name string, from *expression.Expression, to *expression.Expression) { switch head.Token.Kind { case token.Define: name = head.Children[0].String(f.File.Bytes) right := head.Children[1] from = right.Children[0] to = right.Children[1] case token.Range: name = fmt.Sprintf("loop.counter.%d", f.Count.Loop) from = head.Children[0] to = head.Children[1] }
return}