1 // Copyright (c) 2016-2020 Dr. Colin Hirsch and Daniel Frey 2 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/ 3 4 #ifndef TAO_PEGTL_INTERNAL_DISCARD_HPP 5 #define TAO_PEGTL_INTERNAL_DISCARD_HPP 6 7 #include "../config.hpp" 8 9 #include "enable_control.hpp" 10 11 #include "../type_list.hpp" 12 13 namespace TAO_PEGTL_NAMESPACE::internal 14 { 15 struct discard 16 { 17 using rule_t = discard; 18 using subs_t = empty_list; 19 20 template< typename ParseInput > 21 [[nodiscard]] static bool match( ParseInput& in ) noexcept 22 { 23 static_assert( noexcept( in.discard() ) ); 24 in.discard(); 25 return true; 26 } 27 }; 28 29 template<> 30 inline constexpr bool enable_control< discard > = false; 31 32 } // namespace TAO_PEGTL_NAMESPACE::internal 33 34 #endif 35