GNU bug report logs -
#5388
23.1; syntactic analysis incorrect
Previous Next
Full log
View this message in rfc822 format
> 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'.
This bug report was last modified 13 years and 315 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.