           vars = []
 
           token.vars.forEach (v) ->
-            vars.push v unless (v in vars or v in declared)
-            declared.push v unless v in declared
+            vars.push v unless isDeclared v, token.depth
+            declareVar v, token.depth
 
           return if vars.length is 0
           code = "[#{vars.join(",")}] = []"


    getVariableNames: (code) ->
      tokens = require("coffee-script").tokens(code)
      tokens = tokens.filter (token) ->
        token[0] is "IDENTIFIER" and token.variable
      tokens.map (token) -> token[1]

    convert: (tokens) ->
      currentDepth = 0

    constructor: (props = {}) ->

    parse: (tokens) ->
      # two dimensional array, first dimension representing depth at which vars defined
      declared = [
        ['require', 'console', 'module', 'process']
      ]
      snippets = []

      indent = (code, depth) ->
