[gtk-doc] common: use a non-greedy match for single line comments



commit baccd732fb2fd6316aedccfa08a6fc9f24f78714
Author: Stefan Kost <ensonic users sf net>
Date:   Wed May 11 12:25:33 2011 +0300

    common: use a non-greedy match for single line comments
    
    Fix commit 9e53b98affd26d8b87a9199b57e46c58766bcf43 where the single line
    comments where eating the whole block.

 gtkdoc-common.pl.in |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtkdoc-common.pl.in b/gtkdoc-common.pl.in
index c128b21..5f59c69 100644
--- a/gtkdoc-common.pl.in
+++ b/gtkdoc-common.pl.in
@@ -114,10 +114,10 @@ sub ParseStructDeclaration {
     # Assume end of declaration if line begins with '}'
     $declaration =~ s!\n?[ \t]*/\*\s*<\s*(private|protected)\s*>\s*\*/.*?(?:/\*\s*<\s*public\s*>\s*\*/|(?=^\}))!!msgx;
 
-    # Remove all other comments;
+    # Remove all other comments
     $declaration =~ s \n\s*/\*([^*]+|\*(?!/))*\*/\s*\n \n@msg;
     $declaration =~ s@/\*([^*]+|\*(?!/))*\*/@ @g;
-    $declaration =~ s \n\s*// *\n \n@msg;
+    $declaration =~ s \n\s*// *?\n \n@msg;
     $declaration =~ s@//.*@@g;
 
     my @result = ();
@@ -259,10 +259,10 @@ sub ParseEnumDeclaration {
     # Assume end of declaration if line begins with '}'
     $declaration =~ s!\n?[ \t]*/\*\s*<\s*(private|protected)\s*>\s*\*/.*?(?:/\*\s*<\s*public\s*>\s*\*/|(?=^\}))!!msgx;
 
-    # Remove all other comments;
+    # Remove all other comments
     $declaration =~ s \n\s*/\*([^*]+|\*(?!/))*\*/\s*\n \n@msg;
     $declaration =~ s@/\*([^*]+|\*(?!/))*\*/@ @g;
-    $declaration =~ s \n\s*// *\n \n@msg;
+    $declaration =~ s \n\s*// *?\n \n@msg;
     $declaration =~ s@//.*@@g;
 
     my @result = ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]