From e83fb349397ec2ab8b92cb648576140a1fea4fab Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 17 Feb 2011 14:18:18 -0500 Subject: More information in error message about select of field from unbound table --- src/urweb.grm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/urweb.grm b/src/urweb.grm index bed80c98..40cfd2de 100644 --- a/src/urweb.grm +++ b/src/urweb.grm @@ -58,6 +58,12 @@ fun eqTnames ((c1, _), (c2, _)) = | (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 @@ fun amend_select loc (si, (count, tabs, exps)) = 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 -- cgit v1.2.3