Questions about dmd source

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jul 29 23:51:58 PDT 2017


Francis Nixon wrote:

> I have two completely unrelated questions about the dmd source code.
>
> 1. What does the mtype.Type.dotExp method do? The documentation comment 
> says that it "Accesses the members of the object e". I'm not sure exactly 
> why I would want to do that? Is it for handling types specified using an 
> identifier/template chain (aka foo.bar!(uint).c)?
types has some built-in properties, like `.length`, `.sizeof`, `.init` and 
so on. this method is used to access those properties.


> 2. I've noticed there are some rather long methods in the dmd source, 
> involving more than one goto; parse.d is particularly bad. Is there a 
> reason for this/is it being fixed?
it just was done this way. dmd parser was "evolved", so what you see is a 
result of evolution (it is not stopeed yet ;-), and evolution doesn't 
produce ideal results. there is no need to specifically "fix" working 
things, it doesn't do any good.


More information about the Digitalmars-d-learn mailing list