<div dir="ltr">On Fri, Feb 1, 2013 at 9:25 AM, Antoine Trouve <span dir="ltr"><<a href="mailto:trouve@isit.or.jp" target="_blank">trouve@isit.or.jp</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">Hi everybody,<br>
<br>
I am now using LibTooling with the RefactoringTool to add some comments in some C codes.<br>
<br>
I am now trying to add comments after a given statement (the body of a for to say the truth);<br>
in order to detect the location of the end of a statement I use "Stmt.getLocEnd()", but I seems that its output is often inaccurate.<br>
<br>
Here are two examples, if I insert "/* HERE */" at the end location:<br>
<br>
        for(i=0; i<N/2; i++) res +=mand(i,N/4/* HERE */);<br>
        for(i=0; i<mand(N,N); i++) res /* HERE */++;<br>
<br>
I would expect the following output:<br>
<br>
        for(i=0; i<N/2; i++) res +=mand(i,N/4);/* HERE */<br>
        for(i=0; i<mand(N,N); i++) res ++;/* HERE */<br>
<br>
It looks like a bug. Am I right or did I miss something ?<br>
<br>
I found a previous recent discussion about this matter (<a href="http://clang-developers.42468.n3.nabble.com/Statements-that-end-with-td4028311.html" target="_blank">http://clang-developers.42468.n3.nabble.com/Statements-that-end-with-td4028311.html</a>), but It looks like nothing has been done.<br>
</blockquote><div><br></div><div style>Yes, this is a known issue, and as far as I'm aware nothing has been done. We're usually working around this by looking for the next ';' token.</div><div style><br></div>
<div style>I guess it's the good old "patches welcome" answer - or wait until it becomes important enough for somebody else to solve.</div><div style><br></div><div style>Cheers,</div><div style>/Manuel</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
- Antoine<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div></div>