Continued: DMD Source Hot Spot for Expression Type Deduction

"Nordlöw" per.nordlow at gmail.com
Tue Apr 8 14:44:17 PDT 2014


So far I figured that what I typically want to do is

printf("Type: %s", e->type->toChars());

whenever I find a type-deduced expression e that fulfils

(e->loc->linnum == QUERY_LINE &&
  e->loc->charnum <= QUERY_COLUMN &&
  QUERY_COLUMN < (e->loc->charnum +
                  e->length_of_expression_in_code))

Can I somehow query the source code range (start end begin 
offset/row-column) of an expression?

This of course has to handle sub-expression types which is a 
complication I haven't covered here.

So maybe a better feature would be to query for type of 
expression before or after point.


More information about the Digitalmars-d-learn mailing list