##
6.5 #slurp

The template:

      #for $i in range(5)
      $i
      #end for
      #for $i in range(5)
      $i #slurp
      #end for
      Line after slurp.

The output:

      0
      1
      2
      3
      4
      0 1 2 3 4 Line after slurp.

The generated code:

      for i in range(5):
          write(filter(i)) # generated from '$i' at line 2, col 1.
          write('\n')
      for i in range(5):
          write(filter(i)) # generated from '$i' at line 5, col 1.
          write(' ')
      write('Line after slurp.\n')

The space after each number is because of the space before `#slurp` in the template definition.