       length = segment.length
 
       # Store our progress through the collection for the continue flag
-      context.registers["for"][@name] = from + segment.length
+      context.registers["for"][@registerName] = from + segment.length
 
       context.stack =>
         Promise.reduce(segment, (output, item, index) =>
           context.set @variableName, item
           context.set "forloop",
-            name    : @name
+            name    : @registerName
             length  : length
             index   : index + 1
             index0  : index,

      return @renderElse(context) unless collection and collection.forEach

      from = if @attributes.offset == "continue"
        Number(context.registers["for"][@name]) or 0
      else
        Number(@attributes.offset) or 0


    if match
      @variableName = match[1]
      @collectionName = match[2]
      @registerName = "#{match[1]}=#{match[2]}"
      @reversed = match[3]
      @attributes = {}

