diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-12-19 19:16:33 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-12-19 19:27:26 -0500 |
commit | 970ecabc1ad30fa74e58f3d4ad9ccf41baffb8b0 (patch) | |
tree | fd2d4eb68391a5b911d5a158a5506487d04a6298 /dimension/utility.c | |
parent | 51fda684667044e2fe3e56f28137ef5397ef03ee (diff) | |
download | dimension-970ecabc1ad30fa74e58f3d4ad9ccf41baffb8b0.tar.xz |
Implement a symbol table.
Diffstat (limited to 'dimension/utility.c')
-rw-r--r-- | dimension/utility.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/dimension/utility.c b/dimension/utility.c index 1961d3e..012e704 100644 --- a/dimension/utility.c +++ b/dimension/utility.c @@ -22,13 +22,17 @@ #include <stdio.h> void -dmnsn_diagnostic(const char *filename, unsigned int line, unsigned int col, - const char *format, ...) +dmnsn_diagnostic(const char *filename, int line, int col, const char *format, + ...) { va_list ap; va_start(ap, format); - fprintf(stderr, "%s:%u:%u: ", filename, line, col); + if (line >= 0 && col >= 0) { + fprintf(stderr, "%s:%d:%d: ", filename, line, col); + } else { + fprintf(stderr, "%s: ", filename); + } vfprintf(stderr, format, ap); fprintf(stderr, "\n"); |