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 <moritz.pflanzer@arm.com>
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
diff --git a/scripts/format_doxygen.py b/scripts/format_doxygen.py
index 64fe7ec..da52f7e 100755
--- a/scripts/format_doxygen.py
+++ b/scripts/format_doxygen.py
@@ -137,15 +137,19 @@
 
                 # 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