Added our own ifFull implementation, fixes some crashes

This commit is contained in:
Alexandros Naskos
2021-03-26 21:46:49 +02:00
parent 9eece0985b
commit 3e300e4d74
5 changed files with 566 additions and 522 deletions

View File

@@ -4,7 +4,7 @@ const ast = std.zig.ast;
const types = @import("types.zig");
const offsets = @import("offsets.zig");
const log = std.log.scoped(.analysis);
const lastToken = offsets.lastToken;
usingnamespace @import("ast.zig");
/// Get a declaration's doc comment token index
pub fn getDocCommentTokenIndex(tree: ast.Tree, node: ast.Node.Index) ?ast.TokenIndex {
@@ -2819,7 +2819,7 @@ fn makeScopeInternal(
.if_simple,
=> {
const if_node: ast.full.If = if (node_tag == .@"if")
tree.ifFull(node_idx)
ifFull(tree, node_idx)
else
tree.ifSimple(node_idx);