summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <jdahlin@async.com.br>2009-01-13 12:52:12 +0000
committerJohan Dahlin <johan@src.gnome.org>2009-01-13 12:52:12 +0000
commitfad01e2f6b60658cb70dcd9d1b7d7387e9926034 (patch)
treee854a24c89df582c75f9b188f11ff1a52c76dd1c
parentd1e663dfcb2d9c40e3eea28a85e6ca83cf9a75de (diff)
downloadgobject-introspection-fad01e2f6b60658cb70dcd9d1b7d7387e9926034.tar.gz
Fix a bug where \n was not present in a comment
2009-01-13 Johan Dahlin <jdahlin@async.com.br> * giscanner/annotationparser.py: Fix a bug where \n was not present in a comment svn path=/trunk/; revision=1029
-rw-r--r--ChangeLog5
-rw-r--r--giscanner/annotationparser.py14
2 files changed, 17 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f71a1f02..a14768a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-01-13 Johan Dahlin <jdahlin@async.com.br>
+
+ * giscanner/annotationparser.py:
+ Fix a bug where \n was not present in a comment
+
2009-01-12 Johan Dahlin <jdahlin@async.com.br>
Bug 562467 – Property annotation
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index 24628f4d..0e65ada8 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -138,6 +138,15 @@ class AnnotationParser(object):
aa.parse(self._namespace)
def _parse_comment(self, comment):
+ # We're looking for gtk-doc comments here, they look like this:
+ # /**
+ # * symbol:
+ #
+ # symbol is currently one of:
+ # - function: gtk_widget_show
+ # - signal: GtkWidget::destroy
+ # - property: GtkWidget:visible
+ #
comment = comment.lstrip()
if not comment.startswith(_COMMENT_HEADER):
return
@@ -147,8 +156,9 @@ class AnnotationParser(object):
return
comment = comment[2:]
- pos = comment.index('\n ')
-
+ pos = comment.find('\n ')
+ if pos == -1:
+ return
block_name = comment[:pos]
block_name = block_name.strip()
if not block_name.endswith(':'):