Commit 0bae9c50 authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

print line number in compile error messages

parent 89e31b58
......@@ -2914,8 +2914,12 @@ yyerror(parser_state *p, const char *s)
size_t n;
if (! p->capture_errors) {
fputs(s, stderr);
fputs("\n", stderr);
if (p->filename) {
fprintf(stderr, "%s:%d:%d: %s\n", p->filename, p->lineno, p->column, s);
}
else {
fprintf(stderr, "line %d:%d: %s\n", p->lineno, p->column, s);
}
}
else if (p->nerr < sizeof(p->error_buffer) / sizeof(p->error_buffer[0])) {
n = strlen(s);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment