Conversation
Token.cpp and NameToken.cpp both defined isNameChar in an anonymous
namespace inside mx::core; nmtoken_string.cpp.tmpl and smufl_wavy.cpp.tmpl
did the same. All four collide in a unity build.
Rename the helpers to per-file names (tokenIsNameChar, nameTokenIsNameChar,
isNameChar{{ident}}) and drop the anonymous namespaces. Add a coding rule
to AGENTS.md prohibiting anonymous namespaces project-wide.
gen-quality
|
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.8% | 28487 / 36624 |
| Functions | 74.3% | 6349 / 8550 |
| Branches | 50.6% | 22632 / 44725 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 78.5% | 5913 / 7535 |
| Functions | 63.5% | 2006 / 3159 |
| Branches | 47.8% | 4998 / 10455 |
Core HTML report | API HTML report
Commit 024dff106dcce45e1af840f1439cd7e243a260ec.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #246. The previous PR fixed the generated enum, number, string, and smufl_prefixed
templates. This PR covers the remaining cases found by doing an actual unity build
(
CMAKE_UNITY_BUILD=ON,BATCH_SIZE=0):src/private/mx/core/Token.cppandNameToken.cpp— both definedisNameCharin an anonymousnamespace inside
mx::core. Renamed totokenIsNameChar/nameTokenIsNameChar.gen/cpp/templates/nmtoken_string.cpp.tmplandsmufl_wavy.cpp.tmpl— same pattern, bothgenerating
isNameCharin anonymous namespaces. Renamed toisNameChar{{ident}}.AGENTS.md— added a project-wide rule prohibiting anonymous namespaces, with the unity buildtest command so contributors can verify.
No CMake changes are needed by contributors wanting unity builds. The standard CMake flags work
as-is:
Testing
cmake --buildwithCMAKE_UNITY_BUILD=ON BATCH_SIZE=0, targetmx)make testpassesReferences