[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Matching programming language identifiers, not "words"
From: |
Jim Blandy |
Subject: |
Re: Matching programming language identifiers, not "words" |
Date: |
24 May 2004 16:03:46 -0500 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
Tim Van Holder <address@hidden> writes:
> >Here's the patch --- please test it. Once we've got some positive
> >reports on it, I think it'll be ready to go in.
> >
> >
> >*** src/regex.c.~2~ 2004-04-29 15:56:53.000000000 -0500
> >--- src/regex.c 2004-04-29 17:44:24.000000000 -0500
> >***************
> >*** 1095,1100 ****
> >--- 1098,1110 ----
> > case wordend:
> > printf ("/wordend");
> > + case symbeg:
> >+ printf ("/symbeg");
> >+ break;
> > + + case symend:
> >+ printf ("/symend");
> > + case syntaxspec:
> > printf ("/syntaxspec");
> > mcnt = *p++;
> >
>
> This part seems suspect - I don't think the fall-through from wordend
> to symbeg is intentional.
> You may need to combine wordend and symend so both will fall through
> to syntaxspec (which
> I assume is the intended behaviour).
Thanks for reviewing this. Actually, none of the fallthroughs are
expected behavior. wordend is a completely distinct opcode from
syntaxspec, and takes no operands, so it doesn't make any sense for
control to fall through.
Here's a patch against the current sources; it also addresses some
other mismatches.
2004-05-24 Jim Blandy <address@hidden>
* regex.c (print_partial_compiled_pattern): Add missing 'break'
after 'case wordend'. For symbeg and symend, print to stderr,
like the other cases.
Index: src/regex.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/regex.c,v
retrieving revision 1.191
diff -c -p -r1.191 regex.c
*** src/regex.c 19 May 2004 16:37:35 -0000 1.191
--- src/regex.c 24 May 2004 20:59:28 -0000
*************** print_partial_compiled_pattern (start, e
*** 1096,1108 ****
case wordend:
fprintf (stderr, "/wordend");
case symbeg:
! printf ("/symbeg");
break;
case symend:
! printf ("/symend");
break;
case syntaxspec:
--- 1096,1109 ----
case wordend:
fprintf (stderr, "/wordend");
+ break;
case symbeg:
! fprintf (stderr, "/symbeg");
break;
case symend:
! fprintf (stderr, "/symend");
break;
case syntaxspec:
- Matching programming language identifiers, not "words", Tim Van Holder, 2004/05/18
- Re: Matching programming language identifiers, not "words", Eli Zaretskii, 2004/05/18
- Re: Matching programming language identifiers, not "words", Tim Van Holder, 2004/05/18
- Re: Matching programming language identifiers, not "words", Jim Blandy, 2004/05/18
- Re: Matching programming language identifiers, not "words", Tim Van Holder, 2004/05/19
- Re: Matching programming language identifiers, not "words", Stefan Monnier, 2004/05/19
- Re: Matching programming language identifiers, not "words", Richard Stallman, 2004/05/20
- Re: Matching programming language identifiers, not "words",
Jim Blandy <=
- Re: Matching programming language identifiers, not "words", Stefan Monnier, 2004/05/28
Re: Matching programming language identifiers, not "words", Richard Stallman, 2004/05/18