| ... | @@ -297,8 +297,7 @@ const DocData = struct { | ... | @@ -297,8 +297,7 @@ const DocData = struct { |
| 297 | try w.print("\"", .{}); | 297 | try w.print("\"", .{}); |
| 298 | for (kv.key_ptr.*.sub_file_path) |c| { | 298 | for (kv.key_ptr.*.sub_file_path) |c| { |
| 299 | if (c == '\\') { | 299 | if (c == '\\') { |
| 300 | try w.print("\\", .{}); | 300 | try w.print("\\\\", .{}); |
| 301 | try w.print("\\", .{}); | | |
| 302 | } else { | 301 | } else { |
| 303 | try w.print("{c}", .{c}); | 302 | try w.print("{c}", .{c}); |
| 304 | } | 303 | } |
| ... | @@ -1242,6 +1241,42 @@ fn walkInstruction( | ... | @@ -1242,6 +1241,42 @@ fn walkInstruction( |
| 1242 | .expr = .{ .typeOf = operand_index }, | 1241 | .expr = .{ .typeOf = operand_index }, |
| 1243 | }; | 1242 | }; |
| 1244 | }, | 1243 | }, |
| | 1244 | .typeof_builtin => { |
| | 1245 | // @check: @TypeOf(T) |
| | 1246 | // right now it's only showing the T |
| | 1247 | // a way to solve it could be creating a .call |
| | 1248 | // another way is with a flag to handle it on Frontend |
| | 1249 | const pl_node = data[inst_index].pl_node; |
| | 1250 | const extra = file.zir.extraData(Zir.Inst.Block, pl_node.payload_index); |
| | 1251 | const body = file.zir.extra[extra.end..][extra.data.body_len - 1]; |
| | 1252 | |
| | 1253 | var operand: DocData.WalkResult = try self.walkRef( |
| | 1254 | file, |
| | 1255 | parent_scope, |
| | 1256 | data[body].@"break".operand, |
| | 1257 | false, |
| | 1258 | ); |
| | 1259 | |
| | 1260 | return operand; |
| | 1261 | }, |
| | 1262 | .type_info => { |
| | 1263 | // @check |
| | 1264 | const un_node = data[inst_index].un_node; |
| | 1265 | const operand = try self.walkRef( |
| | 1266 | file, |
| | 1267 | parent_scope, |
| | 1268 | un_node.operand, |
| | 1269 | need_type, |
| | 1270 | ); |
| | 1271 | |
| | 1272 | const operand_index = self.exprs.items.len; |
| | 1273 | try self.exprs.append(self.arena, operand.expr); |
| | 1274 | |
| | 1275 | return DocData.WalkResult{ |
| | 1276 | .typeRef = operand.typeRef, |
| | 1277 | .expr = .{ .typeOf = operand_index }, |
| | 1278 | }; |
| | 1279 | }, |
| 1245 | .as_node => { | 1280 | .as_node => { |
| 1246 | const pl_node = data[inst_index].pl_node; | 1281 | const pl_node = data[inst_index].pl_node; |
| 1247 | const extra = file.zir.extraData(Zir.Inst.As, pl_node.payload_index); | 1282 | const extra = file.zir.extraData(Zir.Inst.As, pl_node.payload_index); |
| ... | @@ -1534,7 +1569,7 @@ fn walkInstruction( | ... | @@ -1534,7 +1569,7 @@ fn walkInstruction( |
| 1534 | .expr = .{ .call = call_slot_index }, | 1569 | .expr = .{ .call = call_slot_index }, |
| 1535 | }; | 1570 | }; |
| 1536 | }, | 1571 | }, |
| 1537 | .func, .func_inferred => { | 1572 | .func, .func_inferred, .func_extended => { |
| 1538 | const type_slot_index = self.types.items.len; | 1573 | const type_slot_index = self.types.items.len; |
| 1539 | try self.types.append(self.arena, .{ .Unanalyzed = {} }); | 1574 | try self.types.append(self.arena, .{ .Unanalyzed = {} }); |
| 1540 | | 1575 | |
| ... | @@ -2558,12 +2593,14 @@ fn analyzeFunction( | ... | @@ -2558,12 +2593,14 @@ fn analyzeFunction( |
| 2558 | // TODO: handle scope rules for fn parameters | 2593 | // TODO: handle scope rules for fn parameters |
| 2559 | for (fn_info.param_body[0..fn_info.total_params_len]) |param_index| { | 2594 | for (fn_info.param_body[0..fn_info.total_params_len]) |param_index| { |
| 2560 | switch (tags[param_index]) { | 2595 | switch (tags[param_index]) { |
| 2561 | else => panicWithContext( | 2596 | else => { |
| 2562 | file, | 2597 | panicWithContext( |
| 2563 | param_index, | 2598 | file, |
| 2564 | "TODO: handle `{s}` in walkInstruction.func\n", | 2599 | param_index, |
| 2565 | .{@tagName(tags[param_index])}, | 2600 | "TODO: handle `{s}` in walkInstruction.func\n", |
| 2566 | ), | 2601 | .{@tagName(tags[param_index])}, |
| | 2602 | ); |
| | 2603 | }, |
| 2567 | .param_anytype, .param_anytype_comptime => { | 2604 | .param_anytype, .param_anytype_comptime => { |
| 2568 | // TODO: where are the doc comments? | 2605 | // TODO: where are the doc comments? |
| 2569 | const str_tok = data[param_index].str_tok; | 2606 | const str_tok = data[param_index].str_tok; |
| ... | @@ -2848,17 +2885,27 @@ fn walkRef( | ... | @@ -2848,17 +2885,27 @@ fn walkRef( |
| 2848 | }; | 2885 | }; |
| 2849 | }, | 2886 | }, |
| 2850 | // TODO: dunno what to do with those | 2887 | // TODO: dunno what to do with those |
| | 2888 | // .calling_convention_type => { |
| | 2889 | // return DocData.WalkResult{ |
| | 2890 | // .typeRef = .{ .type = @enumToInt(Ref.comptime_int_type) }, |
| | 2891 | // .expr = .{ .int = .{ .value = 1 } }, |
| | 2892 | // }; |
| | 2893 | // }, |
| 2851 | // .calling_convention_c => { | 2894 | // .calling_convention_c => { |
| 2852 | // return DocData.WalkResult{ .int = .{ | 2895 | // return DocData.WalkResult{ |
| 2853 | // .type = @enumToInt(Ref.comptime_int_type), | 2896 | // .typeRef = .{ .type = @enumToInt(Ref.comptime_int_type) }, |
| 2854 | // .value = 1, | 2897 | // .expr = .{ .int = .{ .value = 1 } }, |
| 2855 | // } }; | 2898 | // }; |
| 2856 | // }, | 2899 | // }, |
| 2857 | // .calling_convention_inline => { | 2900 | // .calling_convention_inline => { |
| 2858 | // return DocData.WalkResult{ .int = .{ | 2901 | // return DocData.WalkResult{ |
| 2859 | // .type = @enumToInt(Ref.comptime_int_type), | 2902 | // .typeRef = .{ .type = @enumToInt(Ref.comptime_int_type) }, |
| 2860 | // .value = 1, | 2903 | // .expr = .{ .int = .{ .value = 1 } }, |
| 2861 | // } }; | 2904 | // }; |
| | 2905 | // // return DocData.WalkResult{ .int = .{ |
| | 2906 | // // .type = @enumToInt(Ref.comptime_int_type), |
| | 2907 | // // .value = 1, |
| | 2908 | // // } }; |
| 2862 | // }, | 2909 | // }, |
| 2863 | // .generic_poison => { | 2910 | // .generic_poison => { |
| 2864 | // return DocData.WalkResult{ .int = .{ | 2911 | // return DocData.WalkResult{ .int = .{ |