mirror of
https://github.com/open-goal/jak-project
synced 2026-06-18 23:37:22 -04:00
Decompiler fixes + decompiling (#276)
* decomp pad * more decompilation * update * fix test name
This commit is contained in:
@@ -68,6 +68,13 @@ Matcher Matcher::integer(std::optional<int> value) {
|
||||
return m;
|
||||
}
|
||||
|
||||
Matcher Matcher::any_integer(int match_id) {
|
||||
Matcher m;
|
||||
m.m_kind = Kind::ANY_INT;
|
||||
m.m_int_out_id = match_id;
|
||||
return m;
|
||||
}
|
||||
|
||||
Matcher Matcher::any_quoted_symbol(int match_id) {
|
||||
Matcher m;
|
||||
m.m_kind = Kind::ANY_QUOTED_SYMBOL;
|
||||
@@ -272,6 +279,31 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
|
||||
return false;
|
||||
} break;
|
||||
|
||||
case Kind::ANY_INT: {
|
||||
auto as_simple_atom = dynamic_cast<SimpleAtomElement*>(input->try_as_single_element());
|
||||
if (as_simple_atom) {
|
||||
if (as_simple_atom->atom().is_int()) {
|
||||
if (m_int_out_id != -1) {
|
||||
maps_out->ints[m_int_out_id] = as_simple_atom->atom().get_int();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
auto as_expr = dynamic_cast<SimpleExpressionElement*>(input->try_as_single_element());
|
||||
if (as_expr && as_expr->expr().is_identity()) {
|
||||
auto atom = as_expr->expr().get_arg(0);
|
||||
if (atom.is_int()) {
|
||||
if (m_int_out_id != -1) {
|
||||
maps_out->ints[m_int_out_id] = atom.get_int();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
} break;
|
||||
|
||||
case Kind::ANY_QUOTED_SYMBOL: {
|
||||
auto as_simple_atom = dynamic_cast<SimpleAtomElement*>(input->try_as_single_element());
|
||||
if (as_simple_atom) {
|
||||
|
||||
Reference in New Issue
Block a user