d: change YYLocation's type from class to struct

This avoids heap allocation and gives minimal costs for the
creation and destruction of the YYParser.Symbol struct if
the location tracking is active.

Suggested by H. S. Teoh.

* data/skeletons/lalr1.d: Here.
* doc/bison.texi: Document it.
* examples/d/calc/calc.y: Adjust.
* tests/calc.at: Test it.
This commit is contained in:
Adela Vais
2020-11-19 23:03:56 +02:00
committed by Akim Demaille
parent 10305f3e94
commit e5854bbddd
4 changed files with 34 additions and 38 deletions

View File

@@ -13844,8 +13844,8 @@ can be used to print the semantic values. This however may change
@c - class Location
When the directive @code{%locations} is used, the D parser supports
location tracking, see @ref{Tracking Locations}. The position
structure and the location class are provided.
location tracking, see @ref{Tracking Locations}. The position and
the location structures are provided.
@deftypeivar {YYLocation} {YYPosition} begin
@deftypeivarx {YYLocation} {YYPosition} end