finally
chain.pop_back();
log_assert(chain.empty());
+ accept;
endcode
// ------------------------------------------------------------------
code
non_first_cells.insert(next);
- reject;
endcode
// ------------------------------------------------------------------
if (GetSize(chain) > GetSize(longest_chain))
longest_chain = chain;
}
- reject;
finally
if (next)
chain.pop_back();
log("muldiv pattern in %s: mul=%s, div=%s\n", log_id(module), log_id(mul), log_id(div));
module->connect(div_y, val_y);
autoremove(div);
- reject;
+ accept;
endcode
current_pattern, current_subpattern = block["pattern"]
if block["type"] == "final":
- print(" on_accept();", file=f)
- print(" check_blacklist_{}();".format(current_pattern), file=f)
print(" }", file=f)
if index+1 != len(blocks):
print("", file=f)
print("#define reject do {{ check_blacklist_{}(); goto rollback_label; }} while(0)".format(current_pattern), file=f)
print("#define accept do {{ on_accept(); check_blacklist_{}(); if (rollback) goto rollback_label; }} while(0)".format(current_pattern), file=f)
print("#define branch do {{ block_{}(); if (rollback) goto rollback_label; }} while(0)".format(index+1), file=f)
- print("#define subpattern(pattern_name) block_subpattern_{}_ ## pattern_name ()".format(current_pattern), file=f)
+ print("#define subpattern(pattern_name) do {{ block_subpattern_{}_ ## pattern_name (); if (rollback) goto rollback_label; }} while(0)".format(current_pattern), file=f)
for line in block["code"]:
print(" " + line, file=f)