11const std = @import ("std" );
2+ const Writer = std .Io .Writer ;
23const scripty = @import ("scripty" );
34const tracy = @import ("tracy" );
45const root = @import ("root.zig" );
@@ -11,7 +12,7 @@ const Node = Ast.Node;
1112
1213const log = std .log .scoped (.supertemplate );
1314
14- pub fn SuperTemplate (comptime ScriptyVM : type , comptime OutWriter : type ) type {
15+ pub fn SuperTemplate (comptime ScriptyVM : type ) type {
1516 return struct {
1617 arena : std.mem.Allocator ,
1718 name : []const u8 ,
@@ -82,7 +83,7 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
8283 std .debug .assert (tpl .print_cursor == tpl .print_end );
8384 }
8485
85- pub fn showBlocks (tpl : Template , err_writer : errors.ErrWriter ) error {ErrIO }! void {
86+ pub fn showBlocks (tpl : Template , err_writer : * Writer ) error {ErrIO }! void {
8687 var found_first = false ;
8788 var it = tpl .ast .blocks .iterator ();
8889 while (it .next ()) | kv | {
@@ -111,7 +112,7 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
111112 err_writer .print ("\n " , .{}) catch return error .ErrIO ;
112113 }
113114
114- pub fn showInterface (tpl : Template , err_writer : errors.ErrWriter ) error {ErrIO }! void {
115+ pub fn showInterface (tpl : Template , err_writer : * Writer ) error {ErrIO }! void {
115116 var found_first = false ;
116117 var it = tpl .ast .interface .iterator ();
117118 while (it .next ()) | kv | {
@@ -144,8 +145,8 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
144145 script_vm : * ScriptyVM ,
145146 script_ctx : * Context ,
146147 super_id : []const u8 ,
147- writer : OutWriter ,
148- err_writer : errors.ErrWriter ,
148+ writer : * Writer ,
149+ err_writer : * Writer ,
149150 ) errors.FatalOOM ! void {
150151 _ = script_vm ;
151152 _ = script_ctx ;
@@ -245,8 +246,8 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
245246 tpl : * Template ,
246247 scripty_vm : * ScriptyVM ,
247248 scripty_ctx : * Context ,
248- writer : OutWriter ,
249- err_writer : errors.ErrWriter ,
249+ writer : * Writer ,
250+ err_writer : * Writer ,
250251 ) errors.FatalShowOOM ! Continuation {
251252 const zone = tracy .trace (@src ());
252253 defer zone .end ();
@@ -922,7 +923,7 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
922923
923924 fn evalVar (
924925 tpl : * Template ,
925- err_writer : errors.ErrWriter ,
926+ err_writer : * Writer ,
926927 script_vm : * ScriptyVM ,
927928 script_ctx : * Context ,
928929 script_attr_name : Span ,
@@ -976,7 +977,7 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
976977
977978 fn evalCtx (
978979 tpl : * Template ,
979- err_writer : errors.ErrWriter ,
980+ err_writer : * Writer ,
980981 script_vm : * ScriptyVM ,
981982 script_ctx : * Context ,
982983 script_attr_name : Span ,
@@ -1028,7 +1029,7 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
10281029
10291030 fn evalAttr (
10301031 tpl : * Template ,
1031- err_writer : errors.ErrWriter ,
1032+ err_writer : * Writer ,
10321033 script_vm : * ScriptyVM ,
10331034 script_ctx : * Context ,
10341035 script_attr_name : Span ,
@@ -1077,7 +1078,7 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
10771078
10781079 fn evalIf (
10791080 tpl : * Template ,
1080- err_writer : errors.ErrWriter ,
1081+ err_writer : * Writer ,
10811082 script_vm : * ScriptyVM ,
10821083 script_ctx : * Context ,
10831084 script_attr_name : Span ,
@@ -1130,7 +1131,7 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
11301131
11311132 fn evalLoop (
11321133 tpl : * Template ,
1133- err_writer : errors.ErrWriter ,
1134+ err_writer : * Writer ,
11341135 script_vm : * ScriptyVM ,
11351136 script_ctx : * Context ,
11361137 script_attr_name : Span ,
@@ -1183,7 +1184,7 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
11831184
11841185 pub fn reportError (
11851186 self : Template ,
1186- err_writer : errors.ErrWriter ,
1187+ err_writer : * Writer ,
11871188 bad_node : Span ,
11881189 error_code : []const u8 ,
11891190 comptime title : []const u8 ,
@@ -1203,7 +1204,7 @@ pub fn SuperTemplate(comptime ScriptyVM: type, comptime OutWriter: type) type {
12031204
12041205 pub fn diagnostic (
12051206 tpl : Template ,
1206- err_writer : errors.ErrWriter ,
1207+ err_writer : * Writer ,
12071208 bracket : bool ,
12081209 note_line : []const u8 ,
12091210 bad_node : Span ,
0 commit comments