From: Stefan Behnel Date: Sun, 1 Sep 2013 20:36:20 +0000 (+0200) Subject: include type in annotation item text X-Git-Tag: 0.20b1~337 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d7b716bee7a32d8ae52f4291150f0ee9ce25c648;p=platform%2Fupstream%2Fpython-cython.git include type in annotation item text --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index fb4d075..2511eaf 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -2043,9 +2043,10 @@ class NameNode(AtomicExprNode): if hasattr(self, 'is_called') and self.is_called: pos = (self.pos[0], self.pos[1], self.pos[2] - len(self.name) - 1) if self.type.is_pyobject: - code.annotate(pos, AnnotationItem('py_call', 'python function', size=len(self.name))) + style, text = 'py_call', 'python function (%s)' else: - code.annotate(pos, AnnotationItem('c_call', 'c function', size=len(self.name))) + style, text = 'c_call', 'c function (%s)' + code.annotate(pos, AnnotationItem(style, text % self.type, size=len(self.name))) class BackquoteNode(ExprNode): # `expr` @@ -5378,9 +5379,10 @@ class AttributeNode(ExprNode): def annotate(self, code): if self.is_py_attr: - code.annotate(self.pos, AnnotationItem('py_attr', 'python attribute', size=len(self.attribute))) + style, text = 'py_attr', 'python attribute (%s)' else: - code.annotate(self.pos, AnnotationItem('c_attr', 'c attribute', size=len(self.attribute))) + style, text = 'c_attr', 'c attribute (%s)' + code.annotate(self.pos, AnnotationItem(style, text % self.type, size=len(self.attribute))) #------------------------------------------------------------------- @@ -10049,7 +10051,8 @@ class CoercionNode(ExprNode): self.arg.annotate(code) if self.arg.type != self.type: file, line, col = self.pos - code.annotate((file, line, col-1), AnnotationItem(style='coerce', tag='coerce', text='[%s] to [%s]' % (self.arg.type, self.type))) + code.annotate((file, line, col-1), AnnotationItem( + style='coerce', tag='coerce', text='[%s] to [%s]' % (self.arg.type, self.type))) class CoerceToMemViewSliceNode(CoercionNode): """