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 789566 - Python syntax highlighting doesn't support dashes in \N(name} string literals
Python syntax highlighting doesn't support dashes in \N(name} string literals
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
git master
Other All
: Normal minor
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2017-10-27 16:30 UTC by Baptiste Mispelon
Modified: 2017-10-28 07:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch for this issue (670 bytes, patch)
2017-10-27 16:30 UTC, Baptiste Mispelon
committed Details | Review

Description Baptiste Mispelon 2017-10-27 16:30:54 UTC
Created attachment 362420 [details] [review]
Proposed patch for this issue

The python syntax highlighter correctly recognizes most `\N{name}` escape sequences like `\N{CLOCK FACE ONE OCLOCK}` but it fails to recognize valid names when they contain a dash, like `\N{CLOCK FACE ONE-THIRTY}`.

Looking at the spec (https://www.unicode.org/Public/9.0.0/ucd/NamesList.html#FilePrimitives), the name can contain "ASCII letters, digits, space and hyphen" so I suggest changing the regexp from `[A-Z\ ]+` to `0-9[A-Z\ -]+`.

Attached is a patch that does just that.
Comment 1 Sébastien Wilmet 2017-10-28 07:13:18 UTC
Review of attachment 362420 [details] [review]:

Looks good, thanks for the patch.

Pushed as commit e6ea71223ec5537f256fd7d15e29d9327696f8d3 on the master branch.
And cherry-picked on the gnome-3-24 branch, the fix will be available in 3.24.6.
Comment 2 Baptiste Mispelon 2017-10-28 07:29:25 UTC
Thanks! ✨