Author terry.reedy
Recipients terry.reedy
Date 2018-04-02.03:37:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za>
In-reply-to
Content
Lib\idlelib\colorizer.py, line 25, is:
  stringprefix = r"(?i:\br|u|f|fr|rf|b|br|rb)?"

The r prefix, but only the r prefix, must be preceded by a non-word character.

On pydev thread "IDLE colorizer", MRAB noted: "The \b will apply only to the first choice. Shouldn't it be more like:
  stringprefix = r"(?:\b(?i:r|u|f|fr|rf|b|br|rb))?"

I think the \b should be removed instead.  Currently uf'a' gets f'a' colored, while ur'a' only gets  'a' colored.  (Tim Peters pointed out the difference with a different example.) I prefer coloring the maximal legal string rather than the minimum.    I think the contrast between two chars legal by themselves, but differently colored when put together, makes the bug more obvious.
History
Date User Action Args
2018-04-02 03:37:29terry.reedysetrecipients: + terry.reedy
2018-04-02 03:37:29terry.reedysetmessageid: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za>
2018-04-02 03:37:29terry.reedylinkissue33204 messages
2018-04-02 03:37:28terry.reedycreate