(self, xmacro_src)
Parses mjxmacro.h, update self.hints_dict.
Parses mjxmacro.h, update self.hints_dict.
Parses mjxmacro . h update self . hints_dict .
def parse_hints(self, xmacro_src):
    """Parses mjxmacro.h, update self.hints_dict."""
    parser = header_parsing.XMACRO
    for tokens, _, _ in parser.scanString(xmacro_src):
      for xmacro in tokens:
        for member in xmacro.members:
          # "Squeeze out" singleton dimensions.
          shape = self.get_shape_tuple(member.dims, squeeze=True)
          self.hints_dict.update({member.name: shape})

          if codegen_util.is_macro_pointer(xmacro.name):
            struct_name = codegen_util.macro_struct_name(xmacro.name)
            if struct_name not in self.index_dict:
              self.index_dict[struct_name] = {}

            self.index_dict[struct_name].update({member.name: shape})
def parse_hints ( self , xmacro_src ) : parser = header_parsing . XMACRO for tokens , _ , _ in parser . scanString ( xmacro_src ) : for xmacro in tokens : for member in xmacro . members : # "Squeeze out" singleton dimensions. shape = self . get_shape_tuple ( member . dims , squeeze = True ) self . hints_dict . update ( { member . name : shape } ) if codegen_util . is_macro_pointer ( xmacro . name ) : struct_name = codegen_util . macro_struct_name ( xmacro . name ) if struct_name not in self . index_dict : self . index_dict [ struct_name ] = { } self . index_dict [ struct_name ] . update ( { member . name : shape } )