diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-12-27 00:52:33 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-12-27 00:52:33 +0200 |
commit | d18d2687d74b27583e3d09e3ff719f1e073c1732 (patch) | |
tree | 0b71cf114fea604a5b9a0611d1ba4c9a2b2f898c /src | |
parent | add57c075c6f747a81c142ab48d59106de822664 (diff) | |
download | grecs-d18d2687d74b27583e3d09e3ff719f1e073c1732.tar.gz grecs-d18d2687d74b27583e3d09e3ff719f1e073c1732.tar.bz2 |
Improve error reporting.
Diffstat (limited to 'src')
-rw-r--r-- | src/grecs-lex.l | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/grecs-lex.l b/src/grecs-lex.l index 329c725..52a15ef 100644 --- a/src/grecs-lex.l +++ b/src/grecs-lex.l | |||
@@ -382,7 +382,8 @@ grecs_parse_line_directive(char *text, grecs_locus_t *ploc, | |||
382 | struct wordsplit ws; | 382 | struct wordsplit ws; |
383 | 383 | ||
384 | if (wordsplit(text, &ws, WRDSF_DEFFLAGS)) | 384 | if (wordsplit(text, &ws, WRDSF_DEFFLAGS)) |
385 | grecs_error(ploc, 0, _("cannot parse #line line")); | 385 | grecs_error(ploc, 0, _("cannot parse #line line: %s"), |
386 | wordsplit_strerror(&ws)); | ||
386 | else { | 387 | else { |
387 | if (ws.ws_wordc == 2) | 388 | if (ws.ws_wordc == 2) |
388 | rc = assign_locus(ppoint, NULL, | 389 | rc = assign_locus(ppoint, NULL, |
@@ -418,7 +419,8 @@ grecs_parse_line_directive_cpp(char *text, grecs_locus_t *ploc, | |||
418 | struct wordsplit ws; | 419 | struct wordsplit ws; |
419 | 420 | ||
420 | if (wordsplit(text, &ws, WRDSF_DEFFLAGS)) { | 421 | if (wordsplit(text, &ws, WRDSF_DEFFLAGS)) { |
421 | grecs_error(ploc, 0, _("cannot parse #line line")); | 422 | grecs_error(ploc, 0, _("cannot parse #line line: %s"), |
423 | wordsplit_strerror(&ws)); | ||
422 | return; | 424 | return; |
423 | } else if (ws.ws_wordc < 3) | 425 | } else if (ws.ws_wordc < 3) |
424 | grecs_error(ploc, 0, _("invalid #line statement")); | 426 | grecs_error(ploc, 0, _("invalid #line statement")); |