"H. S. Teoh via Digitalmars-d" wrote in message
news:[email protected]...
Also, storing a full AST is probably overkill -- lexing and parsing the
source generally doesn't take up too much of the compiler's time, so we
might as well just use the source code instead.
Exactly
What makes it more
worthwhile is if the AST has already been somewhat processed, e.g.,
constants have been folded, etc.. Probably after semantic1 and semantic2
have been run (though I'm not sure how far one can get if the template
hasn't been instantiated yet).
Not very far at all.
This way, work that has already been done
doesn't need to be repeated again.
When it's templates that haven't been instantiated, you haven't done any of
the work yet.