 # Pattern matching utilities
 matchNode = (pattern, node, match) ->
   if pattern instanceof MatchCapture
-      match[pattern.name] = node
-      matchNode(pattern.subpattern, node, match) if pattern.subpattern?
+    match[pattern.name] = node
+    matchNode(pattern.subpattern, node, match) if pattern.subpattern
+
+  else if pattern instanceof AnyMatch
+    return yes
 
   else if pattern instanceof Base
     throw "match failed" unless node instanceof pattern.constructor

        ({mname, mLabels, mNames, bodyExprs}) =>
          mname.warn "named modules not supported; name is being ignored" if mname

          requires = for [iport, param] in underscore.zip(mLabels, mNames)
            "import #{param.name.compile o} = require(#{iport.compile o})"
          bodyExprs.unshift new Literal requires.join ";\n"

          # assuming no weirder control flow, and last line is what's exported
          eport = bodyExprs.pop()
          bodyExprs.push new Literal "export = #{eport.compile o}"

          @expressions[node_i] = bodyExprs
      ]

class MatchCapture extends Base
  constructor: (@name, @subpattern) ->
  toString: -> "M(#{@name})"
exports.M = M = (args...) -> new MatchCapture(args...)

class AnyMatch extends Base
  toString: -> " any"
exports.any = any = new AnyMatch()

#### utilities

