sort out pywriter.py when run with no args
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 29 Mar 2021 18:18:33 +0000 (19:18 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 29 Mar 2021 18:18:33 +0000 (19:18 +0100)
src/soc/decoder/pseudo/pywriter.py

index bc0f5885f7443e03ae5cfbe4b6007fc74c369389..77ff775ebd815c2ac121318109d64cfd02b4ad7a 100644 (file)
@@ -131,15 +131,15 @@ class PyISAWriter(ISA):
 
 if __name__ == '__main__':
     isa = PyISAWriter()
+    write_isa_class = True
     if len(sys.argv) == 1:  # quick way to do it
         print(dir(isa))
         sources = isa.page.keys()
     else:
         sources = sys.argv[1:]
-    write_isa_class = True
-    if sources[0] == "noall": # don't rewrite all.py
-        write_isa_class = False
-        sources.pop(0)
+        if sources[0] == "noall": # don't rewrite all.py
+            write_isa_class = False
+            sources.pop(0)
     print ("sources", write_isa_class, sources)
     for source in sources:
         isa.write_pysource(source)