From 81bf196a8ea44be9b42a9f9b6f8eca3f016c36e2 Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Tue, 25 Jul 2017 11:02:08 +0100 Subject: COMPMID-415 Fixed format_doxygen.py to handle cpp comments inside strings Change-Id: Ib0b698bcd52d89629b9208b89357507833429799 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/81522 Reviewed-by: Moritz Pflanzer Tested-by: Kaizen --- scripts/format_doxygen.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/format_doxygen.py b/scripts/format_doxygen.py index 64fe7ecbce..da52f7e2a3 100755 --- a/scripts/format_doxygen.py +++ b/scripts/format_doxygen.py @@ -137,15 +137,19 @@ if __name__ == "__main__": # Match end of C-style comment */ if re.search(r"\*/", line): - #print("End comment {}".format(n_line)) + if re.search('"[^"]*\*/[^"]*"', line): + #print("End of comment inside a string: ignoring") + pass + else: + #print("End comment {}".format(n_line)) - if len(comment) < 1: - raise Exception("Was not in a comment! ({})".format(n_line)) + if len(comment) < 1: + raise Exception("Was not in a comment! ({})".format(n_line)) - #print("Process comment {} {}".format(first_param, last_param)) + #print("Process comment {} {}".format(first_param, last_param)) - process_comment(fd, comment, first_param, last_param) + process_comment(fd, comment, first_param, last_param) - comment = list() - first_param = -1 - last_param = -1 + comment = list() + first_param = -1 + last_param = -1 -- cgit v1.2.1