[Python-Dev] Re: PEP 318: Decorators last before colon (original) (raw)
Fred L. Drake, Jr. fdrake at acm.org
Mon Apr 5 14:59:09 EDT 2004
- Previous message: [Python-Dev] Re: PEP 318: Decorators last before colon
- Next message: [Python-Dev] Re: PEP 318: Decorators last before colon
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Mark Russell suggested:
Would it not be possible to cheat and make the lexer transform
"[" WHITESPACE "as" WHITESPACE IDENTIFIERinto an LBRACE-AS token (which I assume would make the parser's job simple).
Guido said:
I don't think without extreme hackery, but feel free to prove me wrong by producing a patch. (A problem is, there could be newlines and comments inside the WHITESPACE. Backtracking over that would require the lexer to have an arbitrary-length buffer.)
Another possibility might be to require the construct start without the whitespace:
"[as" WHITESPACE ... "]"
That avoids the buffering issue and matches what most programmer are more likely to write anyway.
-Fred
-- Fred L. Drake, Jr. PythonLabs at Zope Corporation
- Previous message: [Python-Dev] Re: PEP 318: Decorators last before colon
- Next message: [Python-Dev] Re: PEP 318: Decorators last before colon
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]