comparison src/errormsg.sml @ 1747:9b54fbe1efdb

Adjust error message format to match Emacs defaults
author Adam Chlipala <adam@chlipala.net>
date Sat, 05 May 2012 19:57:54 -0400
parents 8f8771f32909
children 95dd9f427bb2
comparison
equal deleted inserted replaced
1746:1dd8a8791d9c 1747:9b54fbe1efdb
1 (* Copyright (c) 2008, Adam Chlipala 1 (* Copyright (c) 2008, 2012, Adam Chlipala
2 * All rights reserved. 2 * All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met: 5 * modification, are permitted provided that the following conditions are met:
6 * 6 *
92 fun resetErrors () = errors := false 92 fun resetErrors () = errors := false
93 fun anyErrors () = !errors 93 fun anyErrors () = !errors
94 fun error s = (TextIO.output (TextIO.stdErr, s); 94 fun error s = (TextIO.output (TextIO.stdErr, s);
95 TextIO.output1 (TextIO.stdErr, #"\n"); 95 TextIO.output1 (TextIO.stdErr, #"\n");
96 errors := true) 96 errors := true)
97 fun errorAt span s = (TextIO.output (TextIO.stdErr, spanToString span); 97
98 TextIO.output (TextIO.stdErr, ": "); 98 fun errorAt span s = (TextIO.output (TextIO.stdErr, #file span);
99 TextIO.output (TextIO.stdErr, ":");
100 TextIO.output (TextIO.stdErr, posToString (#first span));
101 TextIO.output (TextIO.stdErr, ": (to ");
102 TextIO.output (TextIO.stdErr, posToString (#last span));
103 TextIO.output (TextIO.stdErr, ") ");
99 error s) 104 error s)
100 fun errorAt' span s = errorAt (spanOf span) s 105 fun errorAt' span s = errorAt (spanOf span) s
101 106
102 end 107 end