aboutsummaryrefslogtreecommitdiff
path: root/cibic.y
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2014-03-25 06:57:44 +0800
committerTeddy <ted.sybil@gmail.com>2014-03-25 06:57:44 +0800
commit79b8219a7b8a786740a6c57b2d819953bcf261de (patch)
treea0e81987d32f5748ff99de2c67dd543abd42417f /cibic.y
parent04ee9c8bef572f4351090b768413e5b6a3ac4a77 (diff)
verbose error reporting
Diffstat (limited to 'cibic.y')
-rw-r--r--cibic.y7
1 files changed, 5 insertions, 2 deletions
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