parameters: (self)
docstring: Check if the member conforms to nyan grammar rules. Also does
          a bunch of type checks.
docstring_summary: Check if the member conforms to nyan grammar rules. Also does
          a bunch of type checks.
docstring_tokens: Check if the member conforms to nyan grammar rules . Also does a bunch of type checks .
function: def _sanity_check(self):
          """
          Check if the member conforms to nyan grammar rules. Also does
          a bunch of type checks.
          """
          # self.name must be a string
          if not isinstance(self.name, str):
              raise Exception(f"{repr(self)}: 'name' must be a string")
  
          # self.name must conform to nyan grammar rules
          if not re.fullmatch(r"[a-zA-Z_][a-zA-Z0-9_]*", self.name[0]):
              raise Exception(f"{repr(self)}: 'name' is not well-formed")
  
          if (self.is_initialized() and not self.is_inherited()) or\
                  (self.is_inherited() and self.has_value()):
              # override depth must be a non-negative integer
              if not (isinstance(self._override_depth, int) and
                      self._override_depth >= 0):
                  raise Exception(f"{repr(self)}: override depth must be a non-negative integer")
  
              # Check if operator type matches with member type
              if not self._member_type.accepts_op(self._operator):
                  raise Exception((
                      f"{repr(self)}: {self._operator} is not a valid"
                      f"operator for member type {self._member_type}"
                  ))
  
              # Check if value is compatible with member type
              if not self._member_type.accepts_value(self.value):
                  raise Exception(f"{repr(self)}: value '{self.value}' is not compatible "
                                  f"with type '{self._member_type}'")
function_tokens: def _sanity_check ( self ) : # self.name must be a string if not isinstance ( self . name , str ) : raise Exception ( f"{repr(self)}: 'name' must be a string" ) # self.name must conform to nyan grammar rules if not re . fullmatch ( r"[a-zA-Z_][a-zA-Z0-9_]*" , self . name [ 0 ] ) : raise Exception ( f"{repr(self)}: 'name' is not well-formed" ) if ( self . is_initialized ( ) and not self . is_inherited ( ) ) or ( self . is_inherited ( ) and self . has_value ( ) ) : # override depth must be a non-negative integer if not ( isinstance ( self . _override_depth , int ) and self . _override_depth >= 0 ) : raise Exception ( f"{repr(self)}: override depth must be a non-negative integer" ) # Check if operator type matches with member type if not self . _member_type . accepts_op ( self . _operator ) : raise Exception ( ( f"{repr(self)}: {self._operator} is not a valid" f"operator for member type {self._member_type}" ) ) # Check if value is compatible with member type if not self . _member_type . accepts_value ( self . value ) : raise Exception ( f"{repr(self)}: value '{self.value}' is not compatible " f"with type '{self._member_type}'" )