-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
Conversation
Thanks for your pull request, @WalterBright! Bugzilla referencesYour 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 locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#15470" |
5b596d3
to
3273a37
Compare
compiler/src/dmd/dmacro.d
Outdated
* Returns: number of bytes in UTF character. Returns 1 on invalid UTF start. | ||
*/ | ||
@safe | ||
int utfStride(scope const(char)* p) @nogc nothrow pure |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
26ee989
to
71ef7f8
Compare
@dkorpel ping |
Also make declarations private by default and obsolete C++ linkage, and default to @trusted.