More exceptions
authorEddie Hung <eddie@fpgeh.com>
Fri, 20 Sep 2019 19:03:10 +0000 (12:03 -0700)
committerEddie Hung <eddie@fpgeh.com>
Fri, 20 Sep 2019 19:03:10 +0000 (12:03 -0700)
passes/pmgen/pmgen.py

index d5e667911d9abdc37dc877848437558abe90896c..39a09991d04b8f901c6a14c09d00ebb1547bf987 100644 (file)
@@ -286,7 +286,7 @@ def process_pmgfile(f, filename):
                         block["gencode"].append(rewrite_cpp(l.rstrip()))
                     break
 
-                assert False
+                raise RuntimeError("'%s' statement not recognised on line %d" % (a[0], linenr))
 
             if block["optional"]:
                 assert not block["semioptional"]
@@ -328,7 +328,7 @@ def process_pmgfile(f, filename):
             blocks.append(block)
             continue
 
-        assert False
+        raise RuntimeError("'%s' command not recognised" % cmd)
 
 for fn in pmgfiles:
     with open(fn, "r") as f: