Codebase list libmawk / 0718135d-034f-4c7d-a50d-81acb9b0d835/main scconfig / src / tmpasm / regression / foreach.gasm
0718135d-034f-4c7d-a50d-81acb9b0d835/main

Tree @0718135d-034f-4c7d-a50d-81acb9b0d835/main (Download .tar.gz)

foreach.gasm @0718135d-034f-4c7d-a50d-81acb9b0d835/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