changeset 1563:a0caa991cdad

Resugar tag names before printing parse errors
author Adam Chlipala <adam@chlipala.net>
date Thu, 22 Sep 2011 09:51:06 -0400
parents 7ad5227a3ed9
children da11f7b18067
files src/urweb.grm tests/badTags.ur
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/urweb.grm	Sat Sep 17 13:10:20 2011 -0400
+++ b/src/urweb.grm	Thu Sep 22 09:51:06 2011 -0400
@@ -1397,6 +1397,11 @@
                                          end)
          
        | tag GT xmlOpt END_TAG          (let
+                                             fun tagOut s =
+                                                 case s of
+                                                     "tabl" => "table"
+                                                   | _ => s
+
                                              val pos = s (tagleft, GTright)
                                              val et = tagIn END_TAG
                                          in
@@ -1423,9 +1428,9 @@
                                                       ()
                                                   else
                                                       ErrorMsg.errorAt pos ("Begin tag <"
-                                                                            ^ #1 (#1 tag)
+                                                                            ^ tagOut (#1 (#1 tag))
                                                                             ^ "> and end tag </"
-                                                                            ^ et
+                                                                            ^ tagOut et
                                                                             ^ "> don't match.");
                                                   (EWild, pos))
                                          end)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/badTags.ur	Thu Sep 22 09:51:06 2011 -0400
@@ -0,0 +1,1 @@
+fun main () : transaction page = <xml><body><table></div></body></xml>