From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#11014: cperl syntax highlighting breaking on certain complex regular expressions Date: Wed, 14 Mar 2012 23:11:48 -0400 Message-ID: References: <20120314090534.66398623@nbtrap.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1331781190 983 80.91.229.3 (15 Mar 2012 03:13:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Mar 2012 03:13:10 +0000 (UTC) Cc: 11014@debbugs.gnu.org To: Nathan Trapuzzano Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 15 04:13:05 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S817f-0001vu-K9 for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Mar 2012 04:13:03 +0100 Original-Received: from localhost ([::1]:43405 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S817e-0001hE-PN for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Mar 2012 23:13:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S817b-0001gO-Ti for bug-gnu-emacs@gnu.org; Wed, 14 Mar 2012 23:13:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S817Z-0003eP-R7 for bug-gnu-emacs@gnu.org; Wed, 14 Mar 2012 23:12:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S817Z-0003eE-Ni for bug-gnu-emacs@gnu.org; Wed, 14 Mar 2012 23:12:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1S81ag-0006IG-CH for bug-gnu-emacs@gnu.org; Wed, 14 Mar 2012 23:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Mar 2012 03:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11014 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11014-submit@debbugs.gnu.org id=B11014.133178293024120 (code B ref 11014); Thu, 15 Mar 2012 03:43:02 +0000 Original-Received: (at 11014) by debbugs.gnu.org; 15 Mar 2012 03:42:10 +0000 Original-Received: from localhost ([127.0.0.1]:51318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S81Zp-0006Gz-Ns for submit@debbugs.gnu.org; Wed, 14 Mar 2012 23:42:10 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:63712) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S81Zc-0006GQ-TB for 11014@debbugs.gnu.org; Wed, 14 Mar 2012 23:42:07 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AicFAKU/KE9soXdS/2dsb2JhbACBX5x7eYhwnhmGGQSbGYQJ X-IronPort-AV: E=Sophos;i="4.73,1,1325480400"; d="scan'208";a="168070795" Original-Received: from 108-161-119-82.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([108.161.119.82]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 14 Mar 2012 23:11:50 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 4C263AE2B3; Wed, 14 Mar 2012 23:11:48 -0400 (EDT) In-Reply-To: <20120314090534.66398623@nbtrap.com> (Nathan Trapuzzano's message of "Wed, 14 Mar 2012 09:05:34 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:57796 Archived-At: > Syntax highlighting in cperl-mode breaks for certain (or perhaps all) > complex regular expressions modified by /e and/or /x. I'm not familiar enough with cperl-mode's syntax fontification code to help fix it, but FWIW, your second example works right in perl-mode, and I've just fixed its code (with the patch below) so it also works right on your first example. Stefan === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-15 01:38:40 +0000 +++ lisp/ChangeLog 2012-03-15 03:09:10 +0000 @@ -1,5 +1,8 @@ 2012-03-15 Stefan Monnier + * progmodes/perl-mode.el (perl-syntax-propertize-special-constructs): + Fix up parsing of multiline twoarg non-paired elements (bug#11014). + * imenu.el: Fix multiple inheritance breakage (bug#9199). (imenu-add-to-menubar): Don't add a redundant index. (imenu-update-menubar): Handle a dynamically composed keymap. === modified file 'lisp/progmodes/perl-mode.el' --- lisp/progmodes/perl-mode.el 2012-01-19 07:21:25 +0000 +++ lisp/progmodes/perl-mode.el 2012-03-15 03:05:36 +0000 @@ -388,7 +388,11 @@ ;; In case of error, make sure we don't move backward. (scan-error (goto-char startpos) nil)) (not (or (nth 8 (parse-partial-sexp - (point) limit nil nil state 'syntax-table)) + ;; Since we don't know if point is within + ;; the first or the scond arg, we have to + ;; start from the beginning. + (if twoargs (1+ (nth 8 state)) (point)) + limit nil nil state 'syntax-table)) ;; If we have a self-paired opener and a twoargs ;; command, the form is s/../../ so we have to skip ;; a second time.