Issue1609

classification
Title: Partial parsing does not work with function decorators
Type: behaviour Severity: normal
Components: Versions: Jython 2.7
Milestone:
process
Status: pending Resolution: fixed
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: akong, fwierzbicki, hongdatang, jeff.allen, pjenvey
Priority: normal Keywords:

Created on 2010-05-09.22:57:04 by hongdatang, last changed 2018-03-18.07:08:00 by jeff.allen.

Messages
msg5764 (view) Author: Hong Da Tang (hongdatang) Date: 2010-05-09.22:57:03
If you try to enter following code in the jython shell, you would receive error message, "SyntaxError: mismatched input '<EOF>' expecting CLASS".

def entryExit(f):
    def new_f():
        print "Entering", f.__name__
        f()
        print "Exited", f.__name__
    return new_f

@entryExit
def func1():
    print "inside func1()"
msg5772 (view) Author: Anthony Kong (akong) Date: 2010-05-21.20:55:42
I think it is not an issue anymore in branch Release_2_5rc4@7056
msg5793 (view) Author: Philip Jenvey (pjenvey) Date: 2010-06-03.02:32:16
I can reproduce this on trunk
msg5797 (view) Author: Anthony Kong (akong) Date: 2010-06-04.05:48:41
Seems like the problem is in the single_input() method of org.python.antlr.PythonParser. So, is it caused by incorrect anltr grammer?
msg11832 (view) Author: Jeff Allen (jeff.allen) Date: 2018-03-18.07:07:59
Not reproduced in 2.7.2a1 (entered a line at a time), so I infer that Frank fixed this at some point.

Jython 2.7.2a1+ (default:d74f8c2cd56f, Feb 24 2018, 17:18:53)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_151
Type "help", "copyright", "credits" or "license" for more information.
>>> def entryExit(f):
...     def new_f():
...         print "Entering", f.__name__
...         f()
...         print "Exited", f.__name__
...     return new_f
...
>>> @entryExit
... def func1():
...     print "inside func1()"
...
>>> func1()
Entering func1
inside func1()
Exited func1
>>>
History
Date User Action Args
2018-03-18 07:08:00jeff.allensetstatus: open -> pending
resolution: remind -> fixed
messages: + msg11832
nosy: + jeff.allen
2013-02-27 17:46:48fwierzbickisettype: behaviour
2013-02-27 17:46:28fwierzbickisetassignee: fwierzbicki
resolution: remind
versions: + Jython 2.7
2010-08-22 22:43:17zyasoftsetpriority: normal
2010-06-16 19:21:54zyasoftsettitle: function decorator -> Partial parsing does not work with function decorators
2010-06-04 05:48:43akongsetmessages: + msg5797
2010-06-03 02:32:17pjenveysetnosy: + pjenvey, fwierzbicki
messages: + msg5793
2010-05-21 20:55:42akongsetnosy: + akong
messages: + msg5772
2010-05-09 22:57:04hongdatangcreate