c++: locations: complete the API and fix comments

There are no support for += between locations, and some comments are wrong.
Reported by Alexandre Duret-Lutz.

* data/location.cc: Fix.
* doc/bison.texi: Document.
* tests/c++.at: Check.
This commit is contained in:
Akim Demaille
2015-01-05 18:20:28 +01:00
parent 478c4a8f49
commit 56351d4c7b
3 changed files with 34 additions and 16 deletions

View File

@@ -10686,12 +10686,17 @@ The first, inclusive, position of the range, and the first beyond.
Forwarded to the @code{end} position.
@end deftypemethod
@deftypemethod {location} {location} operator+ (const location& @var{end})
@deftypemethodx {location} {location} operator+ (int @var{width})
@deftypemethod {location} {location} operator+ (int @var{width})
@deftypemethodx {location} {location} operator+= (int @var{width})
@deftypemethodx {location} {location} operator- (int @var{width})
@deftypemethodx {location} {location} operator- (int @var{width})
@deftypemethodx {location} {location} operator-= (int @var{width})
Various forms of syntactic sugar.
Various forms of syntactic sugar for @code{columns}.
@end deftypemethod
@deftypemethod {location} {location} operator+ (const location& @var{end})
@deftypemethodx {location} {location} operator+= (const location& @var{end})
Join two locations: starts at the position of the first one, and ends at the
position of the second.
@end deftypemethod
@deftypemethod {location} {void} step ()