From dc77d6500fc26074895d9b8bb5089261dc7a28b1 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 11 Jul 2020 11:10:58 +0200 Subject: [PATCH] html: don't define several times the same anchors Currently when we output useless rules, they appear before the grammar, but using the same invocation. As a result, the anchor is defined twice, and the wrong one, being first, is honored. * data/xslt/xml2xhtml.xsl (rule): Take a new 'anchor' parameter to decide whether being an anchor, or a target. Let it be true when output the grammar. * tests/report.at: Adjust. --- data/xslt/xml2xhtml.xsl | 34 ++++++++++++++++++++-------------- tests/report.at | 38 +++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 33 deletions(-) diff --git a/data/xslt/xml2xhtml.xsl b/data/xslt/xml2xhtml.xsl index b5aeba94..706ff997 100644 --- a/data/xslt/xml2xhtml.xsl +++ b/data/xslt/xml2xhtml.xsl @@ -227,6 +227,7 @@

+ @@ -238,9 +239,11 @@ + + @@ -488,7 +491,12 @@ + + @@ -499,17 +507,21 @@ - - - - - - - - + + + + + + + + + + + + @@ -519,12 +531,6 @@ - - - - - - diff --git a/tests/report.at b/tests/report.at index 2250abbb..7c3a1690 100644 --- a/tests/report.at +++ b/tests/report.at @@ -1205,25 +1205,25 @@ if test x"$XSLTPROC" != x""; then

Grammar

- 0 $acceptunit "end of file" + 0 $acceptunit "end of file" - 1 unitassignments exp + 1 unitassignments exp - 2 assignments → %empty - 3 | assignments assignment + 2 assignments → %empty + 3 | assignments assignment - 4 assignmentid ":=" exp + 4 assignmentid ":=" exp - 5 id"identifier" + 5 id"identifier" - 6 @1 → %empty + 6 @1 → %empty - 7 @2 → %empty + 7 @2 → %empty - 8 exp"incr" exp @1 @2 exp - 9 | "(" exp ")" - 10 | "identifier" - 11 | "number" + 8 exp"incr" exp @1 @2 exp + 9 | "(" exp ")" + 10 | "identifier" + 11 | "number"

Terminals, with rules where they appear

@@ -2158,7 +2158,7 @@ if test x"$XSLTPROC" != x""; then

Rules useless in grammar

Rules useless in parser due to conflicts

- 3 expexp "+" exp + 3 expexp "+" exp

Conflicts

@@ -2169,13 +2169,13 @@ if test x"$XSLTPROC" != x""; then

Grammar

- 0 $acceptexp $end + 0 $acceptexp $end - 1 expexp "⊕" exp - 2 | exp "+" exp - 3 | exp "+" exp - 4 | "number" - 5 | "Ñùṃéℝô" + 1 expexp "⊕" exp + 2 | exp "+" exp + 3 | exp "+" exp + 4 | "number" + 5 | "Ñùṃéℝô"

Terminals, with rules where they appear