[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] errors: indent "user token number redecl" context
From: |
Theophile Ranquet |
Subject: |
[PATCH] errors: indent "user token number redecl" context |
Date: |
Fri, 28 Sep 2012 12:12:59 +0000 |
This is the continuation of the work on the readability of errors
context.
For example, what used to be:
r.y:10.10-22: error: user token number 112 redeclaration for HEX_1
r.y:9.8-16: previous declaration for DECIMAL_1
is now:
r.y:10.10-22: error: user token number 112 redeclaration for HEX_1
r.y:9.8-16: previous declaration for DECIMAL_1
* src/symtab.c (user_token_number_redeclaration): Use
complain_at_indent to output with increased indentation level.
* tests/input:at: Apply this change.
---
src/symtab.c | 1 +
tests/input.at | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/symtab.c b/src/symtab.c
index 2e0b920..56cfe51 100644
--- a/src/symtab.c
+++ b/src/symtab.c
@@ -534,6 +534,7 @@ user_token_number_redeclaration (int num, symbol *first,
symbol *second)
complain_at_indent (second->location, &i,
_("user token number %d redeclaration for %s"),
num, second->tag);
+ i += SUB_INDENT;
complain_at_indent (first->location, &i,
_("previous declaration for %s"),
first->tag);
diff --git a/tests/input.at b/tests/input.at
index 50c1050..86a955d 100644
--- a/tests/input.at
+++ b/tests/input.at
@@ -693,9 +693,9 @@ start: DECIMAL_1 HEXADECIMAL_2;
AT_BISON_CHECK([redecl.y], [1], [],
[[redecl.y:10.10-22: error: user token number 11259375 redeclaration for
HEXADECIMAL_1
-redecl.y:9.8-16: previous declaration for DECIMAL_1
+redecl.y:9.8-16: previous declaration for DECIMAL_1
redecl.y:12.10-18: error: user token number 16702650 redeclaration for
DECIMAL_2
-redecl.y:11.10-22: previous declaration for HEXADECIMAL_2
+redecl.y:11.10-22: previous declaration for HEXADECIMAL_2
]])
AT_DATA_GRAMMAR([too-large.y],
--
1.7.11.4
- [PATCH] errors: indent "user token number redecl" context,
Theophile Ranquet <=