Example:
//The 'ante' keyword declares compile-time values
ante
labels = global mut empty Map
goto lbl =
label = lookup labels lbl ?
None -> Ante.error "Cannot goto undefined label ${lbl}"
Llvm.setInsertPoint (getCallSiteBlock ())
Llvm.createBr label
label name:Str =
callingFn = getParentFn (getCallSiteBlock ())
lbl = Llvm.BasicBlock(Ante.llvm_ctxt, callingFn)
labels#name := lbl
//test it out
label "begin"
print "hello!"
goto "begin"
Last modified 04 November 2020