summaryrefslogtreecommitdiff
path: root/lib/command_parse.y
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2016-08-01 17:03:39 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2016-08-01 17:03:39 +0000
commit1a8c390d4abc7c3f599813ddee6ca3990de7576c (patch)
treee7a7978f6423049e91b5de4183804d13a2b78f38 /lib/command_parse.y
parent6d53a10e4cf873ff61a3dada644d15be83dd54c0 (diff)
lib: Fixed bad node copy, modified token regex
When building argv for matched command, only the last node was being copied to argv; the rest were added by reference. Additionally the regex for certain tokens was too restrictive and disallowed characters allowed by the old parser; these have been reinstated. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
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 *