Skip to content

Commit 345cb7e

Browse files
committed
Update PEGTL, fix #140, fix #144.
1 parent 0242c8c commit 345cb7e

27 files changed

+72
-86
lines changed

external/PEGTL

Submodule PEGTL updated 429 files

include/tao/json/cbor/consume_file.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#ifndef TAO_JSON_CBOR_CONSUME_FILE_HPP
55
#define TAO_JSON_CBOR_CONSUME_FILE_HPP
66

7-
#include <tao/pegtl/file_input.hpp>
7+
#include <filesystem>
88

9-
#include "../internal/filesystem.hpp"
9+
#include <tao/pegtl/file_input.hpp>
1010

1111
#include "../consume.hpp"
1212
#include "../forward.hpp"
@@ -16,14 +16,14 @@
1616
namespace tao::json::cbor
1717
{
1818
template< typename T, template< typename... > class Traits = traits >
19-
[[nodiscard]] T consume_file( const json::internal::filesystem::path& path )
19+
[[nodiscard]] T consume_file( const std::filesystem::path& path )
2020
{
2121
cbor::basic_parts_parser< utf8_mode::check, 8, pegtl::file_input< pegtl::tracking_mode::lazy > > pp( path );
2222
return json::consume< T, Traits >( pp );
2323
}
2424

2525
template< template< typename... > class Traits = traits, typename T >
26-
void consume_file( const json::internal::filesystem::path& path, T& t )
26+
void consume_file( const std::filesystem::path& path, T& t )
2727
{
2828
cbor::basic_parts_parser< utf8_mode::check, 8, pegtl::file_input< pegtl::tracking_mode::lazy > > pp( path );
2929
json::consume< Traits >( pp, t );

include/tao/json/cbor/events/from_file.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
#ifndef TAO_JSON_CBOR_EVENTS_FROM_FILE_HPP
55
#define TAO_JSON_CBOR_EVENTS_FROM_FILE_HPP
66

7+
#include <filesystem>
8+
79
#include <tao/pegtl/file_input.hpp>
810
#include <tao/pegtl/parse.hpp>
911

10-
#include "../../internal/filesystem.hpp"
11-
1212
#include "../internal/grammar.hpp"
1313

1414
namespace tao::json::cbor::events
1515
{
1616
// Events producer to parse a file containing a CBOR string representation.
1717

1818
template< typename Consumer >
19-
void from_file( Consumer& consumer, const json::internal::filesystem::path& path )
19+
void from_file( Consumer& consumer, const std::filesystem::path& path )
2020
{
2121
pegtl::file_input< pegtl::tracking_mode::lazy > in( path );
2222
pegtl::parse< internal::grammar >( in, consumer );

include/tao/json/cbor/from_file.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@
44
#ifndef TAO_JSON_CBOR_FROM_FILE_HPP
55
#define TAO_JSON_CBOR_FROM_FILE_HPP
66

7+
#include <filesystem>
78
#include <utility>
89

910
#include "../events/to_value.hpp"
1011
#include "../events/transformer.hpp"
11-
#include "../internal/filesystem.hpp"
1212

1313
#include "events/from_file.hpp"
1414

1515
namespace tao::json::cbor
1616
{
1717
template< template< typename... > class Traits, template< typename... > class... Transformers >
18-
[[nodiscard]] basic_value< Traits > basic_from_file( const json::internal::filesystem::path& path )
18+
[[nodiscard]] basic_value< Traits > basic_from_file( const std::filesystem::path& path )
1919
{
2020
json::events::transformer< json::events::to_basic_value< Traits >, Transformers... > consumer;
2121
events::from_file( consumer, path );
2222
return std::move( consumer.value );
2323
}
2424

2525
template< template< typename... > class... Transformers >
26-
[[nodiscard]] value from_file( const json::internal::filesystem::path& path )
26+
[[nodiscard]] value from_file( const std::filesystem::path& path )
2727
{
2828
return basic_from_file< traits, Transformers... >( path );
2929
}

include/tao/json/cbor/parts_parser.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ namespace tao::json::cbor
375375

376376
[[nodiscard]] auto mark()
377377
{
378-
return m_input.template mark< pegtl::rewind_mode::required >();
378+
return m_input.template auto_rewind< pegtl::rewind_mode::required >();
379379
}
380380

381381
template< typename T >

include/tao/json/consume_file.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#ifndef TAO_JSON_CONSUME_FILE_HPP
55
#define TAO_JSON_CONSUME_FILE_HPP
66

7-
#include <tao/pegtl/file_input.hpp>
7+
#include <filesystem>
88

9-
#include "internal/filesystem.hpp"
9+
#include <tao/pegtl/file_input.hpp>
1010

1111
#include "consume.hpp"
1212
#include "forward.hpp"
@@ -15,14 +15,14 @@
1515
namespace tao::json
1616
{
1717
template< typename T, template< typename... > class Traits = traits >
18-
[[nodiscard]] T consume_file( const internal::filesystem::path& path )
18+
[[nodiscard]] T consume_file( const std::filesystem::path& path )
1919
{
2020
basic_parts_parser< pegtl::file_input< pegtl::tracking_mode::lazy > > pp( path );
2121
return consume< T, Traits >( pp );
2222
}
2323

2424
template< template< typename... > class Traits = traits, typename T >
25-
void consume_file( const internal::filesystem::path& path, T& t )
25+
void consume_file( const std::filesystem::path& path, T& t )
2626
{
2727
basic_parts_parser< pegtl::file_input< pegtl::tracking_mode::lazy > > pp( path );
2828
consume< Traits >( pp, t );

include/tao/json/contrib/position.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
#ifndef TAO_JSON_CONTRIB_POSITION_HPP
55
#define TAO_JSON_CONTRIB_POSITION_HPP
66

7+
#include <filesystem>
78
#include <ostream>
89
#include <string>
910
#include <type_traits>
1011
#include <utility>
1112

1213
#include "../events/to_value.hpp"
1314
#include "../events/transformer.hpp"
14-
#include "../internal/filesystem.hpp"
1515

1616
#include "../from_file.hpp"
1717
#include "../message_extension.hpp"
@@ -147,7 +147,7 @@ namespace tao::json
147147
};
148148

149149
template< template< typename... > class Traits, template< typename... > class... Transformers >
150-
[[nodiscard]] auto basic_from_file_with_position( const internal::filesystem::path& path )
150+
[[nodiscard]] auto basic_from_file_with_position( const std::filesystem::path& path )
151151
{
152152
events::transformer< events::to_basic_value< Traits >, Transformers... > consumer;
153153
pegtl::file_input< pegtl::tracking_mode::eager > in( path );
@@ -156,7 +156,7 @@ namespace tao::json
156156
}
157157

158158
template< template< typename... > class... Transformers >
159-
[[nodiscard]] auto from_file_with_position( const internal::filesystem::path& path )
159+
[[nodiscard]] auto from_file_with_position( const std::filesystem::path& path )
160160
{
161161
return basic_from_file_with_position< make_position_traits< traits >::template type, Transformers... >( path );
162162
}

include/tao/json/events/from_file.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
#ifndef TAO_JSON_EVENTS_FROM_FILE_HPP
55
#define TAO_JSON_EVENTS_FROM_FILE_HPP
66

7+
#include <filesystem>
8+
79
#include "../internal/action.hpp"
810
#include "../internal/errors.hpp"
9-
#include "../internal/filesystem.hpp"
1011
#include "../internal/grammar.hpp"
1112

1213
#include <tao/pegtl/file_input.hpp>
@@ -17,7 +18,7 @@ namespace tao::json::events
1718
// Events producer to parse a file containing a JSON string representation.
1819

1920
template< typename Consumer >
20-
void from_file( Consumer& consumer, const internal::filesystem::path& path )
21+
void from_file( Consumer& consumer, const std::filesystem::path& path )
2122
{
2223
pegtl::file_input< pegtl::tracking_mode::lazy > in( path );
2324
pegtl::parse< internal::grammar, internal::action, internal::errors >( in, consumer );

include/tao/json/from_file.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@
44
#ifndef TAO_JSON_FROM_FILE_HPP
55
#define TAO_JSON_FROM_FILE_HPP
66

7+
#include <filesystem>
78
#include <utility>
89

910
#include "events/from_file.hpp"
1011
#include "events/to_value.hpp"
1112
#include "events/transformer.hpp"
12-
#include "internal/filesystem.hpp"
1313

1414
namespace tao::json
1515
{
1616
template< template< typename... > class Traits, template< typename... > class... Transformers >
17-
[[nodiscard]] basic_value< Traits > basic_from_file( const internal::filesystem::path& path )
17+
[[nodiscard]] basic_value< Traits > basic_from_file( const std::filesystem::path& path )
1818
{
1919
events::transformer< events::to_basic_value< Traits >, Transformers... > consumer;
2020
events::from_file( consumer, path );
2121
return std::move( consumer.value );
2222
}
2323

2424
template< template< typename... > class... Transformers >
25-
[[nodiscard]] value from_file( const internal::filesystem::path& path )
25+
[[nodiscard]] value from_file( const std::filesystem::path& path )
2626
{
2727
return basic_from_file< traits, Transformers... >( path );
2828
}

include/tao/json/internal/filesystem.hpp

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)