Skip to content

remove dmacro.d dependency on doc.d #15470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2023
Merged

Conversation

WalterBright
Copy link
Member

Also make declarations private by default and obsolete C++ linkage, and default to @trusted.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#15470"

@WalterBright WalterBright force-pushed the utfStride branch 2 times, most recently from 5b596d3 to 3273a37 Compare July 28, 2023 20:22
@WalterBright WalterBright requested a review from ibuclaw as a code owner July 28, 2023 20:22
* Returns: number of bytes in UTF character. Returns 1 on invalid UTF start.
*/
@safe
int utfStride(scope const(char)* p) @nogc nothrow pure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of duplicating this function, a common function should be imported from dmd.root.utf. Otherwise, this function needs a unittest and correct documentation. ("length of an UTF string" is wrong, it returns the number of UTF-8 code units in a code point based on the first one)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the documentation and added some unittests. Generally, you're right that one shouldn't repeat oneself. In this case, I wanted dmacros.d to be usable as a macro text processor on its own, and utfStride() is a trivial function. root.utf is a substantial module. In this case, it's justifiable for a tiny bit of redundancy.

@WalterBright
Copy link
Member Author

@dkorpel ping

@WalterBright WalterBright merged commit 1628aff into dlang:master Aug 10, 2023
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.

4 participants