Issue1685

classification
Title: PythonTree.getCharStopIndex() does not include the last character for FunctionDef
Type: behaviour Severity: normal
Components: Core Versions: Jython 2.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: fwierzbicki, pjenvey, waves2d
Priority: normal Keywords:

Created on 2010-12-13.10:56:56 by waves2d, last changed 2013-02-19.23:29:33 by fwierzbicki.

Files
File name Uploaded Description Edit Remove
PythonIssue.zip waves2d, 2010-12-23.06:03:33
unnamed waves2d, 2010-12-23.06:03:33
Messages
msg6276 (view) Author: Sampathkumar R (waves2d) Date: 2010-12-13.10:56:55
The getCharStopIndex method in org.python.antlr.PythonTree is missing the last character while getting the count for a FunctionDef.
This happens only when there are no more statements after the method definition is finished. It appears to be a End Of File handling issue.
msg6291 (view) Author: Philip Jenvey (pjenvey) Date: 2010-12-22.20:15:51
Can you provide an example of the problem, how to reproduce it?
msg6294 (view) Author: Sampathkumar R (waves2d) Date: 2010-12-23.06:03:33
Hi,

In the attached zip, have a look at PythonBugTest.java and python.py.  
The python.py has two methods method1 and method2. getCharStopIndex  
gets the caret position of the first method properly but it fails to  
get that of second method; it will always be one less than the  
expected value. This happens only when the method definition is at the  
end of file, that is there are no further statements after the  
definition. I guess this might be something to do with End Of File  
handling.

With regards,
Sampathkumar R
History
Date User Action Args
2013-02-19 23:29:33fwierzbickisetversions: + Jython 2.5, - 2.5.2rc
2013-02-19 23:29:20fwierzbickisetpriority: normal
assignee: fwierzbicki
nosy: + fwierzbicki
2010-12-23 06:03:34waves2dsetfiles: + PythonIssue.zip, unnamed
messages: + msg6294
2010-12-22 20:15:51pjenveysetnosy: + pjenvey
messages: + msg6291
2010-12-13 10:56:56waves2dcreate