From 6bdd4c4355efad1f709f4c08f97bf3f3326bd13d Mon Sep 17 00:00:00 2001 From: Daniel Frey Date: Tue, 3 Sep 2019 23:10:27 +0200 Subject: [PATCH] Update embedded PEGTL --- .../tao/json/external/pegtl/internal/one.hpp | 31 ++----------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/include/tao/json/external/pegtl/internal/one.hpp b/include/tao/json/external/pegtl/internal/one.hpp index 99fcf80d..50112ffb 100644 --- a/include/tao/json/external/pegtl/internal/one.hpp +++ b/include/tao/json/external/pegtl/internal/one.hpp @@ -4,8 +4,7 @@ #ifndef TAO_JSON_PEGTL_INTERNAL_ONE_HPP #define TAO_JSON_PEGTL_INTERNAL_ONE_HPP -#include -#include +#include #include "../config.hpp" @@ -17,12 +16,6 @@ namespace TAO_JSON_PEGTL_NAMESPACE::internal { - template< typename Char > - [[nodiscard]] bool contains( const Char c, const std::initializer_list< Char >& l ) noexcept - { - return std::find( l.begin(), l.end(), c ) != l.end(); - } - template< result_on_found R, typename Peek, typename Peek::data_t... Cs > struct one { @@ -33,7 +26,7 @@ namespace TAO_JSON_PEGTL_NAMESPACE::internal { if( const std::size_t s = in.size( Peek::max_input_size ); s >= Peek::min_input_size ) { if( const auto t = Peek::peek( in, s ) ) { - if( contains( t.data, { Cs... } ) == bool( R ) ) { + if( ( ( t.data == Cs ) || ... ) == bool( R ) ) { bump_help< R, Input, typename Peek::data_t, Cs... >( in, t.size ); return true; } @@ -43,26 +36,6 @@ namespace TAO_JSON_PEGTL_NAMESPACE::internal } }; - template< result_on_found R, typename Peek, typename Peek::data_t C > - struct one< R, Peek, C > - { - using analyze_t = analysis::generic< analysis::rule_type::any >; - - template< typename Input > - [[nodiscard]] static bool match( Input& in ) noexcept( noexcept( in.size( Peek::max_input_size ) ) ) - { - if( const std::size_t s = in.size( Peek::max_input_size ); s >= Peek::min_input_size ) { - if( const auto t = Peek::peek( in, s ) ) { - if( ( t.data == C ) == bool( R ) ) { - bump_help< R, Input, typename Peek::data_t, C >( in, t.size ); - return true; - } - } - } - return false; - } - }; - template< result_on_found R, typename Peek, typename Peek::data_t... Cs > inline constexpr bool skip_control< one< R, Peek, Cs... > > = true;