From 247740a8a6493391d10052e3db237f1c099aeefa Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 8 Feb 2016 19:25:56 +0100 Subject: [PATCH 1/2] Change syntax errors/warnings to use FILE:LINE format --- src/scanner.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scanner.c b/src/scanner.c index 856eac80cc..ba38fcfa70 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -147,7 +147,7 @@ void SyntaxError ( /* print the message and the filename, unless it is '*stdin*' */ Pr( "Syntax error: %s", (Int)msg, 0L ); if ( strcmp( "*stdin*", TLS(Input)->name ) != 0 ) - Pr( " in %s line %d", (Int)TLS(Input)->name, (Int)TLS(Input)->number ); + Pr( " in %s:%d", (Int)TLS(Input)->name, (Int)TLS(Input)->number ); Pr( "\n", 0L, 0L ); /* print the current line */ @@ -188,7 +188,7 @@ void SyntaxWarning ( /* print the message and the filename, unless it is '*stdin*' */ Pr( "Syntax warning: %s", (Int)msg, 0L ); if ( strcmp( "*stdin*", TLS(Input)->name ) != 0 ) - Pr( " in %s line %d", (Int)TLS(Input)->name, (Int)TLS(Input)->number ); + Pr( " in %s:%d", (Int)TLS(Input)->name, (Int)TLS(Input)->number ); Pr( "\n", 0L, 0L ); /* print the current line */ From 17ca2a9c58d1125a302a96cb1efaa2778f2956c6 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 8 Feb 2016 19:27:08 +0100 Subject: [PATCH 2/2] Change Test() to report file locations in FILE:LINE format --- lib/test.gi | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/test.gi b/lib/test.gi index a43df64c60..8d93f78670 100644 --- a/lib/test.gi +++ b/lib/test.gi @@ -329,8 +329,12 @@ InstallGlobalFunction("Test", function(arg) if d[1] <> '-' then d := Concatenation("+", d); fi; - Print("########> Time diff in ", - fnam,", line ",line,":\n"); + Print("########> Time diff in "); + if IsStream(fnam) then + Print("test stream, line ",line,"\n"); + else + Print(fnam,":",line,"\n"); + fi; Print("# Input:\n", inp); Print("# Old time: ", oldt," New time: ", newt, " (", d, "%)\n"); @@ -338,11 +342,12 @@ InstallGlobalFunction("Test", function(arg) rewriteToFile := false, breakOnError := false, reportDiff := function(inp, expout, found, fnam, line, time) + Print("########> Diff in "); if IsStream(fnam) then - fnam := "test stream"; + Print("test stream, line ",line,"\n"); + else + Print(fnam,":",line,"\n"); fi; - Print("########> Diff in ", - fnam,", line ",line,":\n"); Print("# Input is:\n", inp); Print("# Expected output:\n", expout); Print("# But found:\n", found);