| ... | ... | @@ -69,7 +69,6 @@ pub fn format( |
| 69 | 69 | FormatFillAndAlign, |
| 70 | 70 | FormatWidth, |
| 71 | 71 | FormatPrecision, |
| 72 | | Pointer, |
| 73 | 72 | }; |
| 74 | 73 | |
| 75 | 74 | comptime var start_index = 0; |
| ... | ... | @@ -109,9 +108,6 @@ pub fn format( |
| 109 | 108 | state = .Start; |
| 110 | 109 | start_index = i; |
| 111 | 110 | }, |
| 112 | | '*' => { |
| 113 | | state = .Pointer; |
| 114 | | }, |
| 115 | 111 | ':' => { |
| 116 | 112 | state = if (comptime peekIsAlign(fmt[i..])) State.FormatFillAndAlign else State.FormatWidth; |
| 117 | 113 | specifier_end = i; |
| ... | ... | @@ -256,19 +252,6 @@ pub fn format( |
| 256 | 252 | @compileError("Unexpected character in precision value: " ++ [_]u8{c}); |
| 257 | 253 | }, |
| 258 | 254 | }, |
| 259 | | .Pointer => switch (c) { |
| 260 | | '}' => { |
| 261 | | const arg_to_print = comptime nextArg(&used_pos_args, maybe_pos_arg, &next_arg); |
| 262 | | |
| 263 | | try output(context, @typeName(@typeOf(args[arg_to_print]).Child)); |
| 264 | | try output(context, "@"); |
| 265 | | try formatInt(@ptrToInt(args[arg_to_print]), 16, false, 0, context, Errors, output); |
| 266 | | |
| 267 | | state = .Start; |
| 268 | | start_index = i + 1; |
| 269 | | }, |
| 270 | | else => @compileError("Unexpected format character after '*'"), |
| 271 | | }, |
| 272 | 255 | } |
| 273 | 256 | } |
| 274 | 257 | comptime { |
| ... | ... | @@ -299,6 +282,13 @@ pub fn formatType( |
| 299 | 282 | output: fn (@typeOf(context), []const u8) Errors!void, |
| 300 | 283 | max_depth: usize, |
| 301 | 284 | ) Errors!void { |
| 285 | if (comptime std.mem.eql(u8, fmt, "*")) { |
| 286 | try output(context, @typeName(@typeOf(value).Child)); |
| 287 | try output(context, "@"); |
| 288 | try formatInt(@ptrToInt(value), 16, false, 0, context, Errors, output); |
| 289 | return; |
| 290 | } |
| 291 | |
| 302 | 292 | const T = @typeOf(value); |
| 303 | 293 | switch (@typeInfo(T)) { |
| 304 | 294 | .ComptimeInt, .Int, .Float => { |