On Friday, 11 May 2012 at 12:55:58 UTC, Jacob Carlborg wrote:
On 2012-05-11 14:07, Roman D. Boiko wrote:
On Friday, 11 May 2012 at 11:49:23 UTC, Jacob Carlborg wrote:

Found it now, "calculateFor". It not sure if it's the most intuitive
name though. I get the feeling: "calculate what?".

calculateLocation was original name, but I don't like repeating return type in method names, I decided to change it so that it is clear that
another renaming is needed ;) Any suggestions?


My original suggestion was to have the functionality in Token, which would have made for intuitive names: line, column and file. But since you didn't like that I have to give it some thought.

What about the following signature: Location locate(size_t index)?
Or even better:
alias size_t CodeUnitIndex;
Location locateFor(CodeUnitIndex position);

The problem with placing it in Token is that Token should not know anything about source as a whole.

Reply via email to