From 1200a1527187fe7f21bbb0b74152efe33355e60b Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 16 Mar 2010 16:17:02 -0400 Subject: More informative tag mismatch error message --- src/urweb.grm | 6 +++++- tests/mismatch.ur | 3 +++ tests/mismatch.urp | 1 + tests/mismatch.urs | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/mismatch.ur create mode 100644 tests/mismatch.urp create mode 100644 tests/mismatch.urs diff --git a/src/urweb.grm b/src/urweb.grm index a6af8aa3..4738f7f3 100644 --- a/src/urweb.grm +++ b/src/urweb.grm @@ -1342,7 +1342,11 @@ xmlOne : NOTAGS (EApp ((EVar (["Basis"], "cdata", Infer) (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 don't match."); (EWild, pos)) end) | LBRACE eexp RBRACE (eexp) diff --git a/tests/mismatch.ur b/tests/mismatch.ur new file mode 100644 index 00000000..e18e373d --- /dev/null +++ b/tests/mismatch.ur @@ -0,0 +1,3 @@ +fun main () = return + Wowza! + diff --git a/tests/mismatch.urp b/tests/mismatch.urp new file mode 100644 index 00000000..65f340b7 --- /dev/null +++ b/tests/mismatch.urp @@ -0,0 +1 @@ +mismatch diff --git a/tests/mismatch.urs b/tests/mismatch.urs new file mode 100644 index 00000000..6ac44e0b --- /dev/null +++ b/tests/mismatch.urs @@ -0,0 +1 @@ +val main : unit -> transaction page -- cgit v1.2.3