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

25
NEWS
View File

@@ -3,6 +3,31 @@ Bison News
* Changes in version 2.5 (????-??-??):
** Named References Support
Historically, Yacc and Bison have supported positional references
($n, $$) to allow access to symbol values from inside of semantic
actions code.
Starting from this version, Bison can also accept named references.
When no ambiguity is possible, original symbol names may be used
as named references:
if_stmt : 'if' cond_expr 'then' then_stmt ';'
{ $if_stmt = mk_if_stmt($cond_expr, $then_stmt); }
In the more common case, explicit names may be declared:
stmt[res] : 'if' expr[cond] 'then' stmt[then] 'else' stmt[else] ';'
{ $res = mk_if_stmt($cond, $then, $else); }
Location information is also accessible using @name syntax. When
accessing symbol names containing dots or dashes, explicit bracketing
($[sym.1]) must be used.
These features are experimental in this version. More user feedback
will help to stabilize them.
** IELR(1) and Canonical LR(1) Support
IELR(1) is a minimal LR(1) parser table generation algorithm. That