From 50924944274d43149267cd9238625e40b46bbfeb Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 9 Sep 2014 19:35:54 +0100 Subject: Add support for target column preservation Fixes #64 --- src/coord.hh | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/coord.hh') diff --git a/src/coord.hh b/src/coord.hh index f60be779..dbae5001 100644 --- a/src/coord.hh +++ b/src/coord.hh @@ -99,6 +99,19 @@ struct CharCoord : LineAndColumn : LineAndColumn(line, column) {} }; +struct ByteCoordAndTarget : ByteCoord +{ + [[gnu::always_inline]] + constexpr ByteCoordAndTarget(LineCount line = 0, ByteCount column = 0, CharCount target = -1) + : ByteCoord(line, column), target(target) {} + + [[gnu::always_inline]] + constexpr ByteCoordAndTarget(ByteCoord coord, CharCount target = -1) + : ByteCoord(coord), target(target) {} + + CharCount target; +}; + } #endif // coord_hh_INCLUDED -- cgit v1.2.3