Subject: bug#5388: 23.1; syntactic analysis incorrect

From: Chong Yidong <[email-masked]>
Date: Sat, 16 Jan 2010 16:00:14 -0500

> A switch statement with two case labels, at least one of which is a
> character constant, causes the syntactic analysis of the first
> statement in the case block to be evaluated as statement-cont instead
> of statement-case-intro.
>
> I believe the line 'x = 1;' should be evaluated as
> statement-case-into, but it is being evaluated as statement-cont.
>
> switch (x)
>   {
>   case 'a':
>   case 'b':
>     x = 1;
>   y = 2;
>   break;
>   }

Thanks for the bug report, but it does not contain enough information
for us to do anything.  I assume you are referring to C mode.  However,
if I paste your snippet into a fresh foo.c and call M-x
c-syntactic-information-on-region, I get the following:

switch (x)			/* ((topmost-intro 1)) */
  {				/* ((substatement-open 1)) */
  case 'a':			/* ((case-label 42)) */
  case 'b':			/* ((case-label 42)) */
    x = 1;			/* ((statement-case-intro 117)) */
  y = 2;			/* ((statement 157)) */
  break;			/* ((statement 203)) */
  }				/* ((block-close 42)) */

As you can see, the snippet is correctly parsed.

Please provide an exact, step-by-step recipe for reproducing this bug,
starting with `emacs -Q'.