case st_none:
if (constantypedefs
&& structdef == snone
- && structtype == st_C_enum && bracelev > structbracelev)
+ && structtype == st_C_enum && bracelev > structbracelev
+ /* Don't tag tokens in expressions that assign values to enum
+ constants. */
+ && fvdef != vignore)
return true; /* enum constant */
switch (fvdef)
{
cpptoken = false;
}
if (cpptoken)
- definedef = dsharpseen;
+ {
+ definedef = dsharpseen;
+ /* This is needed for tagging enum values: when there are
+ preprocessor conditionals inside the enum, we need to
+ reset the value of fvdef so that the next enum value is
+ tagged even though the one before it did not end in a
+ comma. */
+ if (fvdef == vignore && instruct && parlev == 0)
+ {
+ if (strneq (cp, "#if", 3) || strneq (cp, "#el", 3))
+ fvdef = fvnone;
+ }
+ }
} /* if (definedef == dnone) */
continue;
case '[':
case fstartlist:
case finlist:
case fignore:
+ break;
case vignore:
+ if (instruct && parlev == 0)
+ fvdef = fvnone;
break;
case fdefunname:
fvdef = fignore;