[gobject-introspection] Don't munch /* and */ comment start and end markers.



commit 3288b284607e8fa7a53e061c6f10348bdb67e223
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date:   Mon Mar 19 09:23:22 2012 +0100

    Don't munch /* and */ comment start and end markers.
    
    In Sandro Sigala's original c-c++-grammars code, this function
    was known as "static void skip_comment(void)". It was built this
    way instead of a lex pattern because it didn't need to save the
    matched comment in the "yytext" buffer. This is still true as
    we directly assign the matched comment to the scanner object.
    So simply prepend and append the markers back where they belong.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=672254

 giscanner/scannerlexer.l |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/giscanner/scannerlexer.l b/giscanner/scannerlexer.l
index 98c4624..b4a6fac 100644
--- a/giscanner/scannerlexer.l
+++ b/giscanner/scannerlexer.l
@@ -222,7 +222,7 @@ parse_comment (GISourceScanner *scanner)
   c1 = input();
   c2 = input();
 
-  string = g_string_new ("");
+  string = g_string_new ("/*");
 
   comment_lineno = lineno;
 
@@ -235,8 +235,8 @@ parse_comment (GISourceScanner *scanner)
 
       c1 = c2;
       c2 = input();
-
     }
+  g_string_append (string, "*/");
 
   comment = g_slice_new (GISourceComment);
   comment->comment = g_string_free (string, FALSE);



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