summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-02-17 14:18:18 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2011-02-17 14:18:18 -0500
commite83fb349397ec2ab8b92cb648576140a1fea4fab (patch)
treefc2f8ff71c017b462187c7d8879003845cd1c2c6 /src
parent98271e4a9f570230175f68417d1aa91f6caf7cd8 (diff)
More information in error message about select of field from unbound table
Diffstat (limited to 'src')
-rw-r--r--src/urweb.grm8
1 files changed, 7 insertions, 1 deletions
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