D Compiler as a Library

Roman D. Boiko rb at d-coding.com
Thu Apr 19 01:48:16 PDT 2012


On Wednesday, 18 April 2012 at 16:48:46 UTC, 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

Convenience interface on top of low-level core functionality can 
be provided and would suffice for many typical situations.


More information about the Digitalmars-d mailing list