authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-04-11 13:31:28 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-05-29 11:25:33 -07:00
logd23c43a9090331ac8114f10c596748e44f115557
tree27643964b454c89eeee32e912d60efb8aee9aee7
parent19658da57cd45200a7b357cc2667aa058a39a7b7

remove these extraneous traces

when enabled, balloons the size of the trace from 100s of kb to 10s of mb

1 files changed, 0 insertions(+), 15 deletions(-)

src/lib.zig-15
...@@ -35,9 +35,6 @@ pub fn compile(comptime Ctx: type, alloc: std.mem.Allocator, writer: anytype, co...@@ -35,9 +35,6 @@ pub fn compile(comptime Ctx: type, alloc: std.mem.Allocator, writer: anytype, co
35}35}
3636
37pub fn compileInner(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, comptime opts: DoOptions, data: anytype) !void {37pub fn compileInner(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, comptime opts: DoOptions, data: anytype) !void {
38 const t = tracer.trace(@src(), "", .{});
39 defer t.end();
40
41 try do(alloc, writer, value, data, data, opts);38 try do(alloc, writer, value, data, data, opts);
42 try writer.writeAll("\n");39 try writer.writeAll("\n");
43}40}
...@@ -45,9 +42,6 @@ pub fn compileInner(alloc: std.mem.Allocator, writer: anytype, comptime value: a...@@ -45,9 +42,6 @@ pub fn compileInner(alloc: std.mem.Allocator, writer: anytype, comptime value: a
45pub const Writer = std.ArrayList(u8).Writer;42pub const Writer = std.ArrayList(u8).Writer;
4643
47fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, data: anytype, ctx: anytype, comptime opts: DoOptions) anyerror!void {44fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, data: anytype, ctx: anytype, comptime opts: DoOptions) anyerror!void {
48 const t = tracer.trace(@src(), "", .{});
49 defer t.end();
50
51 switch (comptime value) {45 switch (comptime value) {
52 .element => |v| {46 .element => |v| {
53 const hastext = comptime for (v.children) |x| {47 const hastext = comptime for (v.children) |x| {
...@@ -368,9 +362,6 @@ fn Field(comptime T: type, comptime field_name: string) type {...@@ -368,9 +362,6 @@ fn Field(comptime T: type, comptime field_name: string) type {
368}362}
369363
370pub fn writeEscaped(s: string, writer: anytype) !void {364pub fn writeEscaped(s: string, writer: anytype) !void {
371 const t = tracer.trace(@src(), "", .{});
372 defer t.end();
373
374 const view = std.unicode.Utf8View.initUnchecked(s);365 const view = std.unicode.Utf8View.initUnchecked(s);
375 var iter = view.iterator();366 var iter = view.iterator();
376 while (nextCodepointSliceLossy(&iter)) |sl| {367 while (nextCodepointSliceLossy(&iter)) |sl| {
...@@ -455,9 +446,6 @@ fn contains(haystack: []const string, needle: string) bool {...@@ -455,9 +446,6 @@ fn contains(haystack: []const string, needle: string) bool {
455}446}
456447
457fn doif(alloc: std.mem.Allocator, writer: anytype, comptime top: astgen.Value, comptime bottom: astgen.Value, data: anytype, ctx: anytype, comptime opts: DoOptions, flag2: bool) anyerror!void {448fn doif(alloc: std.mem.Allocator, writer: anytype, comptime top: astgen.Value, comptime bottom: astgen.Value, data: anytype, ctx: anytype, comptime opts: DoOptions, flag2: bool) anyerror!void {
458 const t = tracer.trace(@src(), "", .{});
459 defer t.end();
460
461 if (flag2) {449 if (flag2) {
462 try do(alloc, writer, top, data, ctx, opts);450 try do(alloc, writer, top, data, ctx, opts);
463 } else {451 } else {
...@@ -466,9 +454,6 @@ fn doif(alloc: std.mem.Allocator, writer: anytype, comptime top: astgen.Value, c...@@ -466,9 +454,6 @@ fn doif(alloc: std.mem.Allocator, writer: anytype, comptime top: astgen.Value, c
466}454}
467455
468fn docap(alloc: std.mem.Allocator, writer: anytype, comptime top: astgen.Value, comptime bottom: astgen.Value, data: anytype, ctx: anytype, comptime opts: DoOptions, flag2: anytype) anyerror!void {456fn docap(alloc: std.mem.Allocator, writer: anytype, comptime top: astgen.Value, comptime bottom: astgen.Value, data: anytype, ctx: anytype, comptime opts: DoOptions, flag2: anytype) anyerror!void {
469 const t = tracer.trace(@src(), "", .{});
470 defer t.end();
471
472 if (flag2) |_| {457 if (flag2) |_| {
473 try do(alloc, writer, top, data, ctx, opts);458 try do(alloc, writer, top, data, ctx, opts);
474 } else {459 } else {