Am Fri, 29 Jan 2021 11:07:43 +0000
schrieb José Abílio Matos <jama...@lyx.org>:

> On Friday, January 29, 2021 5:05:19 AM WET Richard Kimberly Heck wrote:
> > José, can you look at these please?
> > 
> > Riki
> 
> I think that Thibaut wants to impose black[1] on us. :-D
> 
> Most of the changes are cosmetic, e.g. one import per line, or to use the 
> same 
> indentation for documentation.
> 
> The only bits where I am unsure are on the regular expressions (I am trimming 
> the expression to make it easier to read):
> -    declare = re.compile('\\s*(\[([^,]*)(,.*)*\])*$')
> +    declare = re.compile('\\s*(\[([^,]*)(,.*)*])*$')

Right, the last one should be escaped.
Given the line
         # \DeclareLaTeXClass[revtex,revtex.sty]{REVTeX (Obsolete Version)}
and the original regex
        '\\s*#\\s*\\\\DeclareLaTeXClass\\s*(\[([^,]*)(,.*)*\])*\\s*{(.*)}\\s*$'
the result in found(1) would be "revtex"
and found(2) would be the rest inside the escaped brackets, e.g. "revtex.sty"

Not escaping the last ']' probably not intended.
(I would escape also '{' and '}' if that were a perl regex)

> The left bracket is escaped but not the right one. What do other, more 
> knowledgeable about the black magic of regular expressions think?
> 
> The are other issues like mistakes in the documentation strings. For the 
> moment those are harmless, I am referring to e.g. "\c" since \c it is not an 
> escape sequence it gets transformed to "\\c".
> 
> 
> With the extent of the patches I fear that there could be bugs (unintended 
> changes) lurking specially in relation to python 2.
> 
> In particular this just reinforces my feeling that configure.py should get an 
> overhaul. :-)
> 
> This is my preliminary overview. I will keep looking into the patches.
> 
> 
> [1] From Henry Ford's T model "You can choose any color as long as it is 
> black".
> https://black.readthedocs.io/en/stable/ 
> 

Attachment: pgppUSmSKjpVK.pgp
Description: Digitale Signatur von OpenPGP

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to