Example #1
0
 def transform(self, ast, env):
     func_env = env.translation.crnt
     error_env = func_env.error_env
     post_mortem = error_env.enable_post_mortem
     reporting.report(error_env,
                      post_mortem=post_mortem)
     return ast
Example #2
0
    def __call__(self, ast, env):
        if env.stage_checks: self.check_preconditions(ast, env)

        if self.is_composed:
            ast = self.transform(ast, env)
        else:
            try:
                ast = self.transform(ast, env)
            except error.NumbaError as e:
                func_env = env.translation.crnt
                error_env = func_env.error_env
                if func_env.is_closure:
                    flags, parent_func_env = env.translation.stack[-2]
                    error_env.merge_in(parent_func_env.error_env)
                elif not e.has_report:
                    reporting.report(env, exc=e)
                raise

        env.translation.crnt.ast = ast
        if env.stage_checks: self.check_postconditions(ast, env)
        return ast
Example #3
0
 def transform(self, ast, env):
     reporting.report(env)
     return ast