               bounds: bounds
               depth: depth
               prefix: prefix[oldPrefix.length...prefix.length]
-              classes: rules
+              classes: padRules(wrapRules ? rules)
               parseContext: @applyRule(config.RULES[node.type], node).indentContext
 
         for child in node.children

          @addSocket
            bounds: node.bounds
            depth: depth
            classes: rules
            parseContext: rules[0] #(if wrap? then wrap.type else rules[0])

  TreewalkParser.drop = (block, context, pred) ->
    if context.type is 'socket'
      if '__comment__' in context.classes
        return helper.DISCOURAGE
      for c in context.classes
        if c in block.classes
          return helper.ENCOURAGE

        # Check to see if we could paren-wrap this
        if config.PAREN_RULES? and c of config.PAREN_RULES
          for m in block.classes
            if m of config.PAREN_RULES[c]
              return helper.ENCOURAGE
      return helper.DISCOURAGE

    else if context.type is 'indent'
      console.log context.parseContext, block.classes
      if '__comment__' in block.classes
        return helper.ENCOURAGE

      if context.parseContext in block.classes
        return helper.ENCOURAGE

      return helper.DISCOURAGE

    else if context.type is 'document'
      if '__comment__' in block.classes
        return helper.ENCOURAGE

      if 'externalDeclaration' in block.classes or
         'translationUnit' in block.classes
        return helper.ENCOURAGE

      return helper.DISCOURAGE



    # If we already match types, we're fine
    for c in parseClasses(context)
      if c in parseClasses(node)
        return

    # Otherwise, wrap according to the provided rule
    for c in parseClasses(context) when c of config.PAREN_RULES
      for m in parseClasses(node) when m of config.PAREN_RULES[c]
        return config.PAREN_RULES[c][m] leading, trailing, node, context

  return TreewalkParser

PARSE_PREFIX = "_parse_"
padRules = (rules) -> rules.map (x) -> "#{PARSE_PREFIX}#{x}"
parseClasses = (node) -> node.classes.filter((x) -> x[...PARSE_PREFIX.length] is PARSE_PREFIX).map((x) -> x[PARSE_PREFIX.length..])
