# body StatListNode
def analyse_declarations(self, env):
- env.doc = self.doc
+ if Options.embed_pos_in_docstring:
+ env.doc = 'File: %s (starting at line %s)'%relative_position(self.pos)
+ if not self.doc is None:
+ env.doc = env.doc + '\\n' + self.doc
+ else:
+ env.doc = self.doc
self.body.analyse_declarations(env)
def process_implementation(self, env, result):
import ExprNodes
self.dict = ExprNodes.DictNode(pos, key_value_pairs = [])
if self.doc:
- doc_node = ExprNodes.StringNode(pos, value = self.doc)
+ if Options.embed_pos_in_docstring:
+ doc = 'File: %s (starting at line %s)'%relative_position(self.pos)
+ doc = doc + '\\n' + self.doc
+ doc_node = ExprNodes.StringNode(pos, value = doc)
else:
doc_node = None
self.classobj = ExprNodes.ClassNode(pos,
visibility = self.visibility,
typedef_flag = self.typedef_flag)
scope = self.entry.type.scope
+
if self.doc:
- scope.doc = self.doc
+ if Options.embed_pos_in_docstring:
+ scope.doc = 'File: %s (starting at line %s)'%relative_position(self.pos)
+ scope.doc = scope.doc + '\\n' + self.doc
+ else:
+ scope.doc = self.doc
+
if has_body:
self.body.analyse_declarations(scope)
if self.in_pxd: