Improved switches, and fixed wrong place indication in error messages

This commit is contained in:
ceriel
1991-03-01 13:51:37 +00:00
parent 9d3696befe
commit bd1da2f86c
6 changed files with 34 additions and 18 deletions

View File

@@ -115,7 +115,7 @@ domacro()
the arguments.
*/
if (GetToken(&tk) != INTEGER) {
error("bad #line syntax");
lexerror("bad #line syntax");
SkipToNewLine();
}
else
@@ -303,17 +303,17 @@ do_include()
if (((tok = GetToken(&tk)) == FILESPECIFIER) || tok == STRING)
filenm = tk.tk_bts;
else {
error("bad include syntax");
lexerror("bad include syntax");
filenm = (char *)0;
}
AccFileSpecifier = 0;
if (SkipToNewLine()) {
error("bad include syntax");
lexerror("bad include syntax");
}
inctable[0] = WorkingDir;
if (filenm) {
if (!InsertFile(filenm, &inctable[tok==FILESPECIFIER],&result)){
error("cannot open include file \"%s\"", filenm);
lexerror("cannot open include file \"%s\"", filenm);
add_dependency(filenm);
}
else {
@@ -535,7 +535,7 @@ getparams(buf, parbuf)
*/
for (pbuf2 = pbuf - 1; pbuf2 >= &buf[0]; pbuf2--) {
if (!strcmp(*pbuf2, *pbuf)) {
error("formal parameter \"%s\" already used",
lexerror("formal parameter \"%s\" already used",
*pbuf);
}
}
@@ -781,7 +781,7 @@ domacro()
EoiForNewline = 0;
return;
}
error("illegal # line");
lexerror("illegal # line");
EoiForNewline = 0;
SkipToNewLine();
}