From c92136f93ba1c3cdad026b4fc74abb7b0a272b6a Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Tue, 30 Nov 2021 13:41:19 +0000 Subject: [PATCH] sv_analysis: fix single-line binutils comments --- src/openpower/sv/sv_analysis.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/openpower/sv/sv_analysis.py b/src/openpower/sv/sv_analysis.py index edd4b9d6..013ba8ab 100644 --- a/src/openpower/sv/sv_analysis.py +++ b/src/openpower/sv/sv_analysis.py @@ -181,9 +181,13 @@ class Format(enum.Enum): def wrap_comment(self, lines): def wrap_comment_binutils(lines): - yield "/*" - yield from map(lambda line: f" * {line}", lines) - yield "*/" + lines = tuple(lines) + if len(lines) == 1: + yield f"/* {lines[0]} */" + else: + yield "/*" + yield from map(lambda line: f" * {line}", lines) + yield " */" def wrap_comment_vhdl(lines): yield from map(lambda line: f"-- {line}", lines) -- 2.30.2