summaryrefslogtreecommitdiff
path: root/giscanner/scannerlexer.l
diff options
context:
space:
mode:
authorDieter Verfaillie <dieterv@optionexplicit.be>2012-03-19 09:23:22 +0100
committerJohan Dahlin <jdahlin@litl.com>2012-04-05 10:22:58 -0300
commit3288b284607e8fa7a53e061c6f10348bdb67e223 (patch)
tree4d5f27405328e2285909ba805bca377eeae1019e /giscanner/scannerlexer.l
parent571a3ce3c9b50dff2c84fe8021e2ff823a0bf08c (diff)
downloadgobject-introspection-3288b284607e8fa7a53e061c6f10348bdb67e223.tar.gz
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
Diffstat (limited to 'giscanner/scannerlexer.l')
-rw-r--r--giscanner/scannerlexer.l4
1 files changed, 2 insertions, 2 deletions
diff --git a/giscanner/scannerlexer.l b/giscanner/scannerlexer.l
index 98c4624e..b4a6fac0 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);