GNOME Bugzilla – Bug 741305
Scanner issue with enum containing value ='{'
Last modified: 2014-12-29 14:51:11 UTC
GLib's GTokenType doc does not contain all enum values, the scanner stops parsing values when it encounters: G_TOKEN_LEFT_CURLY = '{', G_TOKEN_RIGHT_CURLY = '}', It works if I replace those 2 lines with G_TOKEN_LEFT_CURLY = 0x7b, /* gtk-doc doesn't like '{' */ G_TOKEN_RIGHT_CURLY = 0x7d, /* gtk-doc doesn't like '}' */
As far as I understand, the bug is in gtkdoc-common.pl, ParseEnumDeclaration. while ($declaration =~ m/\s*([^,\}]+)([,\}])/msg) That would indeed treat = '}' as the end of the enum.
Created attachment 292635 [details] [review] Special case fo FOO = '}' in enumerations
Review of attachment 292635 [details] [review]: ::: gtkdoc-common.pl.in @@ +281,3 @@ + # See https://bugzilla.gnome.org/show_bug.cgi?id=741305 + + $declaration =~ s/\'\}\'/\'\'/g; Looks like you're missing a slash at the end there. Should read //g if I understand your intent correctly. I'd also argue that this approach is ugly, except I look up a couple of lines and see more of the same...
Review of attachment 292635 [details] [review]: I'd maybe consider dropping any single character you find between single quotes... the comment on the stanza just above makes me believe that ',' could also be problematic.
Created attachment 292640 [details] [review] Special case for FOO = '}' in enumerations
The following fix has been pushed: fb2f1b9 Special case for FOO = '}' in enumerations
Created attachment 293440 [details] [review] Special case for FOO = '}' in enumerations