         ref = scope.freeVariable 'ref'
         sourcePart = "#{ref} = #{svar};"
         svar = ref
-      if @pattern
-        namePart  = new AssignNode(@name, literal("#{svar}[#{ivar}]")).compile(merge o, {indent: @idt(1), top: true, keepLevel: yes}) + '\n'
-      else
-        namePart  = "#{name} = #{svar}[#{ivar}]" if name
+      namePart = if @pattern
+        new AssignNode(@name, literal "#{svar}[#{ivar}]").compile merge o, top: on
+      else if name
+        "#{name} = #{svar}[#{ivar}]"
       unless @object
         lvar      = scope.freeVariable 'len'
         stepPart  = if @step then "#{ivar} += #{ @step.compile(o) }" else "#{ivar}++"

    varPart       = ''
    guardPart     = ''
    body          = Expressions.wrap([@body])
    if range
      sourcePart  = source.compileVariables(o)
      forPart     = source.compile merge o, index: ivar, step: @step

    sourcePart    = (if rvar then "#{rvar} = []; " else '') + sourcePart
    sourcePart    = if sourcePart then "#{@tab}#{sourcePart}\n#{@tab}" else @tab
    returnResult  = @compileReturnValue(rvar, o)
    body          = PushNode.wrap(rvar, body) unless topLevel
    if @guard
      body        = Expressions.wrap([new IfNode(@guard, body)])
