From 79b8219a7b8a786740a6c57b2d819953bcf261de Mon Sep 17 00:00:00 2001 From: Teddy Date: Tue, 25 Mar 2014 06:57:44 +0800 Subject: verbose error reporting --- cibic.y | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cibic.y') diff --git a/cibic.y b/cibic.y index bbe7375..ada0306 100644 --- a/cibic.y +++ b/cibic.y @@ -7,7 +7,7 @@ char *strval; struct CNode *cnode; } - +%error-verbose %token IDENTIFIER INT_CONST CHAR_CONST STR_CONST %token KW_VOID KW_CHAR KW_INT KW_STRUCT KW_UNION KW_IF KW_ELSE KW_WHILE %token KW_FOR KW_CONT KW_BREAK KW_RET KW_SIZEOF @@ -161,7 +161,10 @@ jump_statement expression : assignment_expression - | expression ',' assignment_expression { $$ = cnode_create_exp(',', 2, $1, $3); } + | expression ',' assignment_expression { + printf("%d, %d\n", @$.first_line, @$.first_column); + $$ = cnode_create_exp(',', 2, $1, $3); + } assignment_expression : logical_or_expression -- cgit v1.2.3