add comment skipping in pagereader.py
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 24 Mar 2021 17:06:29 +0000 (17:06 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 24 Mar 2021 17:06:29 +0000 (17:06 +0000)
src/soc/decoder/pseudo/pagereader.py

index a5d05cc53eb51fdc4a63263bf2181f164d416282..8e9b0be39b66cc70afd45cbe09cca793c03a901c 100644 (file)
@@ -91,6 +91,14 @@ class ISA:
         rewrite.append(l)
         while lines:
             print(l)
+            # look for HTML comment, if starting, skip line.
+            # XXX this is braindead!  it doesn't look for the end
+            # so please put ending of comments on one line:
+            # <!-- line 1 comment -->
+            # <!-- line 2 comment -->
+            if l.startswith('<!--'):
+                print ("skipping comment", l)
+                continue
             # expect get heading
             assert l.startswith('#'), ("# not found in line %s" % l)