let new_analysis_stackframe env =
        {
                globals = env.globals;
                num_globals = env.num_globals;
                locals ={ variable_map = StringMap.empty; parent = None }:: env.locals;
                num_locals = 0:: env.num_locals; (* push new stackframe number of locals *)
                sdepth = env.sdepth + 1;
                max_depth = if env.sdepth + 1 > env.max_depth then env.sdepth + 1 else env.max_depth;
                errors = env.errors;
                warnings = env.warnings;
                unique_id = env.unique_id;
                names = env.names;
                varprops = env.varprops;
                imported = env.imported;
                templates = env.templates;
                constants = env.constants;
        }