diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-07-01 13:26:57 +0000 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2009-02-13 00:01:43 +0200 |
commit | ad210b45cb0caf72c70faf735b2f03e57679e7b0 (patch) | |
tree | e4d5d46beacb3ad43e5884e4ffc4dd231cb98f59 /tools | |
parent | 2b1c6b6a5cd99ad3ef268d2b24144a7b2420613f (diff) |
doc-generator.xsl: fail if a signal does not have a name, is not a direct child of an interface, or has an argument with direction not 'in'; warn if a signal has an argument with direction explicitly 'in'
Diffstat (limited to 'tools')
-rw-r--r-- | tools/doc-generator.xsl | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tools/doc-generator.xsl b/tools/doc-generator.xsl index f1e8cf4..169ae20 100644 --- a/tools/doc-generator.xsl +++ b/tools/doc-generator.xsl @@ -798,6 +798,59 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA </xsl:template> <xsl:template match="signal"> + + <xsl:if test="not(parent::interface)"> + <xsl:message terminate="yes"> + <xsl:text>ERR: signal </xsl:text> + <xsl:value-of select="@name"/> + <xsl:text> does not have an interface as parent </xsl:text> + </xsl:message> + </xsl:if> + + <xsl:if test="not(@name) or @name = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: missing @name on signal </xsl:text> + <xsl:value-of select="concat(../@name, '.', @name)"/> + <xsl:text>: '</xsl:text> + <xsl:value-of select="@access"/> + <xsl:text>' </xsl:text> + </xsl:message> + </xsl:if> + + <xsl:for-each select="arg"> + <xsl:if test="not(@type) or @type = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: an arg of signal </xsl:text> + <xsl:value-of select="concat(../../@name, '.', ../@name)"/> + <xsl:text> has no type</xsl:text> + </xsl:message> + </xsl:if> + <xsl:if test="not(@name) or @name = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: an arg of signal </xsl:text> + <xsl:value-of select="concat(../../@name, '.', ../@name)"/> + <xsl:text> has no name</xsl:text> + </xsl:message> + </xsl:if> + <xsl:choose> + <xsl:when test="not(@direction)"/> + <xsl:when test="@direction='in'"> + <xsl:message terminate="no"> + <xsl:text>INFO: an arg of signal </xsl:text> + <xsl:value-of select="concat(../../@name, '.', ../@name)"/> + <xsl:text> has unnecessary direction 'in'</xsl:text> + </xsl:message> + </xsl:when> + <xsl:otherwise> + <xsl:message terminate="yes"> + <xsl:text>ERR: an arg of signal </xsl:text> + <xsl:value-of select="concat(../../@name, '.', ../@name)"/> + <xsl:text> has direction other than 'in'</xsl:text> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + <div xmlns="http://www.w3.org/1999/xhtml" class="signal"> <h3 xmlns="http://www.w3.org/1999/xhtml"> <a name="{concat(../@name, concat('.', @name))}"> |