remove dmacro.d dependency on doc.d#15470
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
| * 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.
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.
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.