                 else
                   child = el
             if ok
-              @mark child, prefix, depth, true, rules, context, wrap ? node
+              @mark child, prefix, depth, true, rules, context, wrap ? node, wrapRules ? rules
               return
 
             else

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

            @addBlock
              bounds: bounds
              depth: depth + 1
              color: @getColor node, rules
              classes: rules.concat(if context? then @getDropType(context) else @getShape(node, rules))
              parseContext: rules[0] #(if wrap? then wrap.type else rules[0])

          when 'parens'



    # 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..])
