From 06823fad6164e87f95f0c4fafee094a166e4f913 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Tue, 30 Aug 2022 13:01:26 +0300 Subject: [PATCH] pagereader.ISA: support iteration --- src/openpower/decoder/pseudo/pagereader.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/openpower/decoder/pseudo/pagereader.py b/src/openpower/decoder/pseudo/pagereader.py index aa9a0972..7319f077 100644 --- a/src/openpower/decoder/pseudo/pagereader.py +++ b/src/openpower/decoder/pseudo/pagereader.py @@ -63,7 +63,6 @@ def get_isa_dir(): class ISA: - def __init__(self): self.instr = OrderedDict() self.forms = {} @@ -85,6 +84,9 @@ class ISA: with open(name, "w") as f: f.write('\n'.join(rewrite) + '\n') + def __iter__(self): + yield from self.instr.items() + def read_file_for_rewrite(self, fname): pagename = fname.split('.')[0] fname = os.path.join(get_isa_dir(), fname) -- 2.30.2