D Compiler as a Library

Ary Manzana ary at esperanto.org.ar
Thu Apr 19 04:05:12 PDT 2012


On 4/19/12 12:48 AM, Jacob Carlborg wrote:
> On 2012-04-18 14:49, Marco Leise wrote:
>
>> I want refactoring to be as simple as Foo.renameSymbol("std.path.sep",
>> "std.path.dirSeperator"); if the connection between module- and
>> filename allows "std.path" to be traced back to the original file.
>
> I'm not sure but I don't think that is enough. In Clang you do something
> like this:
>
> 1. Get cursor of source location
> 2. Get a unique global ID of the cursor the corresponds to the symbol
> (unified symbol resolution)
> 3. Walk the AST to find all matches of this ID
> 4. Get the source location of the cursors which match
> 5. Rename the symbol at the source location
>

Unfortunately rename can't be perfect in D because you can't apply it 
inside templates.


More information about the Digitalmars-d mailing list