Skip to content

Commit

Permalink
wip: print diag and error
Browse files Browse the repository at this point in the history
  • Loading branch information
Grazfather committed Jan 6, 2025
1 parent 4117ce3 commit ac53836
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions port/raspberrypi/rp2xxx/src/hal/pio/assembler/comparison_tests.zig
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,20 @@ fn pio_comparison(comptime source: []const u8) !void {
}

fn pio_comparison_cpu(comptime cpu: CPU, comptime source: []const u8) !void {
comptime var diags: ?assembler.Diagnostics = null;
const output = try comptime assembler.assemble_impl(cpu, source, &diags, .{});
// comptime var diags: ?assembler.Diagnostics = null;
// const output = comptime blk: {
// const v = assembler.assemble_impl(cpu, source, &diags, .{}) catch |err| {
// @compileLog("err {}", err);
// if (diags != null) {
// std.log.debug("diag {}", .{diags});
// @compileLog("Diag", diags);
// }
// // I want to return an error here but this is comptime?
// break :blk err;
// };
// break :blk v;
// };
const output = comptime assembler.assemble(cpu, source, .{});
try std.testing.expect(output.programs.len > 0);

inline for (output.programs) |program| {
Expand Down

0 comments on commit ac53836

Please sign in to comment.