<commit_before>// Copyright (c) 2014-2015 Dr. <NAME> and <NAME>
// Please see LICENSE for license or visit https://github.com/ColinH/PEGTL/

#ifndef PEGTL_INTERNAL_RULE_MATCH_TWO_HH
#define PEGTL_INTERNAL_RULE_MATCH_TWO_HH

#include <cstdlib>

#include "../apply_mode.hh"

#include "apply_here.hh"
#include "rule_match_three.hh"

namespace pegtl
{
   namespace internal
   {
      template< typename Rule, apply_mode A, template< typename ... > class Action, template< typename ... > class Control, apply_here H > struct rule_match_two;

      template< typename Rule, apply_mode A, template< typename ... > class Action, template< typename ... > class Control >
      struct rule_match_two< Rule, A, Action, Control, apply_here::NOTHING >
      {
         template< typename Input, typename ... States >
         static bool match( Input & in, States && ... st )
         {
            Control< Rule >::start( static_cast< const Input & >( in ), st ... );

            if ( rule_match_three< Rule, A, Action, Control >::match( in, st ... ) ) {
               Control< Rule >::success( static_cast< const Input & >( in ), st ... );
               return true;
            }
            Control< Rule >::failure( static_cast< const Input & >( in ), st ... );
            return false;
         }
      };

      template< typename Rule, apply_mode A, template< typename ... > class Action, template< typename ... > class Control >
      struct rule_match_two< Rule, A, Action, Control, apply_here::ACTION >
      {
         template< typename Input, typename ... States >
         static bool match( Input & in, States && ... st )
         {
            auto m = in.mark();

            Control< Rule >::start( static_cast< const Input & >( in ), st ... );

            if ( rule_match_three< Rule, A, Action, Control >::match( in, st ... ) ) {
               Control< Rule >::success( static_cast< const Input & >( in ), st ... );
               Action< Rule >::apply( Input( m ), st ... );
               return m( true );
            }
            Control< Rule >::failure( static_cast< const Input & >( in ), st ... );
            return false;
         }
      };

   } // internal

} // pegtl

#endif<commit_msg>Simplified, reduce ACTION to NOTHING case<commit_after>// Copyright (c) 2014-2015 Dr. <NAME> and <NAME>
// Please see LICENSE for license or visit https://github.com/ColinH/PEGTL/

#ifndef PEGTL_INTERNAL_RULE_MATCH_TWO_HH
#define PEGTL_INTERNAL_RULE_MATCH_TWO_HH

#include <cstdlib>

#include "../apply_mode.hh"

#include "apply_here.hh"
#include "rule_match_three.hh"

namespace pegtl
{
   namespace internal
   {
      template< typename Rule, apply_mode A, template< typename ... > class Action, template< typename ... > class Control, apply_here H > struct rule_match_two;

      template< typename Rule, apply_mode A, template< typename ... > class Action, template< typename ... > class Control >
      struct rule_match_two< Rule, A, Action, Control, apply_here::NOTHING >
      {
         template< typename Input, typename ... States >
         static bool match( Input & in, States && ... st )
         {
            Control< Rule >::start( static_cast< const Input & >( in ), st ... );
            if ( rule_match_three< Rule, A, Action, Control >::match( in, st ... ) ) {
               Control< Rule >::success( static_cast< const Input & >( in ), st ... );
               return true;
            }
            Control< Rule >::failure( static_cast< const Input & >( in ), st ... );
            return false;
         }
      };

      template< typename Rule, apply_mode A, template< typename ... > class Action, template< typename ... > class Control >
      struct rule_match_two< Rule, A, Action, Control, apply_here::ACTION >
      {
         template< typename Input, typename ... States >
         static bool match( Input & in, States && ... st )
         {
            auto m = in.mark();
            if ( rule_match_two< Rule, A, Action, Control, apply_here::NOTHING >::match( in, st ... ) ) {
               Action< Rule >::apply( Input( m ), st ... );
               return m( true );
            }
            return false;
         }
      };

   } // internal

} // pegtl

#endif
{'fraction_non_alphanumeric': 0.13538461538461538, 'fraction_numerical': 0.00378698224852071, 'mean_word_length': 2.091441111923921, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 59, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6697273', 'n_tokens_mistral': 1253, 'n_tokens_neox': 1188, 'n_words': 381}