[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ancient convert rules
From: |
Jonas Hahnfeld |
Subject: |
Re: ancient convert rules |
Date: |
Sun, 30 Aug 2020 22:15:12 +0200 |
User-agent: |
Evolution 3.36.5 |
Am Sonntag, den 30.08.2020, 21:36 +0200 schrieb Joram Noeck:
> Hi Jonas,
>
> some comments to that:
>
> 1. I (hopefully) fixed all the escaping issues like #6024 in my merge
> request: https://gitlab.com/lilypond/lilypond/-/merge_requests/363
>
> The python re syntax is clear, it just requires the right amout of
> backslashes or r-prefixes;
>
> re.sub(r'\\command', r'\command', s) or
> re.sub('\\\\command', '\\command', s)
You need two backslashes in the replacement string, or you get
re.error: bad escape \c at position 0
re.sub(r'\\commandA', r'\\commandB', r'\command')
works correctly.
> I definitely overlooked how often there are *too many* backslashes in
> the code. So there are a lot more changes requried than what is in merge
> request 363:
There is no such thing as too many backslashes due to how re processes
the expressions and replacements, and there are many missing.
> tl;dr: I would not drop conversion rules unless we know that they fail.
All right, this means we need to fix all rules then.
Jonas
signature.asc
Description: This is a digitally signed message part
- Re: ancient convert rules, (continued)
Re: ancient convert rules, Joram Noeck, 2020/08/30