High-level remark:<div><div>The idea of having multiple different parameters of which only one must ever be set seems strange to me. Why not instead have multiple methods with different names? I'd also prefer having 1 parameter and finding out what methods it provides.</div>
<div><br></div><div>Cheers,</div><div>/Manuel</div><div><br><div class="gmail_quote">On Sat, Jun 30, 2012 at 4:15 AM, Gregory Szorc <span dir="ltr"><<a href="mailto:gregory.szorc@gmail.com" target="_blank">gregory.szorc@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Updated patch.<br>
<div class="HOEnZb"><div class="h5"><br>
On Fri, Jun 29, 2012 at 8:47 AM, Gregory Szorc <<a href="mailto:gregory.szorc@gmail.com">gregory.szorc@gmail.com</a>> wrote:<br>
> Having thought about this in my sleep, I may want to rescind this<br>
> review request and refactor things a little.<br>
><br>
> 1) I may change "range" and "source_range" names to "extent" since<br>
> that is what is used elsewhere.<br>
> 2) I may combine the bounds to obtain ranges/extents from two<br>
> arguments to 2-tuples.<br>
> 3) I may remove the "_source" from get_source_location and<br>
> get_source_extent. I don't think that's any less clear.<br>
><br>
> This will of course invalidate the token API patch that followed,<br>
> albeit trivially.<br>
><br>
> On Fri, Jun 29, 2012 at 12:13 AM, Gregory Szorc <<a href="mailto:gregory.szorc@gmail.com">gregory.szorc@gmail.com</a>> wrote:<br>
>> These are just convenience APIs to make obtaining File,<br>
>> SourceLocation, and SourceRange instances easier.<br>
>><br>
>> Old way:<br>
>><br>
>> f = File.from_name(tu, 'foo.c')<br>
>> location = SourceLocation.from_offset(tu, f, 10)<br>
>><br>
>> New way:<br>
>><br>
>> location = tu.get_source_location('foo.c', offset=10)<br>
</div></div></blockquote></div><br></div></div>