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

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to