Removed unneeeded function

This commit is contained in:
Alexandros Naskos 2020-05-27 13:09:50 +03:00
parent d2325df729
commit f3974d2ff2

View File

@ -810,13 +810,6 @@ fn peek(arr: *std.ArrayList(StackState)) !*StackState {
return &arr.items[arr.items.len - 1]; 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 { fn tokenRangeAppend(prev: SourceRange, token: std.zig.Token) SourceRange {
return .{ return .{
.start = prev.start, .start = prev.start,
@ -859,13 +852,13 @@ pub fn documentPositionContext(allocator: *std.mem.Allocator, document: types.Te
// State changes // State changes
var curr_ctx = try peek(&stack); var curr_ctx = try peek(&stack);
switch (tok.id) { 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) { .Identifier => switch (curr_ctx.ctx) {
.empty => curr_ctx.ctx = .{ .var_access = tokenRange(tok) }, .empty => curr_ctx.ctx = .{ .var_access = tok.loc },
else => {}, else => {},
}, },
.Builtin => switch (curr_ctx.ctx) { .Builtin => switch (curr_ctx.ctx) {
.empty => curr_ctx.ctx = .{ .builtin = tokenRange(tok) }, .empty => curr_ctx.ctx = .{ .builtin = tok.loc },
else => {}, else => {},
}, },
.Period, .PeriodAsterisk => switch (curr_ctx.ctx) { .Period, .PeriodAsterisk => switch (curr_ctx.ctx) {