Fixed a bug in the creation of "cat ... EOF" blocks, found when creating /usr/bin/lex in 081-flex.
This commit is contained in:
parent
92568bf217
commit
1f025ca967
1 changed files with 25 additions and 8 deletions
|
@ -124,15 +124,16 @@
|
|||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains(string(),'EOF')">
|
||||
<xsl:variable name="content">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="substring-before(string($content), 'cat >')"/>
|
||||
<xsl:text>
(
cat << EOF</xsl:text>
|
||||
<xsl:value-of select="substring-after(string($content), '"EOF"')"/>
|
||||
<xsl:text>
) ></xsl:text>
|
||||
<xsl:value-of select="substring-after((substring-before(string($content), '<<')), 'cat >')"/>
|
||||
<xsl:value-of select="substring-before(string(),'cat >')"/>
|
||||
<xsl:text>
(
cat << EOF
</xsl:text>
|
||||
<xsl:apply-templates select="literal"/>
|
||||
<xsl:text>
EOF
) ></xsl:text>
|
||||
<xsl:value-of select="substring-after((substring-before(string(),'<<')),'cat >')"/>
|
||||
<xsl:text> &&
</xsl:text>
|
||||
<xsl:if test="string-length(substring-after(string(),'EOF
')) > 0">
|
||||
<xsl:value-of select="substring-after(string(),'EOF
')"/>
|
||||
<xsl:text> &&
</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates/>
|
||||
|
@ -145,6 +146,22 @@
|
|||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="literal">
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains(string(),'$@')">
|
||||
<xsl:variable name="content">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="substring-before(string($content),'$@')"/>
|
||||
<xsl:text>\$@</xsl:text>
|
||||
<xsl:value-of select="substring-after(string($content),'$@')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="replaceable">
|
||||
<xsl:choose>
|
||||
<xsl:when test="ancestor::sect1[@id='ch-system-groff']">
|
||||
|
|
Reference in a new issue