UnGetChar call is wrong after skipspaces().
/* read the replacement text if there is any */
ch = skipspaces(ch,0); /* find first character of the text */
ASSERT(ch != EOI);
- /* UngetChar() is not right when replacement starts with a '/' */
+ /* UnGetChar() is not right when replacement starts with a '/' */
ChPushBack(ch);
repl_text = get_text((nformals > 0) ? formals : 0, &length);
macro_def(id, repl_text, nformals, length, NOFLAG);
ch = GetChar();
ch = skipspaces(ch,1);
if (ch != '(') { /* no replacement if no () */
- UnGetChar();
+ ChPushBack(ch);
return 0;
} else
getactuals(repl, idf);
if ((class(ch) != STIDF) && (class(ch) != STELL)) {
error("identifier missing");
if (parens && ch != ')') error(") missing");
- if (!parens || ch != ')') UnGetChar();
+ if (!parens || ch != ')') ChPushBack(ch);
add2repl(repl, '0');
return;
}
- UnGetChar();
+ ChPushBack(ch);
id = GetIdentifier(0);
ASSERT(id || class(ch) == STELL);
ch = GetChar();
ch = skipspaces(ch, 0);
if (parens && ch != ')') error(") missing");
- if (!parens || ch != ')') UnGetChar();
+ if (!parens || ch != ')') ChPushBack(ch);
add2repl(repl, (id && id->id_macro) ? '1' : '0');
add2repl(repl, ' ');
}
/* read the replacement text if there is any */
ch = skipspaces(ch,0); /* find first character of the text */
assert(ch != EOI);
- /* UngetChar() is not right when replacement starts with a '/' */
+ /* UnGetChar() is not right when replacement starts with a '/' */
ChPushBack(ch);
repl_text = get_text((nformals > 0) ? formals : 0, &length);
macro_def(str2idf(str, 0), repl_text, nformals, length, NOFLAG);
ch = GetChar();
ch = skipspaces(ch,1);
if (ch != '(') { /* no replacement if no () */
- UnGetChar();
+ ChPushBack(ch);
return 0;
} else
getactuals(repl, idf);
if ((class(ch) != STIDF) && (class(ch) != STELL)) {
error("identifier missing");
if (parens && ch != ')') error(") missing");
- if (!parens || ch != ')') UnGetChar();
+ if (!parens || ch != ')') ChPushBack(ch);
add2repl(repl,'0');
return;
}
- UnGetChar();
+ ChPushBack(ch);
str = GetIdentifier(0);
if (str) {
id = findidf(str);
ch = GetChar();
ch = skipspaces(ch, 0);
if (parens && ch != ')') error(") missing");
- if (!parens || ch != ')') UnGetChar();
+ if (!parens || ch != ')') ChPushBack(ch);
add2repl(repl, (id && id->id_macro) ? '1' : '0');
add2repl(repl, ' ');
}