Tools: Updates to log message units and help text

parse.py: Remove lone bullet points rendered on replay messages
enum_parse.py: Tweak regex on enum parser to handle comments like: "FRED = 10, ///< text"
This commit is contained in:
Simon Hancock 2024-01-17 13:49:50 +00:00 committed by Andrew Tridgell
parent 6f832bbd3b
commit 098a53e318
2 changed files with 4 additions and 3 deletions

View File

@ -76,7 +76,8 @@ This is a list of log messages which may be present in logs produced and stored
# Add the new row
rows.append([f, ftypeunit, fdesc])
print(self.tablify(rows), file=self.fh)
if rows:
print(self.tablify(rows), file=self.fh)
print("", file=self.fh)
self.stop()

View File

@ -35,7 +35,7 @@ class EnumDocco(object):
# attempts to extract name, value and comment from line.
# Match: " FRED, // optional comment"
m = re.match("\s*([A-Z0-9_a-z]+)\s*,? *(?:// *(.*) *)?$", line)
m = re.match("\s*([A-Z0-9_a-z]+)\s*,? *(?://[/>]* *(.*) *)?$", line)
if m is not None:
return (m.group(1), None, m.group(2))
@ -45,7 +45,7 @@ class EnumDocco(object):
return (m.group(1), None, m.group(2))
# Match: " FRED = 17, // optional comment"
m = re.match("\s*([A-Z0-9_a-z]+)\s*=\s*([-0-9]+)\s*,?(?:\s*//\s*(.*) *)?$",
m = re.match("\s*([A-Z0-9_a-z]+)\s*=\s*([-0-9]+)\s*,?(?:\s*//[/<]*\s*(.*) *)?$",
line)
if m is not None:
return (m.group(1), m.group(2), m.group(3))