changeset 1189:b8cfb05c091d

More informative tag mismatch error message
author Adam Chlipala <adamc@hcoop.net>
date Tue, 16 Mar 2010 16:17:02 -0400
parents 86653ff6a0cb
children 899875315bde
files src/urweb.grm tests/mismatch.ur tests/mismatch.urp tests/mismatch.urs
diffstat 4 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/urweb.grm	Tue Mar 16 16:02:54 2010 -0400
+++ b/src/urweb.grm	Tue Mar 16 16:17:02 2010 -0400
@@ -1342,7 +1342,11 @@
                                                  (if ErrorMsg.anyErrors () then
                                                       ()
                                                   else
-                                                      ErrorMsg.errorAt pos "Begin and end tags don't match.";
+                                                      ErrorMsg.errorAt pos ("Begin tag <"
+                                                                            ^ #1 (#1 tag)
+                                                                            ^ "> and end tag </"
+                                                                            ^ et
+                                                                            ^ "> don't match.");
                                                   (EWild, pos))
                                          end)
        | LBRACE eexp RBRACE             (eexp)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/mismatch.ur	Tue Mar 16 16:17:02 2010 -0400
@@ -0,0 +1,3 @@
+fun main () = return <xml><body>
+  <b>Wowza!</i>
+</body></xml>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/mismatch.urp	Tue Mar 16 16:17:02 2010 -0400
@@ -0,0 +1,1 @@
+mismatch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/mismatch.urs	Tue Mar 16 16:17:02 2010 -0400
@@ -0,0 +1,1 @@
+val main : unit -> transaction page