After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 784673 - Wrong syntax highlighting of Python statement "matches = re.findall(r'href=[\'"]?([^\'" >]+)', url_data)"
Wrong syntax highlighting of Python statement "matches = re.findall(r'href=[\...
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2017-07-07 21:02 UTC by Kalle Richter
Modified: 2017-11-16 14:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a screenshot demonstrating the issue (5.89 KB, image/png)
2017-07-07 21:02 UTC, Kalle Richter
  Details
python.lang: recognize escape sequences in raw strings (2.45 KB, patch)
2017-11-15 23:15 UTC, Роман Донченко
committed Details | Review

Description Kalle Richter 2017-07-07 21:02:00 UTC
Created attachment 355125 [details]
a screenshot demonstrating the issue

Entering the statement `matches = re.findall(r'href=[\'"]?([^\'" >]+)', url_data)` and switching the syntax highlighting to `Python` (i.e. Python 2.x), the syntax highlighting visible in the attached screenshot is rendered which makes the statement appear incorrect, but it's a valid statement.

experienced with 3.22.0 on Ubuntu 17.04 amd64
Comment 1 Роман Донченко 2017-11-15 23:15:13 UTC
Created attachment 363781 [details] [review]
python.lang: recognize escape sequences in raw strings

Raw strings can still contain escape sequences. In particular, the quote
character can be escaped. However, the escape sequences are interpreted
literally (i.e., as a backslash followed by other characters).
Illustrate that by suppressing the style of the escaped-char context.

Line continuations are interpreted literally inside raw strings too (as
a backslash and a newline), so suppress the style for those, as well.
Comment 2 Sébastien Wilmet 2017-11-16 14:59:03 UTC
Thanks! By opening the test file I see that the problem is fixed, so it looks good.

I'll probably cherry-pick the commit to the gnome-3-24 branch.

Attachment 363781 [details] pushed as 3024375 - python.lang: recognize escape sequences in raw strings