Skip to content

ze: stop doubling the zex namespace in class names - #538

Open
TApplencourt wants to merge 1 commit into
develfrom
ze-zex-class-names
Open

ze: stop doubling the zex namespace in class names#538
TApplencourt wants to merge 1 commit into
develfrom
ze-zex-class-names

Conversation

@TApplencourt

Copy link
Copy Markdown
Collaborator

Before we where generating: ZEXZexWaitOnMemDesc.

Every other namespace drops its prefix from the class name, because the
class already carries it: zet_metric_properties_t -> ZETMetricProperties.
zex was left out of the strip pattern, so its four classes kept the
prefix and then had it added again -- ZEXZexWaitOnMemDesc.

The comment said this was on purpose because it "is what the generated
bindings already spell", which describes the output rather than giving a
reason for it.

With x added, the strip pattern and the namespace pattern say the same
thing twice, so there is one left: the prefix that names a type's
namespace is the prefix a class name drops. The capture group the
namespace lookup needs is ignored by the strip's sub.

The rename reaches the two places that must agree with it or
pretty-printing raises NameError at trace time: babeltrace_ze_lib.rb and
the :be_class in btx_ze_model.yaml. All 247 ZE:: constants referenced by
those two files resolve, and the four classes construct with unchanged
sizes.

Generated: ze_library.rb, ze_bindings.rb, babeltrace_ze_lib.rb and
btx_ze_model.yaml change by this rename and nothing else.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant