5b5114fd377cd50d1af59af46d6842ba3420b3cb kent Wed Aug 7 17:35:17 2019 -0700 Making an error message less file-focused in parser. diff --git src/lib/tokenizer.c src/lib/tokenizer.c index 9dfdc59..875cd59 100644 --- src/lib/tokenizer.c +++ src/lib/tokenizer.c @@ -180,37 +180,37 @@ void tokenizerErrAbort(struct tokenizer *tkz, char *format, ...) /* Print error message followed by file and line number and * abort. */ { va_list args; va_start(args, format); vaWarn(format, args); errAbort("line %d of %s:\n%s", tokenizerLineCount(tkz), tokenizerFileName(tkz), tkz->curLine); } void tokenizerNotEnd(struct tokenizer *tkz) /* Squawk if at end. */ { if (tkz->eof) - errAbort("Unexpected end of file"); + errAbort("Unexpected end of input %s", tkz->lf->fileName); } char *tokenizerMustHaveNext(struct tokenizer *tkz) /* Get next token, which must be there. */ { char *s = tokenizerNext(tkz); if (s == NULL) - errAbort("Unexpected end of file"); + errAbort("Unexpected end of input %s", tkz->lf->fileName); return s; } void tokenizerMustMatch(struct tokenizer *tkz, char *string) /* Require next token to match string. Return next token * if it does, otherwise abort. */ { if (sameWord(tkz->string, string)) tokenizerMustHaveNext(tkz); else tokenizerErrAbort(tkz, "Expecting %s got %s", string, tkz->string); }