 # being requested by the surrounding function), information about the current
 # scope, and indentation level.
 exports.Base = class Base
+
+  # hack for .match
+  @isNodeClass: yes
 
   compile: (o, lvl) ->
     fragmentsToText @compileToFragments o, lvl

  matchedAttributes: []

# Pattern matching utilities
exports.matchNode = matchNode = (pattern, node, match) ->
  if pattern instanceof MatchCapture
    match[pattern.name] = node

      return no if e == "match failed"
      throw e

  # a pattern *must* be a node or node class at outermost
  match: (parts) ->
    for pattern, i in parts when isMatchPattern pattern
      if captures = @isa pattern
        for fn in parts[i+1..] when not isMatchPattern fn
          return fn(captures)
        return no  # pattern followed by no functions

