def defer_function(self, callable):
        """Schedule a function handler to be called just before completion.

        This is used for handling function bodies, which must be deferred because code later in the file might modify
        the global scope. When 'callable' is called, the scope at the time this is called will be restored, however it
        will contain any new bindings added to it.

        """
        self._deferred_functions.append((callable, self.scope_stack[:], self.offset))