c++: fix several issues with locations

Reported by Daniel Frużyński.
http://lists.gnu.org/archive/html/bug-bison/2013-02/msg00000.html

* data/location.cc (position::columns, position::lines): Check for
underflow.
Fix some weird function signatures.
(location): Accept signed integers as arguments where appropriate.
Add operator- and operator+=.
* doc/bison.texi (C++ position, C++ location): Various fixes
and completion.
* tests/c++.at (C++ Locations): New tests.
This commit is contained in:
Akim Demaille
2013-04-11 09:53:18 +02:00
parent 08cc1a3b18
commit 75ae829984
5 changed files with 119 additions and 31 deletions

5
NEWS
View File

@@ -569,6 +569,11 @@ GNU Bison NEWS
...
}
*** C++ locations
There are operator- and operator-= for 'location'. Negative line/column
increments can no longer underflow the resulting value.
* Noteworthy changes in release ?.? (????-??-??) [?]
** Bug fixes