From a67544c0aa4c12b6b900345d16d43d0ee20eccf1 Mon Sep 17 00:00:00 2001 From: Irene Schena <irene.schena@unibo.it> Date: Mon, 5 Feb 2001 16:53:24 +0000 Subject: [PATCH] Modified Files: 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 | 54 ++++++++++++++++++++++++++++++++----- helm/style/objcontent.xsl | 6 ++--- 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/helm/style/mmlextension.xsl b/helm/style/mmlextension.xsl index 9113ba51c..f9dcfae51 100644 --- a/helm/style/mmlextension.xsl +++ b/helm/style/mmlextension.xsl @@ -383,6 +383,7 @@ <!-- 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> @@ -500,8 +501,10 @@ <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> @@ -509,10 +512,26 @@ <m:mtd> <m:mrow> <m:mo mathmathcolor="Blue">→</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> @@ -520,14 +539,34 @@ </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">→</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> @@ -1543,3 +1582,4 @@ </xsl:stylesheet> + diff --git a/helm/style/objcontent.xsl b/helm/style/objcontent.xsl index 4ab19c854..8de642f1b 100644 --- a/helm/style/objcontent.xsl +++ b/helm/style/objcontent.xsl @@ -181,7 +181,7 @@ </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> @@ -206,7 +206,7 @@ <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> @@ -217,7 +217,7 @@ </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> -- 2.39.5