]> matita.cs.unibo.it Git - helm.git/commitdiff
Modified Files:
authorIrene Schena <irene.schena@unibo.it>
Mon, 5 Feb 2001 16:53:24 +0000 (16:53 +0000)
committerIrene Schena <irene.schena@unibo.it>
Mon, 5 Feb 2001 16:53:24 +0000 (16:53 +0000)
1) mmlextension.xsl: added associativity (by means of parenthesis) to
the arrow
2) objcontent.xsl: no more mode="noannot" into apply-templates of the
abstparams template

helm/style/mmlextension.xsl
helm/style/objcontent.xsl

index 9113ba51c2a1643c2a0b3aee6e53a82d32c921ab..f9dcfae51b6dd0ee8cb0809ad77fd7398982ea7a 100644 (file)
 <!-- CSYMBOL -->
 
 <xsl:template match="m:apply[m:csymbol]">
+<xsl:param name="nopar" select="1"/>
     <xsl:variable name="name"><xsl:value-of select="m:csymbol"/></xsl:variable>
     <xsl:variable name="charlength"><xsl:apply-templates select="m:csymbol" mode="charcount"/></xsl:variable>
     <m:mrow>
          <m:mtr>
           <m:mtd>
            <m:mrow>
-            <m:mo stretchy="false">(</m:mo>
-            <xsl:apply-templates select="*[position()=2]"/>
+            <xsl:if test="$nopar=0">
+             <m:mo stretchy="false">(</m:mo>
+            </xsl:if>
+            <xsl:apply-templates select="*[position()=2]"><xsl:with-param name="nopar" select="0"/></xsl:apply-templates>
            </m:mrow>
           </m:mtd>
          </m:mtr>
           <m:mtd>
            <m:mrow>
             <m:mo mathmathcolor="Blue">&#x2192;</m:mo>
-            <xsl:apply-templates select="*[position()=3]"/>
+            <xsl:choose>
+            <xsl:when test="*[position()=3]/m:csymbol">
+             <xsl:variable name="nextp"><xsl:value-of select="*[position()=3]/m:csymbol"/></xsl:variable>
+             <xsl:choose>
+             <xsl:when test="$nextp='arrow'">
+              <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="1"/></xsl:apply-templates>
+             </xsl:when>
+             <xsl:otherwise>
+              <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="0"/></xsl:apply-templates>
+             </xsl:otherwise>
+             </xsl:choose>
+            </xsl:when>
+            <xsl:otherwise>
+             <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="0"/></xsl:apply-templates>
+            </xsl:otherwise>
+            </xsl:choose>
            </m:mrow>
           </m:mtd>
          </m:mtr>
+         <xsl:if test="$nopar=0">
          <m:mtr>
           <m:mtd>
            <m:mrow>
            </m:mrow>
           </m:mtd>
          </m:mtr>
+         </xsl:if>
         </m:mtable>
        </xsl:when>
        <xsl:otherwise>
-        <m:mo stretchy="false">(</m:mo>
-        <xsl:apply-templates select="*[position()=2]"/>
+        <xsl:if test="$nopar=0">
+         <m:mo stretchy="false">(</m:mo>
+        </xsl:if>
+        <xsl:apply-templates select="*[position()=2]"><xsl:with-param name="nopar" select="0"/></xsl:apply-templates>
         <m:mo mathcolor="Blue">&#x2192;</m:mo>
-        <xsl:apply-templates select="*[position()=3]"/>
-        <m:mo stretchy="false">)</m:mo>
+        <xsl:choose>
+        <xsl:when test="*[position()=3]/m:csymbol">
+         <xsl:variable name="nextp"><xsl:value-of select="*[position()=3]/m:csymbol"/></xsl:variable>
+         <xsl:choose>
+         <xsl:when test="$nextp='arrow'">
+          <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="1"/></xsl:apply-templates>
+         </xsl:when>
+         <xsl:otherwise>
+          <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="0"/></xsl:apply-templates>
+         </xsl:otherwise>
+         </xsl:choose>
+        </xsl:when>
+        <xsl:otherwise>
+         <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="0"/></xsl:apply-templates>
+        </xsl:otherwise>
+        </xsl:choose>
+        <xsl:if test="$nopar=0">
+         <m:mo stretchy="false">)</m:mo>
+        </xsl:if>
        </xsl:otherwise>
        </xsl:choose>
       </xsl:when>
 </xsl:stylesheet> 
 
 
+
index 4ab19c854ba8aa8f59bd7a162e82f8e999e9b3d7..8de642f1bb424996a40adf7ce6d2c913a50d8292 100644 (file)
        </xsl:when>
        <xsl:otherwise> 
         <Param name="{target/@binder}">
-         <xsl:apply-templates select="source" mode="noannot"/>
+         <xsl:apply-templates select="source"/>
         </Param>
        </xsl:otherwise>
        </xsl:choose>
      <xsl:when test="($target = 1) and ($noparams != 0)">
       <m:apply>
       <m:csymbol>app</m:csymbol>
-      <xsl:apply-templates select="." mode="noannot"/>
+      <xsl:apply-templates select="."/>
       <xsl:call-template name="printparam"><xsl:with-param name="noleft" select="$noparams"/></xsl:call-template>
       </m:apply>
      </xsl:when>
       </xsl:when>
       <xsl:otherwise>
        <xsl:if test="$target = 1">
-        <xsl:apply-templates select="." mode="noannot"/>
+        <xsl:apply-templates select="."/>
        </xsl:if>
       </xsl:otherwise>
       </xsl:choose>