           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(",")}] = []"

    constructor: (props = {}) ->

    parse: (tokens) ->
      declared = ['require', 'console', 'module', 'process']
      snippets = []

      indent = (code, depth) ->


    getVariableNames: (code) ->
      tokens = require("coffee-script").tokens(code)

      reduceFn = (vars, token) ->
        [type, value] = token
        return vars unless type is "IDENTIFIER" and token.variable
        return vars unless vars.indexOf(value) is -1
        vars.concat value

      tokens.reduce reduceFn, []

    convert: (tokens) ->
      currentDepth = 0
