<div dir="ltr">On Wed, May 8, 2013 at 6:42 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="im"><br><div class="gmail_quote">On Wed, May 8, 2013 at 5:36 PM, Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>In preparation for some docs on source locations I want to write I came up<br>
with the little helper method that visualizes source locations as a tree.<br>
This is especially helpful when you have many nested levels of macro<br>
expansions.<br>
<br>
Example output:<br>
(SP=(:6:14),<br>
 EX=(SP=(:2:14),<br>
     ES=(:6:8),<br>
     EE=(:6:15)))<br>
<br>
SP = spelling<br>
EX = expansion (if there's only a single location)<br>
ES/EE = expansion start, expansion end (in case there's a range)<br>
<br>
Feel free to bikeshed about the details :D</div></blockquote></div><br></div>Two high-level questions unrelated to the code itself:</div><div class="gmail_extra"><br></div><div class="gmail_extra">1) Should we visualize these trees in roughly the same tree-ish syntax as AST trees? Or is it useful to visualize them on a single line *inside* the AST tree?</div>
</div></blockquote><div><br></div><div style>I'm all for bike shed color ideas: can you create a paste with how you want it to look? (I tried a few things, and they all looked bad - I'm no good at that :P)</div><div>
 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">2) Is there a way to make this part of the testing of source locations which is currently done mostly through c-index-test's testing of the writing out of cursor details from libclang?</div>
</div></blockquote><div><br></div><div style>Not sure - I really want a format that's for users; I'd be happy to create something more machine-readable (JSON for example), so we can use it in tests, though. </div>
<div style><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">One nit-picky detail: please don't use the initialisms.... At least, not *these*. I see SP, EX, and ES in this syntax and I think "wait, is this a stack machine asm chunk?? some other weird assembly language?" before my mind returns to sanity. ;]</div>

</div>
</blockquote></div><br></div><div class="gmail_extra" style>Just tell me what to use :) I don't have strong feelings about anything here - the main problem is that with 4- or 5-layer macros, this can quickly go deep and become unwieldy if names start getting too long (as you know me I of course started with "SpellingLocation" etc :)</div>
<div class="gmail_extra" style><br></div><div class="gmail_extra" style>Cheers,</div><div class="gmail_extra" style>/Manuel</div></div>