projects
/
soc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3296749
)
Allow comments
author
Alain D D Williams
<addw@phcomp.co.uk>
Tue, 30 Mar 2021 18:09:41 +0000
(19:09 +0100)
committer
Alain D D Williams
<addw@phcomp.co.uk>
Tue, 30 Mar 2021 18:09:41 +0000
(19:09 +0100)
src/soc/decoder/pseudo/pagereader.py
patch
|
blob
|
history
diff --git
a/src/soc/decoder/pseudo/pagereader.py
b/src/soc/decoder/pseudo/pagereader.py
index 8e9b0be39b66cc70afd45cbe09cca793c03a901c..ea1b6653f40765c5b5a0878fea6456c28aa52a62 100644
(file)
--- a/
src/soc/decoder/pseudo/pagereader.py
+++ b/
src/soc/decoder/pseudo/pagereader.py
@@
-97,8
+97,14
@@
class ISA:
# <!-- line 1 comment -->
# <!-- line 2 comment -->
if l.startswith('<!--'):
# <!-- line 1 comment -->
# <!-- line 2 comment -->
if l.startswith('<!--'):
- print ("skipping comment", l)
+ # print ("skipping comment", l)
+ l = lines.pop(0).rstrip() # get first line
continue
continue
+
+ # Ignore blank lines before the first #
+ if len(l.strip()) == 0:
+ continue
+
# expect get heading
assert l.startswith('#'), ("# not found in line %s" % l)
# expect get heading
assert l.startswith('#'), ("# not found in line %s" % l)
@@
-158,7
+164,7
@@
class ISA:
while lines:
l = lines.pop(0).rstrip()
rewrite.append(l)
while lines:
l = lines.pop(0).rstrip()
rewrite.append(l)
- if len(l) != 0:
+ if len(l) != 0
and not l.startswith('<!--')
:
break
return rewrite
break
return rewrite
@@
-179,8
+185,23
@@
class ISA:
l = lines.pop(0).rstrip() # get first line
while lines:
print(l)
l = lines.pop(0).rstrip() # get first line
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)
+ l = lines.pop(0).rstrip() # get next line
+ continue
+
+ # Ignore blank lines before the first #
+ if len(l) == 0:
+ l = lines.pop(0).rstrip() # get next line
+ continue
+
# expect get heading
# expect get heading
- assert l.startswith('#'), ("# not found in line
%s
" % l)
+ assert l.startswith('#'), ("# not found in line
'%s'
" % l)
d['desc'] = l[1:].strip()
# whitespace expected
d['desc'] = l[1:].strip()
# whitespace expected
@@
-255,7
+276,7
@@
class ISA:
# expect and drop whitespace
while lines:
l = lines.pop(0).rstrip()
# expect and drop whitespace
while lines:
l = lines.pop(0).rstrip()
- if len(l) != 0:
+ if len(l) != 0
and not l.startswith('<!--')
:
break
def add_op(self, o, d):
break
def add_op(self, o, d):