Re: Hacking the compiler: Get Scope after some line of function

2017-07-27 Thread unDEFER via Digitalmars-d-learn
On Thursday, 27 July 2017 at 11:59:51 UTC, unDEFER wrote: So how to get scope e.g. after line "B b;"? I have found. That in scopes was found symbols from declarations, you must iterate by declarations (DeclarationExp) and add symbols by sc.insert(decexp.declaration);

Hacking the compiler: Get Scope after some line of function

2017-07-27 Thread unDEFER via Digitalmars-d-learn
Hello! I'm trying to do some strange thing: compile some Statement (do semantic3 phase) in the scope of other function. Other function is for example: auto megafunction() { B b; uint a = 25; return b; } AST of this code looks like: FuncDeclaration { fbody = CompoundStatement