Report filenames in error messages.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 12 Feb 2009 02:37:59 -0500
changeset 577 bec531dd448e
parent 576 d7ec39b7abab
child 578 6c8f73c845e7
Report filenames in error messages.
assemble.c
finderrors.c
preprocess.c
testoutput.c
testparse.c
--- a/assemble.c	Thu Feb 12 02:18:24 2009 -0500
+++ b/assemble.c	Thu Feb 12 02:37:59 2009 -0500
@@ -30,7 +30,8 @@
         int i;
         for (i = 0; i < pd->error_count; i++)
         {
-            printf("ERROR: (line %d) %s\n",
+            printf("%s:%d: ERROR: %s\n",
+                    pd->errors[i].filename ? pd->errors[i].filename : "???",
                     pd->errors[i].error_position,
                     pd->errors[i].error);
         } // for
--- a/finderrors.c	Thu Feb 12 02:18:24 2009 -0500
+++ b/finderrors.c	Thu Feb 12 02:37:59 2009 -0500
@@ -88,7 +88,10 @@
 
         if (a->error_count > 0)
         {
-            report("FAIL: %s (line %d) %s\n", fname, a->errors[0].error_position, a->errors[0].error);
+            report("FAIL: %s (line %d) %s\n",
+                a->errors[0].filename ? a->errors[0].filename : "???",
+                a->errors[0].error_position,
+                a->errors[0].error);
             return 1;
         } // if
 
--- a/preprocess.c	Thu Feb 12 02:18:24 2009 -0500
+++ b/preprocess.c	Thu Feb 12 02:37:59 2009 -0500
@@ -31,7 +31,8 @@
         int i;
         for (i = 0; i < pd->error_count; i++)
         {
-            printf("ERROR: (line %d) %s\n",
+            printf("%s:%d: ERROR: %s\n",
+                    pd->errors[i].filename ? pd->errors[i].filename : "???",
                     pd->errors[i].error_position,
                     pd->errors[i].error);
         } // for
--- a/testoutput.c	Thu Feb 12 02:18:24 2009 -0500
+++ b/testoutput.c	Thu Feb 12 02:37:59 2009 -0500
@@ -22,7 +22,8 @@
         int i;
         for (i = 0; i < pd->error_count; i++)
         {
-            printf("ERROR: (line %d) %s\n",
+            printf("%s:%d: ERROR: %s\n",
+                    pd->errors[i].filename ? pd->errors[i].filename : "???",
                     pd->errors[i].error_position,
                     pd->errors[i].error);
         } // for
--- a/testparse.c	Thu Feb 12 02:18:24 2009 -0500
+++ b/testparse.c	Thu Feb 12 02:37:59 2009 -0500
@@ -66,7 +66,8 @@
         int i;
         for (i = 0; i < pd->error_count; i++)
         {
-            printf("ERROR: (position %d) %s\n",
+            printf("%s:%d: ERROR: %s\n",
+                    pd->errors[i].filename ? pd->errors[i].filename : "???",
                     pd->errors[i].error_position,
                     pd->errors[i].error);
         } // for