Skip to content

Commit 1fdd67c

Browse files
authored
let print_to_stream also print the end of a source region (#244)
1 parent d00dd1f commit 1fdd67c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

include/toml++/impl/print_to_stream.inl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,11 @@ TOML_IMPL_NAMESPACE_START
419419
void TOML_CALLCONV print_to_stream(std::ostream & stream, const source_region& val)
420420
{
421421
print_to_stream(stream, val.begin);
422+
if (val.begin != val.end)
423+
{
424+
print_to_stream(stream, " to "sv);
425+
print_to_stream(stream, val.end);
426+
}
422427
if (val.path)
423428
{
424429
print_to_stream(stream, " of '"sv);

toml.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10694,6 +10694,11 @@ TOML_IMPL_NAMESPACE_START
1069410694
void TOML_CALLCONV print_to_stream(std::ostream & stream, const source_region& val)
1069510695
{
1069610696
print_to_stream(stream, val.begin);
10697+
if (val.begin != val.end)
10698+
{
10699+
print_to_stream(stream, " to "sv);
10700+
print_to_stream(stream, val.end);
10701+
}
1069710702
if (val.path)
1069810703
{
1069910704
print_to_stream(stream, " of '"sv);

0 commit comments

Comments
 (0)