Skip to content

Commit

Permalink
Merge branch 'mh/syntax-error-lines' of https://github.com/fingolfin/gap
Browse files Browse the repository at this point in the history
 into fingolfin-mh/syntax-error-lines
  • Loading branch information
markuspf committed Feb 18, 2016
2 parents f8368cc + 17ca2a9 commit 804fb7a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 10 additions & 5 deletions lib/test.gi
Original file line number Diff line number Diff line change
Expand Up @@ -329,20 +329,25 @@ 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");
end,
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);
Expand Down
4 changes: 2 additions & 2 deletions src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 804fb7a

Please sign in to comment.