changeset 1424:7f6ac9f33d4d

More information in error message about select of field from unbound table
author Adam Chlipala <adam@chlipala.net>
date Thu, 17 Feb 2011 14:18:18 -0500
parents bd6c90f5a428
children 139d019c7237
files src/urweb.grm
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/urweb.grm	Thu Feb 10 08:46:46 2011 -0500
+++ b/src/urweb.grm	Thu Feb 17 14:18:18 2011 -0500
@@ -58,6 +58,12 @@
       | (CName x1, CName x2) => x1 = x2
       | _ => false
 
+fun nameString (c, _) =
+    case c of
+        CName s => s
+      | CVar (_, x) => x
+      | _ => "?"
+
 fun amend_select loc (si, (count, tabs, exps)) =
     case si of
         Field (tx, fx) =>
@@ -74,7 +80,7 @@
             if found then
                 ()
             else
-                ErrorMsg.errorAt loc "Select of field from unbound table";
+                ErrorMsg.errorAt loc ("Select of field " ^ nameString fx ^ " from unbound table " ^ nameString tx);
             
             (count, tabs, exps)
         end