| ... | @@ -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 | } |
| 36 | | 36 | |
| 37 | pub fn compileInner(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, comptime opts: DoOptions, data: anytype) !void { | 37 | pub 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 |
| 45 | pub const Writer = std.ArrayList(u8).Writer; | 42 | pub const Writer = std.ArrayList(u8).Writer; |
| 46 | | 43 | |
| 47 | fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, data: anytype, ctx: anytype, comptime opts: DoOptions) anyerror!void { | 44 | fn 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 | } |
| 369 | | 363 | |
| 370 | pub fn writeEscaped(s: string, writer: anytype) !void { | 364 | pub 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 | } |
| 456 | | 447 | |
| 457 | fn 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 { | 448 | fn 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 | } |
| 467 | | 455 | |
| 468 | fn 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 { | 456 | fn 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 { |