add stacking framework

This commit is contained in:
water
2021-01-22 20:50:37 -05:00
parent 679b17ae6f
commit 56d4ed1228
10 changed files with 394 additions and 10 deletions
+16
View File
@@ -20,6 +20,18 @@ FormPool::~FormPool() {
}
}
///////////////////
// FormElement
///////////////////
std::string FormElement::to_string(const Env& env) const {
return to_form(env).print();
}
void FormElement::push_to_stack(const Env& env, FormStack&) {
throw std::runtime_error("push_to_stack not implemented for " + to_string(env));
}
///////////////////
// Form
//////////////////
@@ -38,6 +50,10 @@ goos::Object Form::to_form(const Env& env) const {
}
}
std::string Form::to_string(const Env& env) const {
return to_form(env).print();
}
void Form::inline_forms(std::vector<goos::Object>& forms, const Env& env) const {
for (auto& x : m_elements) {
forms.push_back(x->to_form(env));