eclipse 3.4.1
jython 2.2.1
pydev and pydev extensions: 1.4.2
java 1.5.0_16
Mac OS X 10.4.11
Same error seen with pydev 1.4.2. Both
exc = java.lang.Runtime.getRuntime().exec
and
java.lang.Runtime.getRuntime().exec(acrobat + " " + fic.getPath())
will tag the line with the same error:
Encountered "exec" at line 376, column 44. Was expecting: <NAME> ...
Could it be that the word "exec" has a special meaning for the parser and is not recognized as a method in this context?
Marcel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually, exec does have a special meaning, and it's not valid in the grammar for python... so, it seems that the Jython grammar has a 'bug' that allows you to do that... Pydev implemented the grammar specification directly without special treatment for Jython/Python... I'm not sure if there should be special treatment for the Jython grammar not conforming to Python.
If you need to access it and want to remain compatible with the python grammar, you should do: exc = getattr(java.lang.Runtime.getRuntime(), 'exec')
Cheers,
Fabio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
the line:
exc = java.lang.Runtime.getRuntime().exec
gives the following error in Pydev 1.4.1 (Eclipse 3.4.1)
Encountered "exec" at line 1729, column 54. Was expecting: <NAME> ...
It was not tagged as an error in previous (1.3.x) versions.
Thanks
Marcel
With which version is your project configured?
Cheers,
Fabio
Hi Fabio,
project type: jython
grammar version: 2.2
interpreter: default
eclipse 3.4.1
jython 2.2.1
pydev and pydev extensions: 1.4.2
java 1.5.0_16
Mac OS X 10.4.11
Same error seen with pydev 1.4.2. Both
exc = java.lang.Runtime.getRuntime().exec
and
java.lang.Runtime.getRuntime().exec(acrobat + " " + fic.getPath())
will tag the line with the same error:
Encountered "exec" at line 376, column 44. Was expecting: <NAME> ...
Could it be that the word "exec" has a special meaning for the parser and is not recognized as a method in this context?
Marcel
Actually, exec does have a special meaning, and it's not valid in the grammar for python... so, it seems that the Jython grammar has a 'bug' that allows you to do that... Pydev implemented the grammar specification directly without special treatment for Jython/Python... I'm not sure if there should be special treatment for the Jython grammar not conforming to Python.
If you need to access it and want to remain compatible with the python grammar, you should do: exc = getattr(java.lang.Runtime.getRuntime(), 'exec')
Cheers,
Fabio