From 86faa4ece6876c9ee89e631552785cd1a46e106f Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Sat, 27 Oct 2012 14:13:15 +0200 Subject: Improve syntax error messages by outputting the error token --- runtime/rsconf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/rsconf.c') diff --git a/runtime/rsconf.c b/runtime/rsconf.c index ad588832..dcaa1ad9 100644 --- a/runtime/rsconf.c +++ b/runtime/rsconf.c @@ -67,6 +67,7 @@ #include "dirty.h" #include "template.h" +extern char* yytext; /* static data */ DEFobjStaticHelpers DEFobjCurrIf(ruleset) @@ -390,7 +391,7 @@ parser_errmsg(char *fmt, ...) int yyerror(char *s) { - parser_errmsg("%s", s); + parser_errmsg("%s on token '%s'", s, yytext); return 0; } void cnfDoObj(struct cnfobj *o) -- cgit v1.2.3