[PATCH 06/10] reports: let html reports catch up with --report and --graph

Akim Demaille <[email protected]>
Newsgroups gmane.comp.parsers.bison.patches
Message-ID <[email protected]>
* data/xslt/xml2xhtml.xsl: Show the symbol types.
* tests/report.at: Adjust.
---
 data/xslt/xml2xhtml.xsl |  6 ++++++
 tests/report.at         | 12 ++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/data/xslt/xml2xhtml.xsl b/data/xslt/xml2xhtml.xsl
index c269745b..a1afad2d 100644
--- a/data/xslt/xml2xhtml.xsl
+++ b/data/xslt/xml2xhtml.xsl
@@ -331,6 +331,9 @@
   <xsl:text>  </xsl:text>
   <li>
     <b><xsl:value-of select="@name"/></b>
+    <xsl:if test="string-length(@type) != 0">
+      <xsl:value-of select="concat(' &lt;', @type, '&gt;')"/>
+    </xsl:if>
     <xsl:value-of select="concat(' (', @token-number, ')')"/>
     <xsl:for-each select="key('bison:ruleByRhs', @name)">
       <xsl:apply-templates select="." mode="number-link"/>
@@ -343,6 +346,9 @@
   <xsl:text>  </xsl:text>
   <li>
     <b><xsl:value-of select="@name"/></b>
+    <xsl:if test="string-length(@type) != 0">
+      <xsl:value-of select="concat(' &lt;', @type, '&gt;')"/>
+    </xsl:if>
     <xsl:value-of select="concat(' (', @symbol-number, ')')"/>
     <xsl:text>&#10;    </xsl:text>
     <ul>
diff --git a/tests/report.at b/tests/report.at
index 9f6d6701..2250abbb 100644
--- a/tests/report.at
+++ b/tests/report.at
@@ -1233,8 +1233,8 @@ if test x"$XSLTPROC" != x""; then
   <li><b>error</b> (256)</li>
   <li><b>":="</b> (258) <a href="#rule_4">4</a></li>
   <li><b>"incr"</b> (259) <a href="#rule_8">8</a></li>
-  <li><b>"identifier"</b> (260) <a href="#rule_5">5</a> <a href="#rule_10">10</a></li>
-  <li><b>"number"</b> (261) <a href="#rule_11">11</a></li>
+  <li><b>"identifier"</b> &lt;std::string&gt; (260) <a href="#rule_5">5</a> <a href="#rule_10">10</a></li>
+  <li><b>"number"</b> &lt;int&gt; (261) <a href="#rule_11">11</a></li>
   <li><b>"("</b> (262) <a href="#rule_9">9</a></li>
   <li><b>")"</b> (263) <a href="#rule_9">9</a></li>
 </ul>
@@ -1265,25 +1265,25 @@ if test x"$XSLTPROC" != x""; then
       <li>on right: <a href="#rule_3">3</a></li>
     </ul>
   </li>
-  <li><b>id</b> (13)
+  <li><b>id</b> &lt;std::string&gt; (13)
     <ul>
       <li>on left: <a href="#rule_5">5</a></li>
       <li>on right: <a href="#rule_4">4</a></li>
     </ul>
   </li>
-  <li><b>exp</b> (14)
+  <li><b>exp</b> &lt;int&gt; (14)
     <ul>
       <li>on left: <a href="#rule_8">8</a> <a href="#rule_9">9</a> <a href="#rule_10">10</a> <a href="#rule_11">11</a></li>
       <li>on right: <a href="#rule_1">1</a> <a href="#rule_4">4</a> <a href="#rule_8">8</a> <a href="#rule_9">9</a></li>
     </ul>
   </li>
-  <li><b>@1</b> (15)
+  <li><b>@1</b> &lt;int&gt; (15)
     <ul>
       <li>on left: <a href="#rule_6">6</a></li>
       <li>on right: <a href="#rule_8">8</a></li>
     </ul>
   </li>
-  <li><b>@2</b> (16)
+  <li><b>@2</b> &lt;int&gt; (16)
     <ul>
       <li>on left: <a href="#rule_7">7</a></li>
       <li>on right: <a href="#rule_8">8</a></li>
-- 
2.27.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.