comparison src/urweb.grm @ 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 6f046b4bad24
children 5530a8075b62
comparison
equal deleted inserted replaced
1562:7ad5227a3ed9 1563:a0caa991cdad
1395 in 1395 in
1396 (EApp (#3 tag, cdata), pos) 1396 (EApp (#3 tag, cdata), pos)
1397 end) 1397 end)
1398 1398
1399 | tag GT xmlOpt END_TAG (let 1399 | tag GT xmlOpt END_TAG (let
1400 fun tagOut s =
1401 case s of
1402 "tabl" => "table"
1403 | _ => s
1404
1400 val pos = s (tagleft, GTright) 1405 val pos = s (tagleft, GTright)
1401 val et = tagIn END_TAG 1406 val et = tagIn END_TAG
1402 in 1407 in
1403 if #1 (#1 tag) = et then 1408 if #1 (#1 tag) = et then
1404 if et = "form" then 1409 if et = "form" then
1421 else 1426 else
1422 (if ErrorMsg.anyErrors () then 1427 (if ErrorMsg.anyErrors () then
1423 () 1428 ()
1424 else 1429 else
1425 ErrorMsg.errorAt pos ("Begin tag <" 1430 ErrorMsg.errorAt pos ("Begin tag <"
1426 ^ #1 (#1 tag) 1431 ^ tagOut (#1 (#1 tag))
1427 ^ "> and end tag </" 1432 ^ "> and end tag </"
1428 ^ et 1433 ^ tagOut et
1429 ^ "> don't match."); 1434 ^ "> don't match.");
1430 (EWild, pos)) 1435 (EWild, pos))
1431 end) 1436 end)
1432 | LBRACE eexp RBRACE (eexp) 1437 | LBRACE eexp RBRACE (eexp)
1433 | LBRACE LBRACK eexp RBRACK RBRACE (let 1438 | LBRACE LBRACK eexp RBRACK RBRACE (let