From f3974d2ff2c1eb86773cd9661b9b391fb38d21a2 Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Wed, 27 May 2020 13:09:50 +0300 Subject: [PATCH] Removed unneeeded function --- src/analysis.zig | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/analysis.zig b/src/analysis.zig index e4845df..4d2ed9e 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -810,13 +810,6 @@ fn peek(arr: *std.ArrayList(StackState)) !*StackState { return &arr.items[arr.items.len - 1]; } -fn tokenRange(token: std.zig.Token) SourceRange { - return .{ - .start = token.loc.start, - .end = token.loc.end, - }; -} - fn tokenRangeAppend(prev: SourceRange, token: std.zig.Token) SourceRange { return .{ .start = prev.start, @@ -859,13 +852,13 @@ pub fn documentPositionContext(allocator: *std.mem.Allocator, document: types.Te // State changes var curr_ctx = try peek(&stack); switch (tok.id) { - .StringLiteral, .MultilineStringLiteralLine => curr_ctx.ctx = .{ .string_literal = tokenRange(tok) }, + .StringLiteral, .MultilineStringLiteralLine => curr_ctx.ctx = .{ .string_literal = tok.loc }, .Identifier => switch (curr_ctx.ctx) { - .empty => curr_ctx.ctx = .{ .var_access = tokenRange(tok) }, + .empty => curr_ctx.ctx = .{ .var_access = tok.loc }, else => {}, }, .Builtin => switch (curr_ctx.ctx) { - .empty => curr_ctx.ctx = .{ .builtin = tokenRange(tok) }, + .empty => curr_ctx.ctx = .{ .builtin = tok.loc }, else => {}, }, .Period, .PeriodAsterisk => switch (curr_ctx.ctx) {