From 20cb0b730736af98e4f48b85fc33f9031a7189a6 Mon Sep 17 00:00:00 2001 From: Luuk de Gram Date: Mon, 8 Mar 2021 20:31:02 +0100 Subject: [PATCH] Fix off by one scope end index --- src/analysis.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/analysis.zig b/src/analysis.zig index 128252e..a60dcc3 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -2802,7 +2802,7 @@ fn makeScopeInternal( scope.* = .{ .range = .{ .start = offsets.tokenLocation(tree, payload).start, - .end = offsets.tokenLocation(tree, tree.lastToken(if_node.ast.then_expr)).end, + .end = offsets.tokenLocation(tree, tree.lastToken(if_node.ast.then_expr)).end + 1, }, .decls = std.StringHashMap(Declaration).init(allocator), .uses = &.{}, @@ -2887,7 +2887,7 @@ fn makeScopeInternal( scope.* = .{ .range = .{ .start = offsets.tokenLocation(tree, payload).start, - .end = offsets.tokenLocation(tree, tree.lastToken(while_node.ast.then_expr)).end, + .end = offsets.tokenLocation(tree, tree.lastToken(while_node.ast.then_expr)).end + 1, }, .decls = std.StringHashMap(Declaration).init(allocator), .uses = &.{},