summaryrefslogtreecommitdiff
path: root/lib/command_parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'lib/command_parse.y')
-rw-r--r--lib/command_parse.y5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/command_parse.y b/lib/command_parse.y
index cf87ca1042..01fc01d302 100644
--- a/lib/command_parse.y
+++ b/lib/command_parse.y
@@ -310,6 +310,11 @@ option_token:
void yyerror(char const *message) {
// fail on bad parse
fprintf(stderr, "Grammar error: %s\n", message);
+ fprintf(stderr, "Token on error: ");
+ if (yylval.string) fprintf(stderr, "%s\n", yylval.string);
+ else if (yylval.node) fprintf(stderr, "%s\n", yylval.node->text);
+ else fprintf(stderr, "%d\n", yylval.integer);
+
}
struct graph_node *