[tex-live] Possible lacheck Bug Report

Zdenek Wagner zdenek.wagner at gmail.com
Sat Jan 26 10:27:21 CET 2019


so 26. 1. 2019 v 0:44 odesílatel Karl Berry <karl at freefriends.org> napsal:
>
> Hi,
>
>     I read on the CTAN website that TeXLive is now maintaining lacheck.
>
> Unfortunately true, since no other volunteers have come forward since
> the original author(s) stepped down.  If anyone is interested, please
> write me.
>
>     \newcommand{\defaultleftmargin}{0.25in}
>     ...
>     "hw01.tex", line 5: <- unmatched "end of file hw01.tex"
>     "hw01.tex", line 2: -> unmatched "{"
>
> It's certainly a bug.
>
>     when \newcommand is followed by {\def*} (where * is zero or more other
>     characters). Removal of the curly brackets around \def* or any term
>     other than def causes the issue to go away.
>
> I believe it comes from this line in lacheck.l:
>
> "\\"[exg]?(def|newcommand)[^\n\{]+      BEGIN(DEF);
>
> which I believe says a "definition" starts whenever \def followed by
> something that is not a newline or left brace, which is clearly not the
> case. It seems the \newcommand and \[exg]def cases should be separated
> and made more precise.
>
Yes, they have different syntax and the syntax of \[exg]def is quite
complex. \newcommand has the same syntax as \renewcommand,
\providecommand, and \DeclareRobustCommand. In addition, the regex
give above has another bug: [exg]? should apply to def only, not to
newcommand, hence it must not be outsode the parentheses.

> So, if anyone is interested in playing around with the lex file, let me
> know. Else I'll give it a try when I have a chance.
>
> Thanks for the report. -k



More information about the tex-live mailing list