aboutsummaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
authorWink Saville <wink@saville.com>2018-10-01 21:51:53 -0700
committerAndrew Kelley <superjoe30@gmail.com>2018-10-02 00:51:53 -0400
commitcd211bcc20d3d1ddd1a50d57c7645aa3445934f0 (patch)
treeb315f7029f7b87800656a678ec0589e179548cea /std
parentbc3e99c5e5a5f054e57a7056a64ff08762d42e9f (diff)
downloadzig-cd211bcc20d3d1ddd1a50d57c7645aa3445934f0.tar.gz
zig-cd211bcc20d3d1ddd1a50d57c7645aa3445934f0.zip
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.
Diffstat (limited to 'std')
-rw-r--r--std/zig/ast.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/std/zig/ast.zig b/std/zig/ast.zig
index 2102da456c..e2ac5f6341 100644
--- a/std/zig/ast.zig
+++ b/std/zig/ast.zig
@@ -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,