From fd424277ab63ae582c9d0281a34530e4890dc072 Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Tue, 16 Jun 2020 15:49:57 +0300 Subject: [PATCH] Run zig fmt --- src/analysis.zig | 26 ++++++++++++++------------ src/semantic_tokens.zig | 24 ++++++++++++------------ 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/analysis.zig b/src/analysis.zig index ce5b4d5..51b7521 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -668,17 +668,17 @@ fn resolveTypeOfNodeInternal( } const cast_map = std.ComptimeStringMap(void, .{ - .{ "@as" }, - .{ "@bitCast" }, - .{ "@fieldParentPtr" }, - .{ "@floatCast" }, - .{ "@floatToInt" }, - .{ "@intCast" }, - .{ "@intToEnum" }, - .{ "@intToFloat" }, - .{ "@intToPtr" }, - .{ "@truncate" }, - .{ "@ptrCast" }, + .{"@as"}, + .{"@bitCast"}, + .{"@fieldParentPtr"}, + .{"@floatCast"}, + .{"@floatToInt"}, + .{"@intCast"}, + .{"@intToEnum"}, + .{"@intToFloat"}, + .{"@intToPtr"}, + .{"@truncate"}, + .{"@ptrCast"}, }); if (cast_map.has(call_name)) { if (builtin_call.params_len < 1) return null; @@ -1051,7 +1051,9 @@ pub fn documentPositionContext(allocator: *std.mem.Allocator, document: types.Te }, }, .Keyword_break, .Keyword_continue => curr_ctx.ctx = .pre_label, - .Colon => if (curr_ctx.ctx == .pre_label) { curr_ctx.ctx = .label; }, + .Colon => if (curr_ctx.ctx == .pre_label) { + curr_ctx.ctx = .label; + }, .QuestionMark => switch (curr_ctx.ctx) { .field_access => {}, else => curr_ctx.ctx = .empty, diff --git a/src/semantic_tokens.zig b/src/semantic_tokens.zig index ae376bb..fb85703 100644 --- a/src/semantic_tokens.zig +++ b/src/semantic_tokens.zig @@ -84,18 +84,18 @@ fn isAllDigit(str: []const u8) bool { fn isTypeIdent(tree: *ast.Tree, token_idx: ast.TokenIndex) bool { const PrimitiveTypes = std.ComptimeStringMap(void, .{ - .{ "isize" }, .{ "usize" }, - .{ "c_short" }, .{ "c_ushort" }, - .{ "c_int" }, .{ "c_uint" }, - .{ "c_long" }, .{ "c_ulong" }, - .{ "c_longlong" }, .{ "c_ulonglong" }, - .{ "c_longdouble" }, .{ "c_void" }, - .{ "f16" }, .{ "f32" }, - .{ "f64" }, .{ "f128" }, - .{ "bool" }, .{ "void" }, - .{ "noreturn" }, .{ "type" }, - .{ "anyerror" }, .{ "comptime_int" }, - .{ "comptime_float" }, .{ "anyframe" }, + .{"isize"}, .{"usize"}, + .{"c_short"}, .{"c_ushort"}, + .{"c_int"}, .{"c_uint"}, + .{"c_long"}, .{"c_ulong"}, + .{"c_longlong"}, .{"c_ulonglong"}, + .{"c_longdouble"}, .{"c_void"}, + .{"f16"}, .{"f32"}, + .{"f64"}, .{"f128"}, + .{"bool"}, .{"void"}, + .{"noreturn"}, .{"type"}, + .{"anyerror"}, .{"comptime_int"}, + .{"comptime_float"}, .{"anyframe"}, }); const text = tree.tokenSlice(token_idx);