code: def digit():
      '''Parse a digit character.'''
      @Parser
      def digit_parser(text, index=0):
          if index < len(text) and text[index].isdigit():
              return Value.success(index + 1, text[index])
          else:
              return Value.failure(index, 'a digit')
      return digit_parsef digit():
      '''Parse a digit character.'''
      @Parser
      def digit_parser(text, index=0):
          if index < len(text) and text[index].isdigit():
              return Value.success(index + 1, text[index])
          else:
              return Value.failure(index, 'a digit')
      return digit_parser
docs: Parse a digit character.