LoadChar(ch);
}
/* read the replacement text if there is any */
- ch = skipspaces(ch); /* find first character of the text */
+ ch = skipspaces(ch,0); /* find first character of the text */
ASSERT(ch != EOI);
if (class(ch) == STNL) {
/* Treat `#define something' as `#define something ""'
register char **pbuf2;
LoadChar(c);
- c = skipspaces(c);
+ c = skipspaces(c,0);
if (c == ')') { /* no parameters: #define name() */
*pbuf = (char *) 0;
return 0;
}
pbuf++;
- c = skipspaces(c);
+ c = skipspaces(c,0);
if (c == ')') { /* end of the formal parameter list */
*pbuf = (char *) 0;
return pbuf - buf;
return -1;
}
LoadChar(c);
- c = skipspaces(c);
+ c = skipspaces(c,0);
}
/*NOTREACHED*/
}
return 0;
}
LoadChar(c);
- c = skipspaces(c);
+ c = skipspaces(c,1);
if (c != '(') { /* no replacement if no () */
lexerror("(warning) macro %s needs arguments",
idef->id_text);
#ifndef NOPP
PRIVATE int
-skipspaces(ch)
+skipspaces(ch, skipnl)
register int ch;
{
/* skipspaces() skips any white space and returns the first
non-space character.
*/
for (;;) {
- while (class(ch) == STSKIP)
+ while (class(ch) == STSKIP || (skipnl && class(ch) == STNL))
LoadChar(ch);
/* How about "\\\n"????????? */
LoadChar(ch);
}
/* read the replacement text if there is any */
- ch = skipspaces(ch); /* find first character of the text */
+ ch = skipspaces(ch,0); /* find first character of the text */
assert(ch != EOI);
if (class(ch) == STNL) {
/* Treat `#define something' as `#define something ""'
register char **pbuf2;
LoadChar(c);
- c = skipspaces(c);
+ c = skipspaces(c,0);
if (c == ')') { /* no parameters: #define name() */
*pbuf = (char *) 0;
return 0;
}
pbuf++;
- c = skipspaces(c);
+ c = skipspaces(c,0);
if (c == ')') { /* end of the formal parameter list */
*pbuf = (char *) 0;
return pbuf - buf;
return -1;
}
LoadChar(c);
- c = skipspaces(c);
+ c = skipspaces(c,0);
}
/*NOTREACHED*/
}
return 0;
}
LoadChar(c);
- c = skipspaces(c);
+ c = skipspaces(c,1);
if (c != '(') { /* no replacement if no () */
error("macro %s needs arguments",
idef->id_text);
#include "input.h"
int
-skipspaces(ch)
+skipspaces(ch, skipnl)
register int ch;
{
/* skipspaces() skips any white space and returns the first
for (;;) {
while (class(ch) == STSKIP)
LoadChar(ch);
+ if (skipnl && class(ch) == STNL) {
+ LoadChar(ch);
+ ++LineNumber;
+ continue;
+ }
/* How about "\\\n"????????? */
if (ch == '/') {
LoadChar(ch);