std.file read with start position

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 24 14:36:06 PDT 2014


On Tue, Jun 24, 2014 at 10:23:45PM +0200, Jonathan M Davis via Digitalmars-d wrote:
> > From: "H. S. Teoh via Digitalmars-d" <digitalmars-d at puremagic.com>
[...]
> > P.S. the problem with the table of contents links pointing to the wrong
> > place is a known bug:
> > 
> > 	https://issues.dlang.org/show_bug.cgi?id=11575
> > 
> > This badly needs to be fixed; as things stand, it makes ddoc look
> > like a joke (it generates non-unique HTML element ID's, which both
> > violates the HTML spec and causes erratic browser behaviour when you
> > click on said links).
> 
> ddoc is very useful, but with regards to links, it _is_ a joke. It has
> no understanding of code hierarchy whatsoever, making it just plain
> stupid when it generates links.
[...]

Actually, https://github.com/D-Programming-Language/dmd/pull/1174
appears to have fixed this issue (see also bug 6017). However, the fix
is incomplete: it doesn't work with template members, so members of
template structs/classes will still get global unqualified anchors
instead of qualified anchors.

I've traced the problem to src/dmd/doc.c's emitAnchorName() function. It
appears that template members' DSymbol nodes have their .parent pointer
set to NULL, so it doesn't know to emit the parent template's name. I'm
no DMD expert, so if someone could kindly explain to me why this is so,
and how I can get at the parent template's name, I should be able to fix
this.  :-)


T

-- 
"Real programmers can write assembly code in any language. :-)" -- Larry Wall


More information about the Digitalmars-d mailing list