<div dir="ltr"><div class="gmail_extra"><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" class="cremed">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 id=":37d">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>Two high-level questions unrelated to the code itself:</div><div class="gmail_extra"><br></div><div class="gmail_extra" style>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 class="gmail_extra" style><br></div><div class="gmail_extra" style>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 class="gmail_extra" style><br></div><div class="gmail_extra" style>u</div><div class="gmail_extra" style>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>