Add doc comment for tokenLocationPtr (#1618)

The algorithm seemed unusual and I had spent some effort understanding
it, so I thought I'd add a comment.
This commit is contained in:
Wink Saville 2018-10-01 21:51:53 -07:00 committed by Andrew Kelley
parent bc3e99c5e5
commit cd211bcc20

View File

@ -45,6 +45,7 @@ pub const Tree = struct {
line_end: usize,
};
/// Return the Location of the token relative to the offset specified by `start_index`.
pub fn tokenLocationPtr(self: *Tree, start_index: usize, token: *const Token) Location {
var loc = Location{
.line = 0,