symtable: Only consider first lv:rate ancestor for parent (bugfix)

This is a situation that should never happen (I haven't yet determined
whether or not we should support this type of thing in the future), but when
it does, do something intelligent.

* src/current/include/preproc/symtable.xsl (preproc:symtable)[c:*[@generates]]:
  Consider only first ancestor lv:rate.
master
Mike Gerwitz 2018-01-31 10:20:39 -05:00
parent b36cc3a942
commit 9c4fbdace9
1 changed files with 4 additions and 1 deletions

View File

@ -705,7 +705,10 @@
<xsl:template match="c:*[ @generates ]" mode="preproc:symtable" priority="5">
<xsl:variable name="parent" select="ancestor::lv:rate" />
<!-- it's possible that templates generating rate blocks will cause nested
rate blocks, so only take the first ancestor -->
<xsl:variable name="parent" as="element( lv:rate )"
select="ancestor::lv:rate[1]" />
<xsl:variable name="dim" as="xs:integer"
select="if ( @dim ) then @dim else 1" />