A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2000-August/008251.html below:

[Python-Dev] parsers and compilers for 2.0

[Python-Dev] parsers and compilers for 2.0Neil Schemenauer nascheme@enme.ucalgary.ca
Sat, 12 Aug 2000 18:03:57 -0400
With all the recent proposed and accepted language changes, we
should be a careful to keep everything up to date.  The parser
module, Jeremy's compiler, and I suspect JPython have been left
behind by the recent changes.  In the past we have been blessed
by a very stable core language.  Times change. :)

I'm trying to keep Jeremy's compiler up to date.  Modifying the
parser module to understand list comprehensions seems to be none
trivial however.  Does anyone else have the time and expertise to
make these changes?  The compiler/transformer.py module will also
have to be modified to understand the new parse tree nodes.  That
part should be somewhat easier.

On a related note, I think the SyntaxError messages generated by
the compile() function and the parser module could be improved.
This is annoying:

    >>> compile("$x", "myfile.py", "eval")
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
      File "<string>", line 1
        $x
        ^
    SyntaxError: invalid syntax

Is there any reason why the error message does not say
"myfile.py" instead of "<string>"?  If not I can probably put
together a patch to fix it.

As far as I can tell, the parser ParserError exceptions are
almost useless.  At least a line number could be given.  I'm not
sure how much work that is to fix though.

  Neil



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4