Add nullable attribute to AST nodes for function parameters in API introspection. Fixes #309
This change introduces an `nullable` flag to `ArrayType`, `PointerType`, and `FunctionParameterDecl`. The code generation process now parses function comments from `mujoco.h` to identify parameters marked as "Nullable" and sets this flag accordingly. PiperOrigin-RevId: 797870883 Change-Id: Ic7cac5a7a9c14177fbf97b8655c5c4809d4ef683
This commit is contained in:
committed by
Copybara-Service
parent
3dec35a91e
commit
ecfe65242f
@@ -57,7 +57,7 @@ class FunctionsTest(absltest.TestCase):
|
||||
name='oldpos', type=type_parsing.parse_type('const mjtNum[3]')),
|
||||
ast_nodes.FunctionParameterDecl(
|
||||
name='rotnew2old',
|
||||
type=type_parsing.parse_type('const mjtNum[9]'))))
|
||||
type=type_parsing.parse_type('const mjtNum[9]'), nullable=True)))
|
||||
self.assertEqual(
|
||||
func_decl.doc, 'Coordinate transform of 6D motion or force vector in ' +
|
||||
'rotation:translation format. rotnew2old is 3-by-3, ' +
|
||||
|
||||
Reference in New Issue
Block a user