Codebase list libmawk / run/a44f9aae-d910-4cd9-a598-4b5026f2a2f5/main scconfig / src / tmpasm / regression / Tutor12_halt.gasm
run/a44f9aae-d910-4cd9-a598-4b5026f2a2f5/main

Tree @run/a44f9aae-d910-4cd9-a598-4b5026f2a2f5/main (Download .tar.gz)

Tutor12_halt.gasm @run/a44f9aae-d910-4cd9-a598-4b5026f2a2f5/mainraw · history · blame

# Instruction "halt" breaks the execution of the current script file
# (returning from the C call to tmpasm() or stop processing an "include",
# returning to executing the parent script). It is useful for cheap
# termination of the script file from deep inside nested loops/ifs.

put tmp {true}
if tmp then
	foreach item in {foo bar true baz}
		print item {\n}
		if item then
			halt
		end
	end
end