From d2325df729f41921aabadf616eca348e914214de Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Wed, 27 May 2020 02:00:22 +0300 Subject: [PATCH] Removed comments --- src/analysis.zig | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/analysis.zig b/src/analysis.zig index 3badfdf..e4845df 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -491,7 +491,7 @@ pub fn getFieldAccessTypeNode( } else if (next.id == .LParen) { paren_count += 1; } - } else unreachable; + } else return null; } else return null; }, else => {}, @@ -784,8 +784,7 @@ const PositionContext = union(enum) { other, empty, - // @TODO remove pub - pub fn range(self: PositionContext) ?SourceRange { + fn range(self: PositionContext) ?SourceRange { return switch (self) { .builtin => |r| r, .comment => null, @@ -825,7 +824,6 @@ fn tokenRangeAppend(prev: SourceRange, token: std.zig.Token) SourceRange { }; } -// @TODO Test this thoroughly pub fn documentPositionContext(allocator: *std.mem.Allocator, document: types.TextDocument, position: types.Position) !PositionContext { const line = try document.getLine(@intCast(usize, position.line)); const pos_char = @intCast(usize, position.character) + 1; @@ -837,7 +835,6 @@ pub fn documentPositionContext(allocator: *std.mem.Allocator, document: types.Te var tokenizer = std.zig.Tokenizer.init(line[0..idx]); var stack = try std.ArrayList(StackState).initCapacity(&arena.allocator, 8); - // @TODO What happens when we don't close a string? (probably an .Eof) while (true) { const tok = tokenizer.next(); // Early exits.