From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Welsh Duggan Newsgroups: gmane.emacs.bugs Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped. Date: Thu, 24 Sep 2020 14:52:16 -0400 Message-ID: <87v9g3yplr.fsf@md5i.com> References: <20200923144824.GD6178@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33305"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 43558@debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Stefan Monnier To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 24 20:53:29 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kLWMy-0008XY-DG for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Sep 2020 20:53:28 +0200 Original-Received: from localhost ([::1]:54946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLWMx-000847-CM for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Sep 2020 14:53:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLWMY-0007zq-PG for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2020 14:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58433) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kLWMY-0002Fb-Fq for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2020 14:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kLWMY-0004dA-FT for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2020 14:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Welsh Duggan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Sep 2020 18:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43558 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 43558-submit@debbugs.gnu.org id=B43558.160097354917761 (code B ref 43558); Thu, 24 Sep 2020 18:53:02 +0000 Original-Received: (at 43558) by debbugs.gnu.org; 24 Sep 2020 18:52:29 +0000 Original-Received: from localhost ([127.0.0.1]:41746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLWM1-0004cP-I9 for submit@debbugs.gnu.org; Thu, 24 Sep 2020 14:52:29 -0400 Original-Received: from md5i.com ([75.151.244.229]:40480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLWLz-0004cH-Og for 43558@debbugs.gnu.org; Thu, 24 Sep 2020 14:52:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=md5i.com; s=dkim; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=TgXUxapiN/8MkQPCduD01bJMXu8bXBFxLWRxxDpbGqo=; b=vE5my4PR2EPM/gdZKvw9iP2aOV 5R84+ZqYr9TXeB4Dd121gKN+7fEGR/n9Q+O3O2caKTyBC0esMOcQta37oCKhpqiwRsXp11TByO/AI oLPteE8luufnlijjI3xMmf+rX; Original-Received: from md5i by md5i.com with local (Exim 4.94) (envelope-from ) id 1kLWLo-005242-Gm; Thu, 24 Sep 2020 14:52:16 -0400 In-Reply-To: <20200923144824.GD6178@ACM> (Alan Mackenzie's message of "Wed, 23 Sep 2020 14:48:24 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188898 Archived-At: Alan Mackenzie writes: > Hello, Mattias. > > On Wed, Sep 23, 2020 at 11:01:59 +0200, Mattias Engdeg=E5rd wrote: >> Sorry if I misunderstood, but since when do backslashes escape */ in C? > > Since forever, but only in the CC Mode test suite. :-( > > I just tried it out with gcc, and it seems that \*/ does indeed end a > block comment. But an escaped newline doesn't end a line comment, > instead continuing it to the next line. So I got confused. Thanks for > pointing out the mistake. > > It seems that as well as the existing variable > comment-end-can-be-escaped, we need a new one, say > line-comment-end-can-be-escaped, too. In C and C++ modes, these would > be nil and t respectively. But where does it say that backslashes escape */ in C++? The C++ 14 standard (and it hasn't changed through C++ 20) says: 2.7 Comments [lex.comment] =20=20=20=20 The characters /* start a comment, which terminates with the characters */. These comments do not nest. The characters // start a comment, which terminates immediately before the next new-line character. If there is a form-feed or a vertical-tab character in such a comment, only white-space characters shall appear between it and the new-line that terminates the comment; no diagnostic is required. [ Note: The comment characters //, /*, and */ have no special meaning within a // comment and are treated just like other characters. Similarly, the comment characters // and /* have no special meaning within a /* comment. =97 end note ] --=20 Michael Welsh Duggan (md5i@md5i.com)