Skip to content

Commit

Permalink
fix printing of integers
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoff-it committed Aug 30, 2024
1 parent 85a2c61 commit d57b196
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions src/template.zig
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,9 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
writer.writeAll(s.value) catch return error.OutIO;
},
.int => |i| {
writer.print("{}", .{i}) catch return error.OutIO;
writer.print("{d}", .{
i.value,
}) catch return error.OutIO;
},
},
.text => |text| switch (text) {
Expand All @@ -393,7 +395,9 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
}) catch return error.OutIO;
},
.int => |i| {
writer.print("{}", .{i}) catch return error.OutIO;
writer.print("{d}", .{
i.value,
}) catch return error.OutIO;
},
},
}
Expand Down Expand Up @@ -596,7 +600,9 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
writer.writeAll(s.value) catch return error.OutIO;
},
.int => |i| {
writer.print("{}", .{i}) catch return error.OutIO;
writer.print("{d}", .{
i.value,
}) catch return error.OutIO;
},
},
.text => |text| switch (text) {
Expand All @@ -607,7 +613,9 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
}) catch return error.OutIO;
},
.int => |i| {
writer.print("{}", .{i}) catch return error.OutIO;
writer.print("{d}", .{
i.value,
}) catch return error.OutIO;
},
},
}
Expand Down Expand Up @@ -734,10 +742,9 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
) catch return error.OutIO;
},
.int => |i| {
writer.print(
"=\"{}\"",
.{i},
) catch return error.OutIO;
writer.print("=\"{d}\"", .{
i.value,
}) catch return error.OutIO;
},
}
continue;
Expand Down Expand Up @@ -838,7 +845,9 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
writer.writeAll(s.value) catch return error.OutIO;
},
.int => |i| {
writer.print("{}", .{i}) catch return error.OutIO;
writer.print("{d}", .{
i.value,
}) catch return error.OutIO;
},
},
.text => |text| switch (text) {
Expand All @@ -849,7 +858,9 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
}) catch return error.OutIO;
},
.int => |i| {
writer.print("{}", .{i}) catch return error.OutIO;
writer.print("{d}", .{
i.value,
}) catch return error.OutIO;
},
},
}
Expand Down

0 comments on commit d57b196

Please sign in to comment.