[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cperl-mode: paren-bounce vs (dQuotes in regexps)

From: David Combs
Subject: cperl-mode: paren-bounce vs (dQuotes in regexps)
Date: 27 Jul 2004 01:21:12 -0400

Subject: cperl-mode:  paren-bounce vs (dQuotes in regexps)

(emacs 21.2)

      $gBoundaryTag = $2 if (  $gCurLine m/^(\s+boundary="--)([0-9]+)"$/ );

Under text-mode, the above bounces fine -- leftmost "(" vs rightmost ")".

But not under cperl-mode (try it) -- you'll get the rightmost ")" matching
   the 2nd-from-the-left "(".

Just to play around, I removed all double-quotes:
      $gBoundaryTag = $2 if (  $gCurLine m/^(\s+boundary=--)([0-9]+)$/ );
, and it worked fine.

Here, I tried wrapping each dquote within a char-class (hoping that
doing so would "hide" it):
      $gBoundaryTag = $2 if (  $gCurLine m/^(\s+boundary=["]--)([0-9]+)["]$/ );
, but nope, no such luck.  Same (incorrect) matching as in the original.

Mismatching on the paren-bouncing hurts, since I (and everyone else,
I'm sure) like to rely on the paren-bouncing for detecting coding-errors.

Suggestions on how to handle this?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]