[Pydev-users] [pydev - Users] RE: Support @return tag in generated docstrin
Brought to you by:
fabioz
From: SourceForge.net <no...@so...> - 2008-05-20 01:35:30
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4973253 By: fabioz It should probably work something like: 1. See where the scope of the current method ends. You can use org.python.pydev.parser.fastparser.FastParser#firstClassOrFunction to get where the next method / class starts -- the only catch is that you have to see the indent to see if it's not an inner function instead of a new scope. 2. Iterate lines from the current line that starts the scope to the end of it searching for 'return'. You have to do some text analysis here -- an AST could be generated, but in this case it's probably not appropriate, especially if you want to be more error prone, as ASTs usually require the code to be parseable (or have some minor errors which can be treated) To iterate you can use the org.python.pydev.core.docutils.PyDocIterator (it helps skipping comments and literals) Cheers, Fabio ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=293649 |