unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* cperl-mode:  paren-bounce vs (dQuotes in regexps)
@ 2004-07-27  5:21 David Combs
  0 siblings, 0 replies; 2+ messages in thread
From: David Combs @ 2004-07-27  5:21 UTC (permalink / raw)




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?


Thanks!

David

^ permalink raw reply	[flat|nested] 2+ messages in thread

* re:  cperl-mode:  paren-bounce vs (dQuotes in regexps)
       [not found] <200407270848.i6R8mNF25697@maui.ebi.ac.uk>
@ 2004-07-27 15:48 ` Pablo Marin Garcia
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Marin Garcia @ 2004-07-27 15:48 UTC (permalink / raw)



Probably is a problem with your version of cperl. It works for me  for 
the external parents. 
 I am using the cperl that 
comes with emacs windows 21.2.x (I am not sure of the cperl version but 
the last history line contains: "After 4.31:"). 


Your line only fails in the internal pair broken by the doublequote

(\s+boundary="--) 

my Cperl is unable to match any of this parents.

-- David Combs wrote --



> 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 "(".

>Suggestions on how to handle this?


>Thanks!
>David


.             /   __   \                      /   __   \
          \  |  ///\\\  |  /              \  |  ///\\\  |  /
           \ \_((####))_/ /                \ \_((####))_/ /
            \__ ((##)) __/                  \__ ((##)) __/
               / |||| \                        / |||| \
             / |  oo  | \                    / |  oo  | \
            |  |  !!  |  |                  |  |  !!  |  |
                \    /            \\|//         \    /
                                  (o o)
. .-.   .-. .-.   .-. .-.   .-oOOo~(_)~oOOo-.   .-. .-.   .-. .-.
|X|||\ /|||X|||\ /|||X|||\ /|||X|||\ /|||X|||\ /|||X|||\ /|||X|||\
/ \|||X|||/ \|||X|||/ \|||X|||/ \|||X|||/ \|||X|||/ \|||X|||/ \|||
   `-' `-'   `-' `-'   `-' `-'   `-' `-'   `-' `-'   `-' `-'   `-'

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-07-27 15:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200407270848.i6R8mNF25697@maui.ebi.ac.uk>
2004-07-27 15:48 ` cperl-mode: paren-bounce vs (dQuotes in regexps) Pablo Marin Garcia
2004-07-27  5:21 David Combs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).