some fixes, f.i. process # in actual parameter list
This commit is contained in:
parent
b9bb251d60
commit
7255b1aa61
|
@ -81,6 +81,7 @@ preprocess(fn)
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (c & 0200) {
|
if (c & 0200) {
|
||||||
if (c == EOI) {
|
if (c == EOI) {
|
||||||
|
newline();
|
||||||
flush(op-_obuf);
|
flush(op-_obuf);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -102,6 +103,7 @@ preprocess(fn)
|
||||||
echo(c);
|
echo(c);
|
||||||
}
|
}
|
||||||
else if (c == EOI) {
|
else if (c == EOI) {
|
||||||
|
newline();
|
||||||
flush(op - _obuf);
|
flush(op - _obuf);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -149,6 +151,7 @@ preprocess(fn)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (c == EOI) {
|
else if (c == EOI) {
|
||||||
|
newline();
|
||||||
flush(op-_obuf);
|
flush(op-_obuf);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -161,8 +164,7 @@ preprocess(fn)
|
||||||
}
|
}
|
||||||
else if (c == '\'') escaped = 1;
|
else if (c == '\'') escaped = 1;
|
||||||
}
|
}
|
||||||
}
|
} while (escaped || c != stopc);
|
||||||
while (escaped || c != stopc);
|
|
||||||
echo(c);
|
echo(c);
|
||||||
if (c == '\n')
|
if (c == '\n')
|
||||||
break; /* Don't eat # */
|
break; /* Don't eat # */
|
||||||
|
|
|
@ -67,7 +67,7 @@ replace(idef)
|
||||||
LoadChar(c);
|
LoadChar(c);
|
||||||
c = skipspaces(c,1);
|
c = skipspaces(c,1);
|
||||||
if (c != '(') { /* no replacement if no () */
|
if (c != '(') { /* no replacement if no () */
|
||||||
error("macro %s needs arguments",
|
warning("macro %s needs arguments",
|
||||||
idef->id_text);
|
idef->id_text);
|
||||||
PushBack();
|
PushBack();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -16,12 +16,17 @@ skipspaces(ch, skipnl)
|
||||||
/* skipspaces() skips any white space and returns the first
|
/* skipspaces() skips any white space and returns the first
|
||||||
non-space character.
|
non-space character.
|
||||||
*/
|
*/
|
||||||
|
register int nlseen = 0;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
while (class(ch) == STSKIP)
|
while (class(ch) == STSKIP) {
|
||||||
|
nlseen = 0;
|
||||||
LoadChar(ch);
|
LoadChar(ch);
|
||||||
|
}
|
||||||
if (skipnl && class(ch) == STNL) {
|
if (skipnl && class(ch) == STNL) {
|
||||||
LoadChar(ch);
|
LoadChar(ch);
|
||||||
++LineNumber;
|
++LineNumber;
|
||||||
|
nlseen++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* How about "\\\n"????????? */
|
/* How about "\\\n"????????? */
|
||||||
|
@ -36,7 +41,13 @@ skipspaces(ch, skipnl)
|
||||||
return '/';
|
return '/';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (nlseen && ch == '#') {
|
||||||
|
domacro();
|
||||||
|
LoadChar(ch);
|
||||||
|
/* ch is the first character of a line. This means
|
||||||
|
* that nlseen will still be true.
|
||||||
|
*/
|
||||||
|
} else
|
||||||
return ch;
|
return ch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue