Skip to content

Commit d2b363f

Browse files
committed
Update PEGTL to final 2.0.0
1 parent 750603a commit d2b363f

39 files changed

+201
-457
lines changed

include/tao/json/external/pegtl.hpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#define TAOCPP_JSON_PEGTL_INCLUDE_PEGTL_HPP
66

77
#include "pegtl/config.hpp"
8+
#include "pegtl/version.hpp"
89

910
#include "pegtl/ascii.hpp"
1011
#include "pegtl/parse.hpp"
@@ -13,21 +14,18 @@
1314
#include "pegtl/utf32.hpp"
1415
#include "pegtl/utf8.hpp"
1516

16-
#include "pegtl/parse.hpp"
17-
17+
#include "pegtl/argv_input.hpp"
1818
#include "pegtl/buffer_input.hpp"
19+
#include "pegtl/cstream_input.hpp"
1920
#include "pegtl/file_input.hpp"
21+
#include "pegtl/istream_input.hpp"
2022
#include "pegtl/memory_input.hpp"
2123
#include "pegtl/read_input.hpp"
22-
#include "pegtl/stream_input.hpp"
2324
#include "pegtl/string_input.hpp"
2425

25-
// The following files can be included whenever needed; they
26-
// are not included by default because they include a stream header
27-
// like <iostream> or <sstream>.
26+
// The following are not included by
27+
// default because they include <iostream>.
2828

29-
// #include "pegtl/argv_input.hpp"
3029
// #include "pegtl/analyze.hpp"
31-
// #include "pegtl/tracer.hpp"
3230

3331
#endif

include/tao/json/external/pegtl/analyze.hpp

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

7-
#include "analysis/analyze_cycles.hpp"
87
#include "config.hpp"
98

9+
#include "analysis/analyze_cycles.hpp"
10+
1011
namespace tao
1112
{
1213
namespace TAOCPP_JSON_PEGTL_NAMESPACE

include/tao/json/external/pegtl/argv_input.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace tao
2929

3030
} // namespace internal
3131

32-
template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = lf_crlf_eol >
32+
template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = eol::lf_crlf >
3333
struct argv_input
3434
: public memory_input< P, Eol >
3535
{

include/tao/json/external/pegtl/ascii.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#define TAOCPP_JSON_PEGTL_INCLUDE_ASCII_HPP
66

77
#include "config.hpp"
8+
#include "eol.hpp"
9+
810
#include "internal/result_on_found.hpp"
911
#include "internal/rules.hpp"
1012

@@ -20,7 +22,6 @@ namespace tao
2022
struct any : internal::any< internal::peek_char > {};
2123
struct blank : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, ' ', '\t' > {};
2224
struct digit : internal::range< internal::result_on_found::SUCCESS, internal::peek_char, '0', '9' > {};
23-
struct eol : internal::eol {};
2425
struct eolf : internal::eolf {};
2526
struct identifier_first : internal::identifier_first {};
2627
struct identifier_other : internal::identifier_other {};

include/tao/json/external/pegtl/buffer_input.hpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace tao
2424
{
2525
namespace TAOCPP_JSON_PEGTL_NAMESPACE
2626
{
27-
template< typename Reader, typename Eol = lf_crlf_eol, typename Source = std::string >
27+
template< typename Reader, typename Eol = eol::lf_crlf, typename Source = std::string >
2828
class buffer_input
2929
{
3030
public:
@@ -36,17 +36,16 @@ namespace tao
3636

3737
using iterator_t = internal::iterator;
3838

39-
using memory_t = memory_input< tracking_mode::IMMEDIATE, Eol, Source >;
40-
using action_t = internal::action_input< buffer_input, tracking_mode::IMMEDIATE >;
39+
using action_t = internal::action_input< buffer_input >;
4140

42-
template< typename... As >
43-
buffer_input( Source in_source, const std::size_t maximum, As&&... as )
41+
template< typename T, typename... As >
42+
buffer_input( T&& in_source, const std::size_t maximum, As&&... as )
4443
: m_reader( std::forward< As >( as )... ),
4544
m_maximum( maximum ),
4645
m_buffer( new char[ maximum ] ),
47-
m_current( { 0, 1, 0, m_buffer.get() } ),
46+
m_current( m_buffer.get() ),
4847
m_end( m_buffer.get() ),
49-
m_source( std::move( in_source ) )
48+
m_source( std::forward< T >( in_source ) )
5049
{
5150
}
5251

@@ -149,12 +148,12 @@ namespace tao
149148
return internal::marker< iterator_t, M >( m_current );
150149
}
151150

152-
TAOCPP_JSON_PEGTL_NAMESPACE::position position( const iterator_t& it ) const noexcept
151+
TAOCPP_JSON_PEGTL_NAMESPACE::position position( const iterator_t& it ) const
153152
{
154153
return TAOCPP_JSON_PEGTL_NAMESPACE::position( it, m_source );
155154
}
156155

157-
TAOCPP_JSON_PEGTL_NAMESPACE::position position() const noexcept
156+
TAOCPP_JSON_PEGTL_NAMESPACE::position position() const
158157
{
159158
return position( m_current );
160159
}

include/tao/json/external/pegtl/config.hpp

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

7-
#include "version.hpp"
8-
97
#ifndef TAOCPP_JSON_PEGTL_NAMESPACE
108
#define TAOCPP_JSON_PEGTL_NAMESPACE json_pegtl
119
#endif
1210

11+
// Enable some improvements to the readability of
12+
// demangled type names under some circumstances.
13+
// #define TAOCPP_JSON_PEGTL_PRETTY_DEMANGLE
14+
1315
#endif

include/tao/json/external/pegtl/contrib/http.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace tao
2121

2222
// This grammar is a direct PEG translation of the original HTTP grammar.
2323
// It should be considered experimental -- in case of any issues, in particular
24-
// missing anchor rules for actions, please contact the developers.
24+
// missing rules for attached actions, please contact the developers.
2525

2626
using namespace abnf;
2727

include/tao/json/external/pegtl/contrib/uri.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace tao
2121

2222
// This grammar is a direct PEG translation of the original URI grammar.
2323
// It should be considered experimental -- in case of any issues, in particular
24-
// missing anchor rules for actions, please contact the developers.
24+
// missing rules for attached actions, please contact the developers.
2525

2626
// Note that this grammar has multiple top-level rules.
2727

include/tao/json/external/pegtl/cr_crlf_eol.hpp

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

include/tao/json/external/pegtl/cr_eol.hpp

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

0 commit comments

Comments
 (0)