/*
* This routine sets up the boolean psuedo-functions which work
- * by seting boolean flags dependent upon the corresponding character
+ * by setting boolean flags dependent upon the corresponding character
* Every char which is NOT in that string is not a white char. Therefore,
* all of the array "_wht" is set to FALSE, and then the elements
* subscripted by the chars in "white" are set to TRUE. Thus "_wht"
#define CNL_SAVE_DEFINEDEF \
{ \
+ quotednl = FALSE; \
prev_linepos = linepos; \
SET_FILEPOS (linepos, inf, charno); \
lineno++; \
int c_ext; /* extension of C? */
{
register int c; /* latest char read; '\0' for end of line */
- register int tokoff; /* offset in line of beginning of latest token */
+ register int tokoff; /* offset in line of start of latest token*/
register int toklen; /* length of latest token */
register char *lp; /* pointer one beyond the character `c' */
- logical incomm, inquote, inchar, midtoken;
+ logical incomm, inquote, inchar, quotednl, midtoken;
int level; /* current curly brace level */
char tokb[BUFSIZ];
*lp = 0;
definedef = dnone;
- gotone = midtoken = inquote = inchar = incomm = FALSE;
+ gotone = midtoken = inquote = inchar = incomm = quotednl = FALSE;
level = 0;
tydef = none;
next_token_is_func = 0;
'\0'; don't skip it, because it's the thing that tells us
to read the next line. */
if (*lp == 0)
- continue;
+ {
+ quotednl =TRUE;
+ continue;
+ }
lp++;
c = ' ';
}
if (structdef == stagseen)
structdef = scolonseen;
break;
- /* Not a struct definition when semicolon seen in non-sinbody context. */
+ /* Not a struct definition when semicolon seen
+ in non-sinbody context. */
case ';':
if (structdef != snone && structdef != sinbody)
{
lp = lp_tmp;
if (bingo)
{
- if (GET_CHARNO (tok.linestart) != GET_CHARNO (linepos)
+ if (GET_CHARNO (tok.linestart) != GET_CHARNO(linepos)
&& !tok_at_end_of_line)
{
/*
tok.p = lb1.buffer + (tok.p - tok_linebuf);
tok_linebuf = lb1.buffer;
}
- if (structdef == sinbody && definedef == dnone && is_func)
+ if (structdef == sinbody
+ && definedef == dnone && is_func)
{ /* function defined in C++ class body */
sprintf (tokb, "%s::%.*s",
structtag[0] == '\0' ? "_anonymous_"
midtoken = TRUE;
}
}
- /* Detect end of line, after having handled the last token on the line. */
+ /* Detect end of line, having handled the last token on the line. */
if (c == 0)
{
- if (incomm)
+ if (incomm || inquote || quotednl)
{
CNL_SAVE_DEFINEDEF;
}
logical
consider_token (c, lpp, tokp, is_func, c_ext, level)
reg char c; /* IN: first char after the token */
- char **lpp; /* IN OUT: *lpp points to 2nd char after the token */
+ char **lpp; /* IN OUT: *lpp points
+ to 2nd char after the token */
reg TOKEN *tokp; /* IN */
logical *is_func; /* OUT */
int c_ext; /* IN */
{
case st_C_struct:
case st_C_enum:
- if (tydef == begin || (typedefs_and_cplusplus && level == 0 && structdef == snone))
+ if (tydef == begin
+ || (typedefs_and_cplusplus && level == 0 && structdef == snone))
{
structdef = skeyseen;
structkey = tokse;
structdef = snone;
(void) strcpy (structtag, "<error 3>");
}
- /* Now what? And how does/should this stuff interact with tydef?? */
- /* Also maybe reset lp to *lpp for benefit of the function finding code. */
+ /* Now what? And how does/should this stuff interact with tydef?? */
+ /* Also maybe reset lp to *lpp for sake of function-finding code. */
}
if (tydef == begin)
{