mirror of
https://github.com/ziglang/zig.git
synced 2025-12-18 12:13:20 +00:00
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:
parent
bc3e99c5e5
commit
cd211bcc20
@ -45,6 +45,7 @@ pub const Tree = struct {
|
|||||||
line_end: usize,
|
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 {
|
pub fn tokenLocationPtr(self: *Tree, start_index: usize, token: *const Token) Location {
|
||||||
var loc = Location{
|
var loc = Location{
|
||||||
.line = 0,
|
.line = 0,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user