[Python-Dev] PEG parser and raw strings

2020-05-28 Thread Vito De Tullio
Hi.
Just a question about the new PEG parser: will it support lone slash in 
raw strings?

the fact that r'\' doesn't work as expected it's a strange exception to 
remember.

___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/VSEB5O33WTNHBAJ63MC2WMZ772GJNMJC/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: PEG parser and raw strings

2020-05-28 Thread Guido van Rossum
That's the business of the tokenizer, not the parser. And no, nothing is
changing there. Please start a discussion on this topic here -- use
python-ideas if you feel the need to vent.

On Thu, May 28, 2020 at 1:20 PM Vito De Tullio 
wrote:

> Hi.
> Just a question about the new PEG parser: will it support lone slash in
> raw strings?
>
> the fact that r'\' doesn't work as expected it's a strange exception to
> remember.
>
> ___
> Python-Dev mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/[email protected]/message/VSEB5O33WTNHBAJ63MC2WMZ772GJNMJC/
> Code of Conduct: http://python.org/psf/codeofconduct/
>


-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*

___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/WVNWFUWQULTFJIT4C6S36NBLXMLD3HLS/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: PEG parser and raw strings

2020-05-28 Thread Terry Reedy

On 5/28/2020 3:26 PM, Vito De Tullio wrote:

Just a question about the new PEG parser: will it support lone slash in
raw strings?


In 3.9, the new parser is intended to be a drop-in replacement.  That is 
still being worked on.  For 3.10, user-visible changes can be 
considered, but I have not seen any concrete proposals.



the fact that r'\' doesn't work as expected it's a strange exception to
remember.


That said, this seems like a scanner, not a compiler issue.
>>> print(repr(r'\'))
SyntaxError: EOL while scanning string literal

The python syntax highlighter marks all of "r'\')) as part of the 
string, ... but

>>> exec(compile("print(repr(r'\'))", '', 'exec'))
''

--
Terry Jan Reedy
___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/EINILU4KVSHTVBQBILA7IC6MWSPCYIBL/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: PEG parser and raw strings

2020-05-28 Thread Greg Ewing

On 29/05/20 7:26 am, Vito De Tullio wrote:

Hi.
Just a question about the new PEG parser: will it support lone slash in
raw strings?


Even if it could be made to, it presumably won't, because that
would be a language change (e.g. the meaning of r'foo\'bar'
would change).

In any case, this is a function of the tokeniser, which I
understand isn't being replaced at this stage.

--
Greg
___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/VB7GGRPMTILGXWMEWM5ZTKZ7H7KLRJJT/
Code of Conduct: http://python.org/psf/codeofconduct/