Codebase list libmawk / 1df34837-a1d9-4cbd-a796-a1f5ebe673fc/main scconfig / src / tmpasm / regression / foreach.gasm
1df34837-a1d9-4cbd-a796-a1f5ebe673fc/main

Tree @1df34837-a1d9-4cbd-a796-a1f5ebe673fc/main (Download .tar.gz)

foreach.gasm @1df34837-a1d9-4cbd-a796-a1f5ebe673fc/mainraw · history · blame

put a {1}
put foo {example-FOO}
put bar {example-BAR}
put baz {example-BAZ}
put hah {haha}

# should set n to the string foo, the value of bar and the string baz
# per iteration
foreach n in [~foo ~bar~ baz~]
	print {n=} n {\n}
	print {a11} [@a12 @hah@ a14@] {\n}
	print {a21} {a22 a23} {\n}
	print {a31\n}
end
print {a41} {a42} {a43} {\n}
print