Skip to content

Add doc comment for tokenLocationPtr #1618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

winksaville
Copy link
Contributor

The algorithm seemed unusual and I had spent some effort understanding
it, so I thought I'd add a comment.

@winksaville
Copy link
Contributor Author

As this is a comment change either a different change caused it to fail or flaky Appveyor.

std/zig/ast.zig Outdated
@@ -45,6 +45,7 @@ pub const Tree = struct {
line_end: usize,
};

/// Return the Location of the token relative to a line that starts at self.source[start_index].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not quite right. It returns the location of the token relative to the offset specified by start_index.

@andrewrk
Copy link
Member

andrewrk commented Oct 2, 2018

The appveyor failure is #1363

The algorithm seemed unusual and I had spent some effort understanding
it, so I thought I'd add a comment.
@winksaville winksaville force-pushed the add-doc-comment-for-tokenLocationPtr branch from 6663d64 to afcc347 Compare October 2, 2018 01:56
@winksaville
Copy link
Contributor Author

Txs for the correction, I said "line" because the Location returned is line oriented.

@andrewrk andrewrk merged commit cd211bc into ziglang:master Oct 2, 2018
@winksaville winksaville deleted the add-doc-comment-for-tokenLocationPtr branch October 2, 2018 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants