       type: token.string
       parameters: []
 
+
     while nextToken = pathTokens[i+1]
       if nextToken.type == NUMBER
         command.parameters.push(parseFloat(nextToken.string))


    node

  for i in [0...groupedCommands.length]
    command = groupedCommands[i]
    switch command.type
      when 'M'
        # Move to
        currentPoint = command.parameters
        addNewSubpath(currentPoint)

      when 'L', 'l'

          params = params.slice(1)
        createNode([currentPoint[0], params[0]], i)

      when 'C', 'c'
        # Bezier
        setSize = 6
        isRelative = command.type == 'c'
        iterateOverParameterSets command, setSize, isRelative, (paramSet) ->
          currentPoint = slicePoint(paramSet, 4)
          handleIn = slicePoint(paramSet, 2)
          handleOut = slicePoint(paramSet, 0)

          lastNode = currentSubpath.nodes[currentSubpath.nodes.length - 1]
          lastNode.setAbsoluteHandleOut(handleOut)

          if node = createNode(currentPoint, i)
            node.setAbsoluteHandleIn(handleIn)
          else
            firstNode = currentSubpath.nodes[0]
            firstNode.setAbsoluteHandleIn(handleIn)

      when 'Q', 'q'
        # Bezier
        setSize = 4
        isRelative = command.type == 'q'
        iterateOverParameterSets command, setSize, isRelative, (paramSet) ->
          currentPoint = slicePoint(paramSet, 2)
          handleIn = handleOut = slicePoint(paramSet, 0)

          lastNode = currentSubpath.nodes[currentSubpath.nodes.length - 1]
          lastNode.setAbsoluteHandleOut(handleOut)

          if node = createNode(currentPoint, i)
            node.setAbsoluteHandleIn(handleIn)
          else
            firstNode = currentSubpath.nodes[0]
            firstNode.setAbsoluteHandleIn(handleIn)

      when 'S', 's'
        # Shorthand cubic bezier.
        # Infer last node's handleOut to be a mirror of its handleIn.
        setSize = 4
        isRelative = command.type == 's'
        iterateOverParameterSets command, setSize, isRelative, (paramSet) ->
          currentPoint = slicePoint(paramSet, 2)
          handleIn = slicePoint(paramSet, 0)

          lastNode = currentSubpath.nodes[currentSubpath.nodes.length - 1]
          lastNode.join('handleIn')

          if node = createNode(currentPoint, i)
            node.setAbsoluteHandleIn(handleIn)
          else
            firstNode = currentSubpath.nodes[0]
            firstNode.setAbsoluteHandleIn(handleIn)

      when 'T', 't'
        # Shorthand quadradic bezier.
        # Infer node's handles based on previous node's handles
        setSize = 2
        isRelative = command.type == 'q'
        iterateOverParameterSets command, setSize, isRelative, (paramSet) ->
          currentPoint = slicePoint(paramSet, 0)

          lastNode = currentSubpath.nodes[currentSubpath.nodes.length - 1]
          lastNode.join('handleIn')

          # Use the handle out from the previous node.
          # TODO: Should check if the last node was a Q command...
          # https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#Bezier_Curves
          handleIn = lastNode.getAbsoluteHandleOut()

          if node = createNode(currentPoint, i)
            node.setAbsoluteHandleIn(handleIn)
          else
            firstNode = currentSubpath.nodes[0]
            firstNode.setAbsoluteHandleIn(handleIn)

      when 'Z', 'z'
        currentSubpath.closed = true
