 
 module.exports = class MistResolver
   constructor: (@rootDir, @rootMist)->
-    @groupSubs = {}
     @groupRefs = {}
 
     @setupTargets()

      outputs: rule.templates.outputs.map processor
      auxOutputs: rule.templates.auxOutputs.map processor

    for group in rule.src.groups
      for output in rule.targets[input].outputs
        @emitGroupOutput group, output

###
# Make sure to always include `$1` in the replacement

        throw "unknown template type: #{input.type}"

  generateTargets: ->
    groupSubs = {}
    for rule in @rootMist.rules
      for input in rule.src.inputs
        if input.type is 'group'
          (groupSubs[input.value] = groupSubs[input.value] || []).push rule

    for rule in @rootMist.rules
      for input in rule.src.inputs
        switch input.type
          when 'glob'
            results = Globber.performGlob input.value, @rootDir
            for result in results
              @processInput rule, result, null, groupSubs
          when 'group' then break
          else
            throw "unknown input type: #{input.type}"

  processInput: (rule, input, group, groupSubs = {})->
    return if input of rule.targets

    processor = (fn)->
