Commit cd211bcc20

Wink Saville <wink@saville.com>
2018-10-02 06:51:53
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
Changed files (1)
std
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,