Add convenience methods to CodeBuilder and cleanup some WASM bindings code generation

PiperOrigin-RevId: 827916844
Change-Id: Ie382f2a5af3d7e3ec2c81cde5d6b768835da2365
This commit is contained in:
Matija Kecman
2025-11-04 05:02:03 -08:00
committed by Copybara-Service
parent 740afe22b3
commit 4b79a58fa0
5 changed files with 624 additions and 726 deletions
+2 -4
View File
@@ -190,8 +190,7 @@ class FunctionUtilsTest(absltest.TestCase):
result = functions.generate_function_wrapper(func)
self.assertEqual(
result,
"""int get_id_wrapper()
{
"""int get_id_wrapper() {
return get_id();
}""",
)
@@ -218,8 +217,7 @@ class FunctionUtilsTest(absltest.TestCase):
result = functions.generate_function_wrapper(func)
self.assertEqual(
result,
"""int get_id_wrapper(const NumberArray& mat, int nr)
{
"""int get_id_wrapper(const NumberArray& mat, int nr) {
UNPACK_ARRAY(mjtNum, mat);
return get_id(mat_.data(), nr);
}""",