Python parser incorrectly detects function as methods
Brought to you by:
dhiebert
In the attached test case, the python parser detects "im_a_function" as a method of testClass but it is a function.
This happens because "im_a_function" starts on the same indentation level as the last parsed class before.
func_vs_method.patch tries to solve this by clearing the last parent string for the indentation level of the parsed line.
But this is more or less only a quick hack, I guess there is a better, proper solution.
Test case
Quick hack
Logged In: YES
user_id=1117045
Originator: YES
File Added: func_vs_method.patch
Logged In: YES
user_id=32894
Originator: NO
Thanks, committed as of revision 667. The patch looked fine to me. So far, the only time the indentation level was checked was on encountering "def" or "class". Obviously, a check was needed also for the case when something else would have a smaller indentation, thus ending the block. Which is what you implemented.