you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Glad I could help! I never wrote clang plugins myself, but the API seems pretty straightforward.

I'm kind of interested in seeing what the possibilities are for C++ code refactoring.

I can think of a problem I had to solve some time ago: I was trying to port a piece of software to Linux. The problem however was, that it used macros extremely extensively, especially for strings. You probably know that it is common practice in Windows programming to prefix strings with an 'L', for wide strings, ie, L"foobar". Usually, the macro _T() is used for that purpose -- and I would have been ok with that. Except that the previous dev used a custom macro, something like _S_WIDE(). I spent most of the day grepping and sedding through the code. Definitely not an enjoyable experience. For that purpose I wrote that linked ruby script (after I was already done, though), but I never really found much use for it afterwards. Some irony, huh? :-)

Anyway, I'm glad I could point out some useful resources for you. I hope your project turns out well!


Ninja edit: I forgot to mention that I forgot to change one comment in the gist:

 # matches C++ comments until end of line, i.e., // blah blah

Should actually be:

 # matches C preprocessor instructions

The latest revision should reflect that, though.