(self, src)
Parses mj*.h, update self.enums_dict.
Parses mj*.h, update self.enums_dict.
Parses mj * . h update self . enums_dict .
def parse_enums(self, src):
    """Parses mj*.h, update self.enums_dict."""
    parser = header_parsing.ENUM_DECL
    for tokens, _, _ in parser.scanString(src):
      for enum in tokens:
        members = codegen_util.UniqueOrderedDict()
        value = 0
        for member in enum.members:
          # Leftward bitshift
          if member.bit_lshift_a:
            value = int(member.bit_lshift_a) << int(member.bit_lshift_b)
          # Assignment
          elif member.value:
            value = int(member.value)
          # Implicit count
          else:
            value += 1
          members.update({member.name: value})
        self.enums_dict.update({enum.name: members})
def parse_enums ( self , src ) : parser = header_parsing . ENUM_DECL for tokens , _ , _ in parser . scanString ( src ) : for enum in tokens : members = codegen_util . UniqueOrderedDict ( ) value = 0 for member in enum . members : # Leftward bitshift if member . bit_lshift_a : value = int ( member . bit_lshift_a ) << int ( member . bit_lshift_b ) # Assignment elif member . value : value = int ( member . value ) # Implicit count else : value += 1 members . update ( { member . name : value } ) self . enums_dict . update ( { enum . name : members } )