diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2008-02-06 15:06:53 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2008-02-06 15:06:53 -0800 |
commit | e62a2cf723b0a0830e066468c7a7cac4d3445136 (patch) | |
tree | a56b1f8495f93ac7a3af73c932806c120c9e5749 /src/cli_parse.y | |
parent | f9b13d3b2b8af1b7df64a2bd38dce543994d5e93 (diff) | |
download | vyatta-cfg-e62a2cf723b0a0830e066468c7a7cac4d3445136.tar.gz vyatta-cfg-e62a2cf723b0a0830e066468c7a7cac4d3445136.zip |
make parse error message more useful
Diffstat (limited to 'src/cli_parse.y')
-rw-r--r-- | src/cli_parse.y | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cli_parse.y b/src/cli_parse.y index fd472e9..6378bc9 100644 --- a/src/cli_parse.y +++ b/src/cli_parse.y @@ -7,6 +7,7 @@ #include "cli_val.h" extern int yy_cli_def_lineno; +extern char *yy_cli_def_text; static vtw_def *parse_defp; static int parse_status; static boolean cli_def_type_only=0; /*{ if (cli_def_type_only) YYACCEPT;}*/ @@ -197,8 +198,8 @@ int parse_def(vtw_def *defp, char *path, boolean type_only) static void cli_deferror(const char *s) { - printf("Error: %s in file %s, line %d\n",s, parse_path, - yy_cli_def_lineno); + printf("Error: %s in file [%s], line %d, last token [%s]\n",s, parse_path, + yy_cli_def_lineno, yy_cli_def_text); } void yy_cli_parse_error(const char *s) |