#! occasionally data needs to be mapped
#! into a set of YAML nodes, in those cases
#! for loops are handy

array:
#@ for j in range(0,4):
- item: #@ j
#@ end

#! similar to ifs, for/end annotations apply only to a single node
array_with_data:
#@ for/end val in [1,5,{"key":"val"}]:
- item: #@ val

array_with_index:
#@ arr = [1,5,{"key":"val"}]
#@ for i in range(len(arr)):
- val: #@ arr[i]
  index: #@ i
#@ end

#! continue and break keywords allow to further
#! control execution of for loop

array_odd:
#@ for j in range(0,10):
#@   if j % 2 == 0:
#@     continue
#@   end
#@   if j > 5:
#@     break
#@   end
- #@ j
#@ end

#! documents can also be produced in a loop

#@ for val in [5,"str",{"key":"val"}]:
--- #@ val
#@ end
