authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-02-19 20:28:47-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-02-19 20:28:47-07:00
logd8560edc2941016a12a03df36035cabd537dde77
tree76d2679211958ebbae039db36af4ce1ff34d85a7
parent70761d7c52cd3634e086b0914c9520ef4dc01eee

stage2: fix incorrect ast.Tree.getNodeSource impl


1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/zig/ast.zig+2-2
...@@ -1071,8 +1071,8 @@ pub const Tree = struct {...@@ -1071,8 +1071,8 @@ pub const Tree = struct {
1071 const first_token = tree.firstToken(node);1071 const first_token = tree.firstToken(node);
1072 const last_token = tree.lastToken(node);1072 const last_token = tree.lastToken(node);
1073 const start = token_starts[first_token];1073 const start = token_starts[first_token];
1074 const len = tree.tokenSlice(last_token).len;1074 const end = token_starts[last_token] + tree.tokenSlice(last_token).len;
1075 return tree.source[start..][0..len];1075 return tree.source[start..end];
1076 }1076 }
10771077
1078 pub fn globalVarDecl(tree: Tree, node: Node.Index) full.VarDecl {1078 pub fn globalVarDecl(tree: Tree, node: Node.Index) full.VarDecl {