From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#28418: 25.2; c++ angle bracket incorrect mismatch Date: 11 Sep 2017 17:55:08 -0000 Organization: muc.de e.V. Message-ID: <20170911175508.91132.qmail__17703.5945620903$1505154618$gmane$org@mail.muc.de> References: NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1505154618 3702 195.159.176.226 (11 Sep 2017 18:30:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 11 Sep 2017 18:30:18 +0000 (UTC) User-Agent: tin/2.4.1-20161224 ("Daill") (UNIX) (FreeBSD/11.0-RELEASE-p2 (amd64)) Cc: 28418@debbugs.gnu.org To: "Tanis, Craig" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 11 20:30:14 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drTTE-0000Wl-GH for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Sep 2017 20:30:08 +0200 Original-Received: from localhost ([::1]:59856 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drTTL-0005P2-PQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Sep 2017 14:30:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drSwH-0006lK-Ub for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2017 13:56:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drSwE-0004gh-01 for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2017 13:56:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53486) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1drSwD-0004gS-TU; Mon, 11 Sep 2017 13:56:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1drSwD-0001QR-Jr; Mon, 11 Sep 2017 13:56:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 11 Sep 2017 17:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28418 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 28418-submit@debbugs.gnu.org id=B28418.15051525195419 (code B ref 28418); Mon, 11 Sep 2017 17:56:01 +0000 Original-Received: (at 28418) by debbugs.gnu.org; 11 Sep 2017 17:55:19 +0000 Original-Received: from localhost ([127.0.0.1]:33934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drSvW-0001PL-Qw for submit@debbugs.gnu.org; Mon, 11 Sep 2017 13:55:19 -0400 Original-Received: from ocolin.muc.de ([193.149.48.4]:45537 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1drSvS-0001PB-UF for 28418@debbugs.gnu.org; Mon, 11 Sep 2017 13:55:15 -0400 Original-Received: (qmail 91133 invoked by uid 3782); 11 Sep 2017 17:55:08 -0000 In-Reply-To: X-Newsgroups: gnu.emacs.bug X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:136801 Archived-At: Hello, Craig. In article you wrote: > The opening angle bracket from the stream insertion operator (<<) > becomes misclassified as an opening delimiter if a later string literal in the > file contains >> Firstly, thanks for taking the trouble to report this bug, and thanks even more for trimming it down to a nice, easy to work with snippet. > See the following sample file. Notice that you must type in the string > as indicated because the act of typing triggers the misclassification. > When the error occurs, the closing bracket matches the '<' right before "nice". Being more precise, I think the >> in the string already has to exist at the time the << gets typed. > I suggest pasting this into a new file and then manipulating the first string. > //--------------------------- > int main(int argc, char *argv[]) > { > std::cout << "nice"; // <-- manually type in this string > return 0; > } > void subroutine() > { > char* foo= "a >> b"; > return; > } > //--------------------------- What seems to be happening is after typing in the opening " of "nice", but before typing in the closing ", we have a sort of string extending from that opening " to the opening " of "a >> b". That >> is (temporarily) outside a string, and is thus balanced with the <<. This balancing is done by applying a "text property" to each of the second < and the first > characters. Where things go wrong is when "nice" is closed by typing the closing ". At this point, the text properties don't get removed from these < and >, although they no longer match. This is the fault in the code. Give me a little time, and I will fix it. > In GNU Emacs 25.2.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1911)) > of 2017-04-21 built on builder10-9.porkrind.org > Windowing system distributor 'Apple', version 10.3.1504 > Configured using: > 'configure --with-ns '--enable-locallisppath=/Library/Application > Support/Emacs/${version}/site-lisp:/Library/Application > Support/Emacs/site-lisp' --with-modules' > Major mode: C++/l [ .... ] > ---- > Craig Tanis, PhD > UTC Computer Science and Engineering > craig-tanis@utc.edu -- Alan Mackenzie (Nuremberg, Germany).