             node_name = null
 
             # **task** definitions in Cakefiles
-            if @isCakefile and
+            if @config.isCakefile and
                     node instanceof Nodes.Call and
                     name_from_value(node.variable)?[0] is 'task' and
                     (arg = node.args[0]) instanceof Nodes.Value and

                    type = 'class'
                else
                    type = 'code'
                    if @displayCodeParameters
                        params = []
                        for param in node.params
                            params.push ', ' if params.length

            @pos = 0
        upcomingInput: ->
            ''

# Wrap a node (see grammar.coffee) overriding methods that might throw Errors.
guard_node = (Node, node_name, parser, report_error) ->
    guarded_compile_method = (method) ->
        # Catch and report error, then abort compilation.
        ->
            try
                return method.apply(this, arguments)
            catch error
                unless error instanceof AbortCompilation
                    report_error @first_line, error
                    throw new AbortCompilation
                throw error

    class GuardedNode extends Node
        # Catch instantiation error and report, then continue parsing.
        constructor: ->
            try
                return super
            catch error
                parser.failed = true
                # this node does not yet have a @first_line, therefore we use
                # yylineno from the parser/lexer directly.
                report_error parser.lexer.yylineno, error

        # Override all compile methods.
        for own name, property of Node::
            if /^compile/.test name and typeof property is 'function'
                @::[name] = guarded_compile_method(property)

        # Override to produce nicer debug output.
        toString: (idt = '', name = node_name) ->
            super idt, name

# Error indicating that error reporting already happened.
class AbortCompilation extends Error


# ## helper functions for the AST walker

