D Compiler as a Library

Jacob Carlborg doob at me.com
Wed Apr 18 09:48:46 PDT 2012


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

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list