mirror of
https://github.com/irmen/prog8.git
synced 2026-04-19 20:16:51 +00:00
gosub only uses an identifier
This commit is contained in:
@@ -135,13 +135,7 @@ class CodeGen(internal val program: PtProgram,
|
||||
|
||||
private fun translate(gosub: PtGosub): VmCodeChunk {
|
||||
val chunk = VmCodeChunk()
|
||||
if(gosub.address!=null)
|
||||
throw AssemblyError("cannot gosub to a memory address in the vm target")
|
||||
else if(gosub.identifier!=null) {
|
||||
chunk += VmCodeOpcodeWithStringArg(Opcode.GOSUB, gosubArg(gosub.identifier!!.targetName))
|
||||
} else if(gosub.generatedLabel!=null) {
|
||||
chunk += VmCodeOpcodeWithStringArg(Opcode.GOSUB, gosubArg(listOf(gosub.generatedLabel!!)))
|
||||
}
|
||||
chunk += VmCodeOpcodeWithStringArg(Opcode.GOSUB, gosubArg(gosub.identifier.targetName))
|
||||
return chunk
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user