Skip to content

Commit cd211bc

Browse files
winksavilleandrewrk
authored andcommitted
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.
1 parent bc3e99c commit cd211bc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

std/zig/ast.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pub const Tree = struct {
4545
line_end: usize,
4646
};
4747

48+
/// Return the Location of the token relative to the offset specified by `start_index`.
4849
pub fn tokenLocationPtr(self: *Tree, start_index: usize, token: *const Token) Location {
4950
var loc = Location{
5051
.line = 0,

0 commit comments

Comments
 (0)