mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-27 04:35:27 +00:00
isa, scripts: two more registry crash paths become diagnostics (#215)
- A variant whose first duplicate base form is incomplete: the completeness check and the XML check now use the same base row (no KeyError). - qa rdna2 inventory and rank report a malformed encoding_variant (missing 'of', non-string operands) as an error with exit 2, not a traceback; the coverage reader checks the field types. Each has a test that fails on the previous code. Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
This commit is contained in:
1 parent
de536c033b
commit
263284ff4f
5 files changed
+82
-7
No files matched your search
@@ -182,11 +182,15 @@ def read_declarations(registry, identified):
|
||||
# An encoding variant declares its base form in another encoding family.
|
||||
raw_variants = registry.get("encoding_variant", [])
|
||||
if not isinstance(raw_variants, list) or not all(
|
||||
isinstance(variant, dict) and {"family", "of", "opcode", "operands"} <= set(variant)
|
||||
isinstance(variant, dict)
|
||||
and {"family", "of", "opcode", "operands"} <= set(variant)
|
||||
and all(isinstance(variant[key], str) for key in ("family", "of", "operands"))
|
||||
and type(variant["opcode"]) is int
|
||||
for variant in raw_variants
|
||||
):
|
||||
raise ValueError(
|
||||
f"{REGISTRY}: every encoding_variant needs family, of, opcode and operands"
|
||||
f"{REGISTRY}: every encoding_variant needs string family, of and operands"
|
||||
" and an integer opcode"
|
||||
)
|
||||
variants = [
|
||||
{"family": variant["family"], "name": variant["of"], "opcode": variant["opcode"],
|
||||
|
||||
Reference in new issue
Block a user