From 39b0f50bda8aaac775177e6414375f5ec5b4a5c4 Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Sat, 12 Sep 2020 18:48:09 +0300 Subject: [PATCH] Exposed analysis functions used by analysis-buddy --- src/analysis.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/analysis.zig b/src/analysis.zig index 90d8bae..5247a6a 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -6,7 +6,7 @@ const offsets = @import("offsets.zig"); const log = std.log.scoped(.analysis); /// Get a declaration's doc comment node -fn getDocCommentNode(tree: *ast.Tree, node: *ast.Node) ?*ast.Node.DocComment { +pub fn getDocCommentNode(tree: *ast.Tree, node: *ast.Node) ?*ast.Node.DocComment { if (node.castTag(.FnProto)) |func| { return func.getDocComments(); } else if (node.castTag(.VarDecl)) |var_decl| { @@ -327,7 +327,7 @@ fn findReturnStatement(tree: *ast.Tree, fn_decl: *ast.Node.FnProto) ?*ast.Node.C } /// Resolves the return type of a function -fn resolveReturnType( +pub fn resolveReturnType( store: *DocumentStore, arena: *std.heap.ArenaAllocator, fn_decl: *ast.Node.FnProto, @@ -855,7 +855,7 @@ pub const TypeWithHandle = struct { type: Type, handle: *DocumentStore.Handle, - fn typeVal(node_handle: NodeWithHandle) TypeWithHandle { + pub fn typeVal(node_handle: NodeWithHandle) TypeWithHandle { return .{ .type = .{ .data = .{ .other = node_handle.node },