def visit_simple_stmt(self, node): """Visit a docstring statement which may have an assignment before.""" if node[0].type != token.STRING: # not a docstring; but still need to visit children return self.generic_visit(node) prev = node.get_prev_sibling() if not prev: return if prev.type == sym.simple_stmt and \ prev[0].type == sym.expr_stmt and _eq in prev[0].children: # need to "eval" the string because it's returned in its # original form docstring = literals.evalString(node[0].value, self.encoding) docstring = prepare_docstring(docstring) self.add_docstring(prev[0], docstring)