Skip to content

Commit

Permalink
Tools: Updates to log message units and help text
Browse files Browse the repository at this point in the history
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"
  • Loading branch information
shancock884 authored and tridge committed Jan 21, 2024
1 parent 6f832bb commit 098a53e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Tools/autotest/logger_metadata/emit_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def emit(self, doccos, enumerations):
# 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()
Expand Down
4 changes: 2 additions & 2 deletions Tools/autotest/logger_metadata/enum_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def match_enum_line(self, line):
# 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))

Expand All @@ -45,7 +45,7 @@ def match_enum_line(self, line):
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))
Expand Down

0 comments on commit 098a53e

Please sign in to comment.