Codebase list libmawk / 30b66529-447f-407d-a34b-b48ac0e29c37/upstream scconfig / src / tmpasm / regression / foreach.gasm
30b66529-447f-407d-a34b-b48ac0e29c37/upstream

Tree @30b66529-447f-407d-a34b-b48ac0e29c37/upstream (Download .tar.gz)

foreach.gasm @30b66529-447f-407d-a34b-b48ac0e29c37/upstreamraw · 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