add support for non virtual states (#764)

* add support for non virtual states

* typecheck go

* start on virtual states

* more support for virtual states

* offline passes

* fix tests

* use behavior shortcut instead of lambda

* final cleanup of virtual go

* unused var warnings and fix inconsistent enum decompile order on win vs linux

* fix thread safety bug with goal symbol table and vif1 interrupt handler

* fix type mistake
This commit is contained in:
water111
2021-08-17 20:54:03 -04:00
committed by GitHub
parent 2dfb2b2545
commit 97ab6a4e12
76 changed files with 7111 additions and 7828 deletions
+25
View File
@@ -2602,6 +2602,22 @@ void FunctionCallElement::update_from_stack(const Env& env,
FormElement* new_form = nullptr;
if (go_next_state) {
// see if we're a virtual go
Matcher virtual_go_state_matcher =
Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::METHOD_OF_OBJECT),
{Matcher::any(0), Matcher::any_constant_token(1)});
auto virtual_go_mr = match(virtual_go_state_matcher, go_next_state);
if (virtual_go_mr.matched && virtual_go_mr.maps.forms.at(0)->to_string(env) == "self") {
arg_forms.insert(arg_forms.begin(), pool.alloc_single_element_form<ConstantTokenElement>(
nullptr, virtual_go_mr.maps.strings.at(1)));
auto go_form = pool.alloc_element<GenericElement>(
GenericOperator::make_function(
pool.alloc_single_element_form<ConstantTokenElement>(nullptr, "go-virtual")),
arg_forms);
result->push_back(go_form);
return;
}
arg_forms.insert(arg_forms.begin(), go_next_state);
auto go_form = pool.alloc_element<GenericElement>(
GenericOperator::make_function(
@@ -4888,6 +4904,15 @@ void GetSymbolStringPointer::update_from_stack(const Env&,
result->push_back(this);
}
void DefstateElement::update_from_stack(const Env&,
FormPool&,
FormStack&,
std::vector<FormElement*>* result,
bool) {
mark_popped();
result->push_back(this);
}
void LabelElement::push_to_stack(const Env&, FormPool&, FormStack& stack) {
mark_popped();
stack.push_form_element(this, true);