MCPcopy Create free account
hub / github.com/URLab-Sim/UnrealRoboticsLab / _expand_stride

Function _expand_stride

Scripts/codegen/generate_ue_components.py:2532–2549  ·  view source on GitHub ↗

Convert mjxmacro stride expressions to plain C++ expressions usable in MjBind.h. ``MJ_M(nuser_jnt)`` -> ``m->nuser_jnt``. Fires a diagnostic if any ``MJ_*(...)`` macro survives the substitution — that's an unhandled stride shape we'd otherwise silently emit into MjBind.h verbatim.

(stride: str)

Source from the content-addressed store, hash-verified

2530 block_label=f"subtype '{sub_key}' import block",
2531 diag_source="multi_uclass_inject",
2532 )
2533 c_text, _ = _inject_or_diag(
2534 c_text, f"SUBCLASS_{type_tag}_EXPORT", emitted.exports_cpp,
2535 host_path=source_path, host_kind="multi_uclass base source",
2536 block_label=f"subtype '{sub_key}' export block",
2537 diag_source="multi_uclass_inject",
2538 )
2539
2540 # Rewrite the merged writes (drop stale base writes; replace with merged).
2541 writes = [w for w in writes if w.path != header_path and w.path != source_path]
2542 writes.append(FileWrite(path=header_path, content=h_text))
2543 if os.path.exists(source_path) or c_text:
2544 writes.append(FileWrite(path=source_path, content=c_text))
2545 return writes
2546
2547
2548# ---------------------------------------------------------------------------
2549# Pipeline: view structs
2550# ---------------------------------------------------------------------------
2551
2552_VIEW_FIELD_TYPE_MAP = {

Callers 1

emit_view_structsFunction · 0.85

Calls 1

_diag_addFunction · 0.90

Tested by

no test coverage detected