<html><head></head><body><div class="yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir="ltr" data-setdir="false"><div>This message is a request to libClang developers. I'm not sure this is the right mailing list to ask for.<br><br>I'm using libClang API (simple C), not libTooling (C++).<br>I'd like to get the cursor spelling of unary (CXCursor_UnaryOperator) and binary (CXCursor_BinaryOperator) operators correctly.<br>Because clang_getCursorSpelling returns an empty string for these cursor types, I have implemented functions that get the source range of the operator (only the operator, not the operands), and get the token in the source range.<br>The problem comes when the expresion involving the operators is inside a macro: the functions return the macro name.<br><br>Example:<br>#define MACRO1(a,b,v,c) case a: v = b*c; break;<br>static void function(int a)<br>{<br>    int b;<br>    switch(a)<br>    {<br>        MACRO1(1, 7, b, 6);<br>        case 2: b = 3*4; break;<br>    }<br>}<br><br>In the first 'case', my function returns 'MACRO1' for both operators (= and *). In the second 'case' my function returns '=' and '*'.<br><br>Dear libClang developer, can you make that function clang_getCursorSpelling returns the spelling of unary and binary operators (+ - * & = += -= ...)?<br><br>Thanks.<br><br></div></div></div></body></html>