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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Pydev-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pydev-users

Reply via email to