mirror of
https://github.com/ziglang/zig.git
synced 2026-01-29 18:55:29 +00:00
stage2: fix incorrect ast.Tree.getNodeSource impl
This commit is contained in:
parent
70761d7c52
commit
d8560edc29
@ -1071,8 +1071,8 @@ pub const Tree = struct {
|
||||
const first_token = tree.firstToken(node);
|
||||
const last_token = tree.lastToken(node);
|
||||
const start = token_starts[first_token];
|
||||
const len = tree.tokenSlice(last_token).len;
|
||||
return tree.source[start..][0..len];
|
||||
const end = token_starts[last_token] + tree.tokenSlice(last_token).len;
|
||||
return tree.source[start..end];
|
||||
}
|
||||
|
||||
pub fn globalVarDecl(tree: Tree, node: Node.Index) full.VarDecl {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user