Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang
erlang
4015-Attempt-to-fix-triple-or-more-quoted-strin...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 4015-Attempt-to-fix-triple-or-more-quoted-strings-in-the-.patch of Package erlang
From da19467db9e02ddfa4398bfabe6550b30223d82c Mon Sep 17 00:00:00 2001 From: Raimo Niskanen <raimo@erlang.org> Date: Thu, 6 Jul 2023 15:21:59 +0200 Subject: [PATCH 5/8] Attempt to fix triple-or-more quoted strings in the Emacs mode --- lib/tools/emacs/erlang.el | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el index a21f1df25a..ed6cf2520f 100644 --- a/lib/tools/emacs/erlang.el +++ b/lib/tools/emacs/erlang.el @@ -1620,7 +1620,26 @@ Other commands: ("\\(?:^\\|[^$]\\)'\\(?:[^'\n]\\|\\\\'\\)*\\(\\$\\)'" 1 "w") ;; And the dollar sign in $\" or $\' escapes two ;; characters, not just one. - ("\\(\\$\\)\\\\[\"']" 1 "'")))))) + ("\\(\\$\\)\\\\[\"']" 1 "'") + ;; To highlight triple-or-more quoted strings decently: + ;; mark the second to last character in a sequence + ;; containing an even number of " characters + ;; as an expression prefix character. + ;; This makes an opening even number of (4 or above) + ;; " characters one or more empty strings + ;; followed by one prefixed single opening ", + ;; so effectively just a single ". + ;; A closing even number of " becomes a single closing " + ;; followed by zero or more empty strings, + ;; and then one string containing just a prefix ". + ;; An odd number of opening or closing " works without + ;; any tricks since they become empty strings and + ;; an opening or closing single " last or first. + ;; " chars within a triple-or-more quoted string really + ;; does not work, but a single "-quoted string on one line + ;; only looses the string highlighting. + ("\\(?:\"\"\\)+\\(\"?\\)\"" 1 "'") + ))))) -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor