Subject: Re: bug#51762: 13.0.14; environment formating

From: Arash Esbati <[email-masked]>
Date: Sat, 13 Nov 2021 17:04:33 +0100

Hi Keita,

Ikumi Keita <[email-masked]> writes:

>>>>>> Ikumi Keita <[email-masked]> writes:
>> I think the attached patch fixes the problem. Could you test whether it
>> works on your side?
>
> Hmm, the patch also fails to identify the following form of code
> comment:
>  \\% This is a code comment.
> That is, a line beginning with 0 or more whitespaces, followed by even
> number of back slashes, followed by percent sign(s) and comment body.

Thank you for looking into this.  The way I understand this regexp:

  "\\([^ \r\n%\\]\\|\\\\%\\)\\([ \t]\\|\\\\\\\\\\)*"
                    ^^^^^^^

is there to exclude the control symbol \%, i.e., being parsed as comment
start.  Would it help if we generlize the control symbol idea by saying:

  "\\([^ \r\n%\\]\\|\\\\[^a-zA-Z0-9\\]\\)\\([ \t]\\|\\\\\\\\\\)*"
                        ^^^^^^^^^^^^^^

> Maybe we should give up regexp-based approach to find out code comments
> accurately.

Are you thinking about `syntax-ppss'?

Best, Arash