Keep sub-messages aligned. Fix strings for translation.

* src/location.h: (location_print): Add return value.
	* src/location.c: (location_print): Return number of printed
	characters.
	* src/complain.h: Two new functions (complain_at_indent,
	warn_at_indent).
	* src/complain.cpp: Implement the alignment mechanism. Add new
	static variable (indent_ptr). Use and update it (error_message,
	complain_at_indent, warn_at_indent).
	* src/scan-code.l: Fix strings for translations. Use new *_indent
	functions (parse_ref, show_sub_messages).
	* tests/named-ref.at: Adjust testcases.
	* NEWS (2.5): Add an announcement about named references.
This commit is contained in:
Alex Rozenman
2009-09-19 12:59:33 +03:00
parent d93b5f50cf
commit 348f560883
8 changed files with 208 additions and 94 deletions

View File

@@ -31,6 +31,13 @@ void warn (char const *format, ...)
void warn_at (location loc, char const *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
/* Generate a message aligned by an indent.
When *indent == 0, assign message's indent to *indent,
When *indent > 0, align the message by *indent value. */
void warn_at_indent (location loc, unsigned *indent,
char const *format, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
/** An error, but we continue and die later. */
void complain (char const *format, ...)
@@ -39,6 +46,13 @@ void complain (char const *format, ...)
void complain_at (location loc, char const *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
/* Generate a message aligned by an indent.
When *indent == 0, assign message's indent to *indent,
When *indent > 0, align the message by *indent value. */
void complain_at_indent (location loc, unsigned *indent,
char const *format, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
/** An incompatibility with POSIX Yacc: mapped either to warn* or
complain* depending on yacc_flag. */