Skip to content

Commit d0c4109

Browse files
committed
Update embedded PEGTL
1 parent 10e1a79 commit d0c4109

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@
3232

3333
namespace TAO_JSON_PEGTL_NAMESPACE::parse_tree
3434
{
35-
template< typename T >
35+
template< typename T, typename Source = std::string_view >
3636
struct basic_node
3737
{
3838
using node_t = T;
3939
using children_t = std::vector< std::unique_ptr< node_t > >;
4040
children_t children;
4141

4242
std::string_view type;
43-
std::string source;
43+
Source source;
4444

4545
TAO_JSON_PEGTL_NAMESPACE::internal::iterator m_begin;
4646
TAO_JSON_PEGTL_NAMESPACE::internal::iterator m_end;
@@ -67,7 +67,8 @@ namespace TAO_JSON_PEGTL_NAMESPACE::parse_tree
6767
template< typename U >
6868
[[nodiscard]] bool is_type() const noexcept
6969
{
70-
return type == demangle< U >();
70+
const auto u = demangle< U >();
71+
return ( ( type.data() == u.data() ) && ( type.size() == u.size() ) ) || ( type == u );
7172
}
7273

7374
template< typename U >

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
#include <ciso646>
88
#include <string_view>
99

10-
namespace tao
10+
#include "config.hpp"
11+
12+
namespace TAO_JSON_PEGTL_NAMESPACE
1113
{
1214
#if defined( __clang__ )
1315

@@ -133,6 +135,6 @@ namespace tao
133135

134136
#endif
135137

136-
} // namespace tao
138+
} // namespace TAO_JSON_PEGTL_NAMESPACE
137139

138140
#endif

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ namespace TAO_JSON_PEGTL_NAMESPACE
5555
source( std::forward< T >( in_source ) )
5656
{}
5757

58+
template< typename T >
59+
position( const std::size_t in_byte, const std::size_t in_line, const std::size_t in_column, T&& in_source )
60+
: byte( in_byte ),
61+
line( in_line ),
62+
column( in_column ),
63+
source( in_source )
64+
{}
65+
5866
~position() = default;
5967

6068
std::size_t byte;

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

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

7-
#define TAO_JSON_PEGTL_VERSION "3.1.0"
7+
#define TAO_JSON_PEGTL_VERSION "3.1.1"
88

99
#define TAO_JSON_PEGTL_VERSION_MAJOR 3
1010
#define TAO_JSON_PEGTL_VERSION_MINOR 1
11-
#define TAO_JSON_PEGTL_VERSION_PATCH 0
11+
#define TAO_JSON_PEGTL_VERSION_PATCH 1
1212

1313
#endif

0 commit comments

Comments
 (0)