summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-09-24 09:58:16 -0300
committerJohan Dahlin <johan@gnome.org>2010-09-24 11:03:52 -0300
commit2b1a9d1a397813e50bd615f6a72ac6786b5a9aa5 (patch)
tree234a75105661ca835f6659fd604cac2dced5d435
parenta199218a51da23a4abbbd8e63b4f13aae7ff08c8 (diff)
downloadgobject-introspection-2b1a9d1a397813e50bd615f6a72ac6786b5a9aa5.tar.gz
Add a position to doc options
-rw-r--r--giscanner/annotationparser.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index c8a01b84..2bb2ee39 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -109,6 +109,10 @@ class DocBlock(object):
def __repr__(self):
return '<DocBlock %r %r>' % (self.name, self.options)
+ def set_position(self, position):
+ self.position = position
+ self.options.position = position
+
def get(self, name):
return self.tags.get(name)
@@ -289,7 +293,8 @@ class AnnotationParser(object):
if cpos:
block_name = block_name[:cpos]
block = DocBlock(block_name)
- block.position = message.Position(filename, lineno)
+ block.set_position(message.Position(filename, lineno))
+
if cpos:
block.options = self.parse_options(block, block_header[cpos+2:])
comment_lines = []
@@ -343,7 +348,7 @@ class AnnotationParser(object):
else:
argname = TAG_RETURNS
tag = DocTag(block, argname)
- tag.position = block.position.offset(lineno)
+ tag.set_position(block.position.offset(lineno))
second_colon_index = line.rfind(':')
found_options = False
if second_colon_index > first_colonspace_index:
@@ -404,6 +409,7 @@ class AnnotationParser(object):
# (bar opt1 opt2...)
opened = -1
options = DocOptions()
+ options.position = tag.position
last = None
for i, c in enumerate(value):
if c == '(' and opened == -1: