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 files changed, 1 insertions(+), 0 deletions(-)
std/zig/ast.zig+1
| ... | ... | @@ -45,6 +45,7 @@ pub const Tree = struct { |
| 45 | 45 | line_end: usize, |
| 46 | 46 | }; |
| 47 | 47 | |
| 48 | /// Return the Location of the token relative to the offset specified by `start_index`. |
| 48 | 49 | pub fn tokenLocationPtr(self: *Tree, start_index: usize, token: *const Token) Location { |
| 49 | 50 | var loc = Location{ |
| 50 | 51 | .line = 0, |