Parse doc-comment tags case-insensitive
authorOwen W. Taylor <otaylor@fishsoup.net>
Mon, 16 Feb 2009 23:23:25 +0000 (18:23 -0500)
committerOwen W. Taylor <otaylor@fishsoup.net>
Tue, 17 Feb 2009 16:12:07 +0000 (11:12 -0500)
gtk-doc treats tags like 'Return value:' or 'Since:' as case-insensitive,
do the same to make things as predictable as possibe and avoid strange
problems where a 'Return Value:' tag work with gtk-doc but not
g-ir-scanner.

http://bugzilla.gnome.org/show_bug.cgi?id=572086

giscanner/annotationparser.py

index e5ecc64..003ff2c 100644 (file)
@@ -39,10 +39,10 @@ from .glibast import GLibBoxed
 _COMMENT_HEADER = '*\n '
 
 # Tags - annotations applyed to comment blocks
-TAG_SINCE = 'Since'
-TAG_DEPRECATED = 'Deprecated'
-TAG_RETURNS = 'Returns'
-TAG_RETURNS_ALT = 'Return value'
+TAG_SINCE = 'since'
+TAG_DEPRECATED = 'deprecated'
+TAG_RETURNS = 'returns'
+TAG_RETURNS_ALT = 'return value'
 
 # Options - annotations for parameters and return values
 OPT_ALLOW_NONE = 'allow-none'
@@ -179,7 +179,7 @@ class AnnotationParser(object):
                 comment_lines.append(line)
                 continue
             tag = self._parse_tag(line)
-            block.tags[tag.name] = tag
+            block.tags[tag.name.lower()] = tag
         block.comment = '\n'.join(comment_lines)
         self._blocks[block.name] = block