changed UnGetChar() to ChPushBack() in domacro.c
This commit is contained in:
parent
369a99fe3a
commit
abcaa3e669
|
@ -336,7 +336,8 @@ do_define()
|
||||||
/* read the replacement text if there is any */
|
/* read the replacement text if there is any */
|
||||||
ch = skipspaces(ch,0); /* find first character of the text */
|
ch = skipspaces(ch,0); /* find first character of the text */
|
||||||
ASSERT(ch != EOI);
|
ASSERT(ch != EOI);
|
||||||
UnGetChar();
|
/* UngetChar() is not right when replacement starts with a '/' */
|
||||||
|
ChPushBack(ch);
|
||||||
repl_text = get_text((nformals > 0) ? formals : 0, &length);
|
repl_text = get_text((nformals > 0) ? formals : 0, &length);
|
||||||
macro_def(id, repl_text, nformals, length, NOFLAG);
|
macro_def(id, repl_text, nformals, length, NOFLAG);
|
||||||
LineNumber++;
|
LineNumber++;
|
||||||
|
@ -626,11 +627,10 @@ get_text(formals, length)
|
||||||
c = GetChar();
|
c = GetChar();
|
||||||
if (c == '*') {
|
if (c == '*') {
|
||||||
skipcomment();
|
skipcomment();
|
||||||
if(blank++) add2repl(repl, ' ');
|
if (!blank++) add2repl(repl, ' ');
|
||||||
c = GetChar();
|
c = GetChar();
|
||||||
continue;
|
continue;
|
||||||
}
|
} else add2repl(repl, '/');
|
||||||
else add2repl(repl, '/');
|
|
||||||
} else if (formals
|
} else if (formals
|
||||||
&& (class(c) == STIDF || class(c) == STELL)) {
|
&& (class(c) == STIDF || class(c) == STELL)) {
|
||||||
char id_buf[IDFSIZE + 1];
|
char id_buf[IDFSIZE + 1];
|
||||||
|
|
|
@ -347,7 +347,8 @@ do_define()
|
||||||
/* read the replacement text if there is any */
|
/* read the replacement text if there is any */
|
||||||
ch = skipspaces(ch,0); /* find first character of the text */
|
ch = skipspaces(ch,0); /* find first character of the text */
|
||||||
assert(ch != EOI);
|
assert(ch != EOI);
|
||||||
UnGetChar();
|
/* UngetChar() is not right when replacement starts with a '/' */
|
||||||
|
ChPushBack(ch);
|
||||||
repl_text = get_text((nformals > 0) ? formals : 0, &length);
|
repl_text = get_text((nformals > 0) ? formals : 0, &length);
|
||||||
macro_def(str2idf(str, 0), repl_text, nformals, length, NOFLAG);
|
macro_def(str2idf(str, 0), repl_text, nformals, length, NOFLAG);
|
||||||
LineNumber++;
|
LineNumber++;
|
||||||
|
|
Loading…
Reference in a new issue