GNOME Bugzilla – Bug 673806
annotationparser: indent _parse_comment_block gtkdoc code
Last modified: 2015-02-07 16:55:17 UTC
Created attachment 211682 [details] [review] annotationparser: indent _parse_comment_block gtkdoc code The current logic in _parse_comment_block of the annotationparser check the identifier and use variables that only makes sense if a result was returned (column_offset, original_line). This patch indent the logic so it is only triggered if a result is found. Otherwise it returns None as expected by call chain "parse > parse_comment_block > _parse_comment_block": ie in "parse": comment_block = self.parse_comment_block(comment) if comment_block is not None: This still raises a lot of warnings but does not abort while generating gir for libgnomekbd, mutter or telepathy-glib (those thus have to be tweaked not to call g-ir-scanner with --warn-error at least until the parser mask those false positives or the doc from those projects is fixed to comply with the behaviour expected by giscanner).
Do you have an example GTK-Doc comment block that triggers the abort you are describing? The only situation I can imagine where that might happen is if a line in the comment block does not start with ' * ' (which is invalid for both GTK-Doc and the new AnnotationParser). That is exactly what "result = COMMENT_ASTERISK_RE.match(line)" is testing. If that's the case, the following should fix the problem. But I'd still like an example GTK-Doc comment block so we can add it to the test suite :) diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py index 3a6a09d..5e3f413 100644 --- a/giscanner/annotationparser.py +++ b/giscanner/annotationparser.py @@ -619,6 +619,9 @@ class AnnotationParser(object): # Get rid of ' * ' at start of the line. line = line[result.end(0):] + else: + original_line = line + column_offset = 0 #################################################################### # Check for GTK-Doc comment block identifier.
*** Bug 673975 has been marked as a duplicate of this bug. ***
*** Bug 674008 has been marked as a duplicate of this bug. ***
Created attachment 212216 [details] [review] patch to regress.h which triggers the bug
Dieter, care to fold the test patch into Alban's patch and commit?
Nevermind i'll just do it =) Attachment 211682 [details] pushed as f41525d - annotationparser: indent _parse_comment_block gtkdoc code
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]