-Object user${{name}}$implementation(EnvironmentPool* environmentPool, Environment* parent, size_t argc, Stack* parentStack, jmp_buf parentJump)
+Object user${{name}}$implementation(EnvironmentPool* environmentPool, Environment* environment, size_t argc, Stack* parentStack, jmp_buf parentJump)
{
- Environment* environment = EnvironmentPool_allocate(environmentPool);
- Environment_initialize(environment, parent);
+ environment = Environment_construct(environmentPool, environment);
Stack stackMemory;
Stack* stack = &stackMemory;
{{ statement }}
{% endfor %}
+ // TODO Set the environment back to the parent environment
Environment_setLive(environment, false);
return result;
}
return EnvironmentPool_allocate(previous->overflow);
}
+Environment* Environment_construct(EnvironmentPool* environmentPool, Environment* parent)
+{
+ Environment* environment = EnvironmentPool_allocate(environmentPool);
+ Environment_initialize(environment, parent);
+ return environment;
+}
+
Object integerLiteral(int32_t literal)
{
Object result;