pagereader.ISA: support iteration
authorDmitry Selyutin <ghostmansd@gmail.com>
Tue, 30 Aug 2022 10:01:26 +0000 (13:01 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Tue, 30 Aug 2022 10:02:21 +0000 (13:02 +0300)
src/openpower/decoder/pseudo/pagereader.py

index aa9a0972d7a857fffdc510afe6d19078e17d4561..7319f07792313ea937227a867bef5d0b61e83039 100644 (file)
@@ -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)