@@ -66,7 +66,7 @@ pub fn main() !void {
6666 const args = try std .process .argsAlloc (allocator );
6767 defer std .process .argsFree (allocator , args );
6868 arguments (allocator , vm ) catch | err | {
69- Reporter .printErr ("Chyba: {}" , .{err }) catch @panic ("Hodnotu se nepodařilo vypsat" );
69+ vm . reporter .printErr ("Chyba: {}" , .{err }) catch @panic ("Hodnotu se nepodařilo vypsat" );
7070 };
7171
7272 if (debug .benchmark ) {
@@ -123,10 +123,7 @@ fn arguments(allocator: Allocator, vm: *VM) !void {
123123
124124 if (res .positionals .len > 0 and res .positionals [0 ].len > 0 ) {
125125 vm .reporter .file = res .positionals [0 ][0 ];
126- runFile (allocator , res .positionals [0 ][0 ], vm ) catch | err | {
127- Reporter .printErr ("Chyba při běhu skriptu: {}" , .{err }) catch {};
128- std .process .exit (1 );
129- };
126+ runFile (allocator , res .positionals [0 ][0 ], vm ) catch {};
130127 } else {
131128 vm .reporter .file = "REPL" ;
132129 repl (allocator , vm ) catch {};
@@ -172,7 +169,7 @@ fn repl(allocator: Allocator, vm: *VM) !void {
172169 const input = std .mem .trim (u8 , buf_stream .getWritten (), "\n \r " );
173170
174171 if (input .len == buf .len ) {
175- try Reporter .printErr ("Vstup je příliš dlouhý" , .{});
172+ try vm . reporter .printErr ("Vstup je příliš dlouhý" , .{});
176173 try stdin_file .reader (& stdin_buf ).skipUntilDelimiterOrEof ('\n ' );
177174 continue ;
178175 }
@@ -217,7 +214,7 @@ fn runFile(allocator: Allocator, filename: []const u8, vm: *VM) !void {
217214 filename ,
218215 1024 * 1024 ,
219216 ) catch {
220- Reporter .printErr ("Soubor nebyl nalezen" , .{}) catch {
217+ vm . reporter .printErr ("Soubor nebyl nalezen" , .{}) catch {
221218 @panic ("Hodnotu se nepodařilo vypsat" );
222219 };
223220 return ;
0 commit comments